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!
Install DBD::mysql for Solaris 10 system perl August 13, 2009
Posted by claudio in Uncategorized.Tags: DBD::mysql, Mysql, Perl, Solaris, Solaris 10, UNIX
10 comments
Installing DBD::mysql on Solaris 10 seems to be less trivial than “cpan DBD::mysql” when you want to use the system-supplied perl (5.8.4) and mysql (4.0.31) installation. Google shows a lot of people asking how to proceed, but surprisingly no answers. Typically, one gets this error at make time:
[...]
"dbdimp.c", line 4468: improper member use: com
"dbdimp.c", line 4468: improper member use: com
"dbdimp.c", line 4468: improper member use: com
"dbdimp.c", line 4630: undefined struct/union member: pmysql
"dbdimp.c", line 4653: undefined struct/union member: pmysql
cc: acomp failed for dbdimp.c
make: *** [dbdimp.o] Error 1
To install the module do this:
- Install the following Solaris mysql packages (if not already installed): SUNWmysqlr, SUNWmysqlu, SUNWmysqlS, SUNWmysqlt.
- Type the following as root:
cd /usr/sfw/share/src/mysql
./configure - Download the tar ball of the modules or, easier, go to your cpan build directory (set at cpan configure time), typically at ~/.cpan/build/DBD-mysql-<VERSION> (already there if you previously tried to install the module with cpan).
- Run the makefile with the following arguments (adapt to your own needs if necessary):
cd ~/.cpan/build/DBD-mysql-<VERSION>
perl Makefile.PL --libs '-R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm' --cflags '-I/usr/sfw/include -I/usr/include -I/usr/sfw/share/src/mysql/include' - Complete the normal installation (make, make test (if you have a test db running), make install).
That’s it.