Installing PerlMagick on OSX
I have built up a pretty large collection of cool perl scripts that use the Image::Magick perl extensions – some of these are documented in Flickr Hacks. Recently I switched to a using a Mac, and I’ve been having a devil of a time using these scripts, because they require ImageMagick, and LWP, and I was getting all kinds of errors trying to install these into the version of Perl that shipped with the Mac.
I finally managed it today. First of all, I installed ActiveState Perl on my Mac, and set up my PATH variable to look in the /usr/local/bin directory first. I modified my various perl scripts to use this version of Perl, instead of the built-in one. ActiveState perl has built-in support for more of the basic CPAN modules that I tend to use, and a pretty good cpan utility for getting more of them. Unfortunately, ImageMagick is still a little too fringe and is not supported in their collection of CPAN ports.
So… I followed the instructions at Josh Clark’s excellent blog to install ImageMagick. This requires first installing MacPorts which is another tool for easing open source installations on the Mac (similar to Fink, which I’ve used, but which didn’t help for this particular problem).
A big thank you to Josh Clark for providing these instructions – I’ve been banging my head against the wall on this one for weeks!
UPDATE (7/2008): I recently went through this process again on a newer Mac with the Leopard OS. This time, I found it easier to use the Perl & ImageMagick that comes with MacPorts, rather than using ActiveState Perl. There were still some issues though… There is currently no MacPort port of the LWP::Simple package, so I had to use CPAN to install that, and it wasn’t painless. Also, the MacPort version of ImageMagick should be installed with the +perl option, rather than using the standalone p5_perl_magick package (which is no longer needed).