Tips for running CPAN in Solaris 11

in unix •  6 months ago

CPAN is available from the official Solaris 11 distribution, you may find it in package manager under publisher "solaris". It is permissible to have both Perl version 5.8 and 5.12 installed simultaneously.

Unlike most Unix/Linux distributions, cpan executable is not in $PATH in a Solaris 11. It is located at /usr/perl5/bin/ which is a symbol link to the default Perl version your Solaris uses:

lrwxrwxrwx 1 root root 10 2012-08-21 17:30 bin -> ./5.12/bin

While many CPAN models only contain Perl code, some of them require a C compiler to build and install. CPAN will find and use the C compiler at /bin/cc to build these modules. Be aware that Solaris 11 does not offer a C compiler by default, and the officially distributed gcc3 fails to compile most of the Perl modules.

To get a modern and up-to-date C compiler for Solaris 11, download "Solaris Studio" that comes with comprehensive C, C++, and Fortran compilers and libraries. After having installed the Solaris Studio, create a symbol link ln -sf /bin/cc /opt/solarisstudio-VERSION/cc.

Afterwards, Perl modules will no longer experience trouble with compiling their C code.

CPAN modules that install binaries will have the binary programs placed under /usr/perl/bin/ directory.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!