Tuesday, March 02, 2010

Perl on Snow Leopard

I just spent the past few hours messing with perl libraries and system libraries just so I could install and utilize the perl GD package to draw line graphs for a bioinformatics assignment (GD::Graph::lines specifically). For anyone that stumbles upon this page thinking that upgrading to Snow Leopard munged your pristine and not frequently used but for that one class all that time ago perl installation, here’s what I did:

Zlib barfed out this error message

Deep recursion on subroutine "Compress::Raw::Zlib::AUTOLOAD"

so I found this article that suggested I clear out all Compress::Zlib files and reinstall. Once I did that I reinstalled GD and Zlib from source by navigating to the directory of the unzipped source and issuing

make install (you may need to add sudo)

Once I got those installed from the perl CPAN shell issuing install GD worked as expected. Hoo-rah.


澄冰寒雪 said...

I am suffering from the same problem too. How could installing Perl packages be so hard on Mac OS X? Depressed..

Thank you for the post! It saved me!

澄冰寒雪 said...

I tried to following commands but installing LWP is stilling returning errors.

sudo /sw/bin/fink selfupdate
sudo /sw/bin/fink list compress
sudo /sw/bin/fink purge --recursive compress-raw-zlib-pm588
sudo /sw/bin/fink purge --recursive compress-raw-bzip2-pm588
sudo /sw/bin/fink purge --recursive io-compress-base-pm
sudo /sw/bin/fink install compress-raw-zlib-pm588
sudo /sw/bin/fink install compress-raw-bzip2-pm588
sudo /sw/bin/fink install compress-zlib-pm588
sudo /sw/bin/fink install io-compress-bzip2-pm588
sudo /sw/bin/fink install io-compress-zlib-pm588

I copied files under blib to /sw/lib/perl5/5.8.8/darwin-thread-multi-2level, and LWP works.
However, this is ugly.
Any hint?