Compile the latest version of Perl on Solaris 10 September 14, 2010
Posted by claudio in Uncategorized.Tags: Perl, perlbrew, Solaris, Solaris 10, source
add a comment
Updated on Sept 09 2010.
Like on all UNIX operating systems, Solaris 10 supplies a Perl installation and it even adds its own modules in the Solaris namespace (yeah!). However, the version installed is 5.8.4, released on April 21, 2004 (boo!). Nowadays – in the Modern Perl’s times – you should use something as handy as App::perlbrew to install new versions of perl from source. As often in a corporate environment, however, it’s not always possible to directly reach the CPAN mirrors through perlbrew (proxy support is a work in progress). At the same time, it seems that a lot of people have trouble answering to the Configure questions to get the perl binary they need (at least 64-bit optimization and threads). This is how I compile perl on Solaris 10.
- Make sure you have the needed Solaris packages installed to compile C and C++ code. This is a good starting point. You can install the defaul Solaris compiler Sunstudio or gcc (provided as a SFW package in the installation media). Make sure the directories containing these binaries are in you PATH and /usr/ucb is not.
- Download the source, gunzip and untar it, cd to the directory.
- Run:
./Configure -ders -Dcc=cc -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Duse64bitall -Ud_strerror_r -Ud_signbit -Duselargefiles -Dprefix=/opt/perl-5.12.2 -Dprivlib=/opt/perl-5.12.2/lib -Darchlib=/opt/perl-5.12.2/lib -Dsiteprefix=/opt/perl-5.12.2/site -Dsitelib=/opt/perl-5.12.2/site/lib -Dsitearch=/opt/perl-5.12.2/site/lib -Dman1dir=/opt/perl-5.12.2/share/man/man1 -Dman3dir=/opt/perl-5.12.2/share/man/man3 -Dsiteman1dir=/opt/perl-5.12.2/site/share/man/man1 -Dsiteman3dir=/opt/perl-5.12.2/site/share/man/man3 -Dsed=/usr/bin/sed -Duseshrplib -Dcf_by="<Your name here>" -Dcf_email=<Your e-mail here>
(Change <…> with valid vales. Also, if you run Configure more than once, make sure to remove config.sh and not rename to something starting with config.sh. As an alternative you can remove the Perl source dir altogether and untar the source file again.) - make
In this step, when using the Sun Studio compiler, make can be replace by the faster (parallel) “dmake”. make test
Update: there is a small bug concerning the following tests:Failed 5 tests out of 1747, 99.71% okay.../cpan/Archive-Extract/t/01_Archive-Extract.t../cpan/IO-Compress/t/010examples-bzip2.t../cpan/IO-Compress/t/010examples-zlib.t../cpan/IO-Compress/t/cz-05examples.t../cpan/Test-Harness/t/regression.tWhen you run the test by hand they are OK, so they can be safely ignored (thanks people on #p5p).
make install
NB: if you are creating a package instead of installing, you will need the switch -Dinstallprefix
Happy Recent Perl!