KeyWords:
SysAdmin,
Solaris
Building Perl CPAN modules on Solaris
The CPAN Perl module has a very convenient shell for downloading and
installing modules, with one simple command.
Everything works also on Solaris, as long as you are installing "pure
Perl" modules; if the module requires some additional C language
components, you enter a compiler version nightmare:
- The Perl interpreter embeds the compilation flags used to build it (look at the output of
perl -V
), and every additional module is built with the same configuration flags;
- The Perl interpreter shipped with Solaris 10 (and the one provided by BlastWave.org's CSW also!) are compiled with the Sun Studio
cc
;
- Sun does no longer ship Sun Studio
cc
with Solaris 10, they bundle GNU gcc
instead;
-
gcc
and cc
use a different set of command-line options.
The problem has been known for so long on Solaris, that there is even
a CPAN module
perlgcc
which installs a new set of Perl configuration files to work with
gcc
,
but it doesn't work with Perl 5.8 (the one shipped with Solaris 10).
Googling for the issue hasn't been of much help (except for a few
other
rants
on this topic - we're not alone :-)), until I found
this blog post
which explains that one can simply remove the conflicting options and get
a working Perl module.
So, I wrote a
perlcc
script, which removes the offending options and
invokes
gcc
instead. I installed
perlcc
as
/usr/bin/cc
on the
Solaris boxes, and -voila-
cpan -i Time::HiRes
is now working...
--
RiccardoMurri - 20 Nov 2008
Readers' comments