Solaris – Installing Perl modules on solaris 10

Print Friendly, PDF & Email

Solaris 10 comes with pre-installed perl with a fixed set of perl modules. When you want extra modules on your system, the modules need to be compiled on the system and the process isn’t simple to be honest. Googled a lot and visited various links. With all the information gathered, I managed to install the modules I needed. The process is outlined as below. So if your OS is same as mine, hopefully installation of modules will be less painful.

This is how I installed Data Dumper on Solaris 10 box under a directory /opt/perl/modules.


host1# uname -a
SunOS host1 5.10 Generic_142900-12 sun4v sparc SUNW,Sun-Fire-T200
host1# perl -v

This is perl, v5.8.4 built for sun4-solaris-64int
(with 32 registered patches, see perl -V for more detail)

Copyright 1987-2004, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at, the Perl Home Page.

Steps to compile the module:

1. Download the module from CPAN ( on to you desktop and copy into a directory on the server from there. Gunzip, untar, and cd into the module directory.

host1# gunzip Data-Dumper-2.131.tar.gz
host1# tar xvf Data-Dumper-2.131.tar
host1# cd Data-Dumper-2.131

2. Run the following command to generate Makefile.

host1# /usr/perl5/bin/perlgcc Makefile.PL LIB=/opt/perl/modules PREFIX=/opt/perl/modules
Checking if your kit is complete…
Looks good
Writing Makefile for Data::Dumper

NOTE: If it complains about a missing module and you know it is installed, then set the perl library path, and run perlgcc again.

3. Run “make” to prepare the make file.

host1# make
cp blib/lib/Data/
/usr/perl5/5.8.4/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap Dumper.xs > Dumper.xsc && mv Dumper.xsc Dumper.c
gcc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing -DVERSION=\”2.131\” -DXS_VERSION=\”2.131\” -fPIC “-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE” -DUSE_PPPORT_H Dumper.c
Dumper.xs: In function `XS_Data__Dumper_Dumpxs’:
Running Mkbootstrap for Data::Dumper ()
chmod 644
rm -f blib/arch/auto/Data/Dumper/
LD_RUN_PATH=”” gcc -G Dumper.o -o blib/arch/auto/Data/Dumper/
chmod 755 blib/arch/auto/Data/Dumper/
cp blib/arch/auto/Data/Dumper/
chmod 644 blib/arch/auto/Data/Dumper/

4. Run “make test” to check whether previous command worked correctly.

host1# make test
PERL_DL_NONLAZY=1 /usr/perl5/5.8.4/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘blib/lib’, ‘blib/arch’)” t/*.t
2/11 skipped: no ‘re::regexp_pattern’
1/7 skipped: perl 5.10.1 crashes and DD cannot help it
All tests successful, 3 subtests skipped.
Files=8, Tests=420, 3 wallclock secs ( 2.33 cusr + 0.22 csys = 2.55 CPU)

5. Run “make install” to install the module.

host1# make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /opt/perl/modules/sun4-solaris-64int/auto/Data/Dumper/
Installing /opt/perl/modules/sun4-solaris-64int/auto/Data/Dumper/
Installing /opt/perl/modules/sun4-solaris-64int/auto/Data/Dumper/
Installing /opt/perl/modules/sun4-solaris-64int/Data/
Appending installation info to /opt/perl/modules/sun4-solaris-64int/perllocal.pod

6. Run /usr/perl5/5.8.4/bin/instmodsh to verify the modules installed.

host1# instmodsh
Available commands are:
l – List all installed modules
m – Select a module
q – Quit the program
cmd? l
Installed modules are:
cmd? q

, , , ,


2 Responses to “Solaris – Installing Perl modules on solaris 10”

  1. Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /home/customer/www/ Stack trace: #0 /home/customer/www/ the_commenter_link() #1 /home/customer/www/ custom_comment(Object(WP_Comment), Array, 1) #2 /home/customer/www/ Walker_Comment->start_el('', Object(WP_Comment), 1, Array) #3 /home/customer/www/ Walker->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #4 /home/customer/www/ Walker_Comment->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #5 /home/customer/www/ Walker->paged_walk(Array, '5', 0, 0 in /home/customer/www/ on line 63