Operating System - HP-UX
1832452 Members
3552 Online
110042 Solutions
New Discussion

How-to build Perl 5.6.1 with DBI and DBD

 
Claus Nielsen_1
New Member

How-to build Perl 5.6.1 with DBI and DBD

Hi

I have encountered some severe problems with installing Perl 5.6.1 and DBI/DBD and hope that somebody is able to help.

My system:
$ model
9000/800/N4000-44
$ uname -a
HP-UX electra B.11.11 U 9000/800 623379392 unlimited-user license

My compiler:
/opt/ansic/bin/cc

My Oracle installation:
Oracle 8.1.7.4 64-bit

/oraapp/oracle8/product/8.1.7/bin/sqlplus: PA-RISC1.1 shared executable dynamically linked -not stripped

I am able to download and compile Perl without problems "Configure -A prepend:libswanted='cl pthread ' -Ubincompat5005" and I am also able to install DBI by 'perl -MCPAN -e 'install Bundle::DBI''

When I try to install DBD::Oracle I get the following error:

PERL_DL_NONLAZY=1 /home/cni/perl5/bin/perl -Iblib/arch -Iblib/lib -I/home/cni/perl5/lib/5.6.1/PA-RISC2.0 -I/home/cni/perl5/lib/5.6.1 -e 'use Test::Harness qw(&runtests
$verbose); $verbose=0; runtests @ARGV;' t/*.t
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1
/usr/lib/dld.sl: Exec format error
Failed to load Oracle extension and/or shared libraries:
install_driver(Oracle) failed: Can't load 'blib/arch/auto/DBD/Oracle/Oracle.sl' for module DBD::Oracle: Exec format error at /home/cni/perl5/lib/5.6.1/PA-RISC2.0/DynaLoader.pm line 206.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/base.t line 19
The remaining tests will probably also fail with the same error.

*** Please read the README and README.help files for help. ***

t/base.......FAILED tests 4-5
Failed 2/5 tests, 60.00% okay
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1
/usr/lib/dld.sl: Exec format error
install_driver(Oracle) failed: Can't load 'blib/arch/auto/DBD/Oracle/Oracle.sl' for module DBD::Oracle: Exec format error at /home/cni/perl5/lib/5.6.1/PA-RISC2.0/DynaLoader.pm line 206.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/general.t line 20
t/general....dubious
Test returned status 255 (wstat 65280, 0xff00)
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1
/usr/lib/dld.sl: Exec format error
Can't load 'blib/arch/auto/DBD/Oracle/Oracle.sl' for module DBD::Oracle: Exec format error at /home/cni/perl5/lib/5.6.1/PA-RISC2.0/DynaLoader.pm line 206.
at t/long.t line 4
Compilation failed in require at t/long.t line 4.
BEGIN failed--compilation aborted at t/long.t line 4.
t/long.......dubious
Test returned status 255 (wstat 65280, 0xff00)
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1

I have tried to play around with SHLIB_PATH and LD_PRELOAD as suggested in another thread on this forum but without success.

Have anybody had more success?

6 REPLIES 6
MANOJ SRIVASTAVA
Honored Contributor

Re: How-to build Perl 5.6.1 with DBI and DBD

 
Claus Nielsen_1
New Member

Re: How-to build Perl 5.6.1 with DBI and DBD

 
Claus Nielsen_1
New Member

Re: How-to build Perl 5.6.1 with DBI and DBD

 
Claus Nielsen_1
New Member

Re: How-to build Perl 5.6.1 with DBI and DBD

I can see from some other threads that a dynamically linked perl is causing a lot of problems, so I went for a statically linked DBD module.

I downloaded DBD from CPAN and according to the documentation the procedure for a static DBD is as below:
make realclean
perl Makefile.PL LINKTYPE=static
make
make perl (you'll need to use and install _this_ new perl binary)
make test
make -f Makefile.aperl inst_perl MAP_TARGET=perl (install new perl)
make install (install DBD::Oracle)

Everything went fine until I got to the 'make perl' step.
/PA-RISC2.0/CORE/libperl.a `cat blib/arch/auto/DBD/Oracle/extralibs.all` -lcl -lnsl -lnm -ldld -lm -lc -lndir -lcrypt -lsec
/usr/ccs/bin/ld: Can't open sscoreed.o
/usr/ccs/bin/ld: No such file or directory
make[1]: *** [perl] Error 1

The sscoreed.o file was found in $LD_LIBRARY_PATH

My solution was to extract the failed compile command in a script where I added the the static libraries from Oracle.

/opt/ansic/bin/cc -Wl,+vnocompatwarnings,+n -L/usr/local/lib -Wl,-E -Wl,-B,deferred -o perl -O -Onolimit ./perlmain.o Oracle.o dbdimp.o oci7.o oci8.o blib/arch/auto/DBD/Oracle/Oracle.a /opt/perl5/lib/5.6.1/PA-RISC2.0/auto/DynaLoader/DynaLoader.a /opt/perl5/lib/5.6.1/PA-RISC2.0/CORE/libperl.a `cat blib/arch/auto/DBD/Oracle/extralibs.all` -lcl -lnsl -lnm -ldld -lm -lc -lndir -l
crypt -lsec -L/oraapp/oracle8/product/8.1.7/lib/ -lclntst8 `cat /oraapp/oracle8/product/8.1.7/lib/ldflags` `cat /oraapp/oracle8/product/8.1.7/lib/sysliblist` -lm -lpthread -lpthread -lclntst8 `cat /oraapp/oracle8/product/8.1.7/lib/ldflags` `cat /oraapp/oracle8/product/8.1.7/lib/syslibli
st` -lm -lpthread -lpthread

Then my compilation was able to progress and my perl installed perfectly

harry d brown jr
Honored Contributor

Re: How-to build Perl 5.6.1 with DBI and DBD

Have you looked here:

https://www.beepz.com/personal/merijn/

live free or die
harry
Live Free or Die
H.Merijn Brand (procura
Honored Contributor

Re: How-to build Perl 5.6.1 with DBI and DBD

Why 5.6.1?

5.8.0 has full Unicode support. Fits nicely with Oracle :) 64bit support has greatly improved in 5.8.0 over 5.6.1, including integer preservation as long as possible.

You *do* have HPc, please use it in favour of gcc. It's about 26% percent faster along the line!

The perl ports on beepz harry mentions are gcc builds.

--8<---
My Oracle installation:
Oracle 8.1.7.4 64-bit

/oraapp/oracle8/product/8.1.7/bin/sqlplus: PA-RISC1.1 shared executable dynamically linked -not stripped
-->8---

Are you **SURE** you have a 64bit Oracle? I'm sorry, but sqlplus is a 32bit application. Rethink. I guess you need a 32bit perl.
Enjoy, Have FUN! H.Merijn