Problem loading DBD::Informix

C

Christian Eriksson

Hi!

I'm programming Perl DBI accessing Informix databases. I have a
problem on a Solaris machine to use my installed Informix driver
(DBD::Informix). I get the following error message:

install_driver(Informix) failed: Can't load
'/usr/perl5/5.6.1/site_perl/sun4-solaris/auto/DBD/Informix/Informix.so'
for module DBD::Informix: ld.so.1: /usr/bin/perl: fatal: libifsql.so:
open failed: No such file or directory at
/usr/perl5/5.6.1/sun4-solaris/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 /local/bstat/ins_rutin.pl line 33

At line 33 in /local/bstt/ins_rutin.pl I do:

$dbh = DBI->connect('DBI:Informix:bstat') or die $dbh::errstr, exit 1;

When executing the script my environment has, amongst other
environment variables, this:
INFORMIXDIR=/SSW/informix9.4
LD_LIBRARY_PATH=/SSW/informix9.4/lib:/SSW/informix9.4/lib/esql:/SSW/informix9.4/lib/tools

and libifsql.so is present in

S0222035 find / -name libifsql.so -print 2>/dev/null
/SSW/informix9.4/lib/esql/libifsql.so
/SSW/informix/sdk2.50/lib/esql/libifsql.so

Why doesn't /usr/perl5/5.6.1/sun4-solaris/DynaLoader.pm find
libifsql.so?

(I use to run a test to see if DBD::Informix is installed and
available:

perl -e 'use DBI;@drivers = DBI->available_drivers;foreach (@drivers)
{print "$_\n"}'

and from that I get:

ExampleP
Informix
Proxy

this is as root with environment, amongst other environment variables,
LD_LIBRARY_PATH=/usr/local/lib:/usr/ccs/lib

Shouldn't this test be sufficient to assure DBD::Informix is installed
and available?)


Some information:
S0222035 uname -a
SunOS S0222035 5.8 Generic sun4us sparc FJSV,GPUS

S0222035 perl -v

This is perl, v5.6.1 built for sun4-solaris

Database Server:
presto1@S0222035> onstat -

Informix Dynamic Server Version 9.40.FC1


Regards Christian Eriksson
 
J

Jonathan Leffler

Christian said:
I'm programming Perl DBI accessing Informix databases. I have a
problem on a Solaris machine to use my installed Informix driver
(DBD::Informix). I get the following error message:

install_driver(Informix) failed: Can't load
'/usr/perl5/5.6.1/site_perl/sun4-solaris/auto/DBD/Informix/Informix.so'
for module DBD::Informix: ld.so.1: /usr/bin/perl: fatal: libifsql.so:
open failed: No such file or directory at
/usr/perl5/5.6.1/sun4-solaris/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 /local/bstat/ins_rutin.pl line 33

At line 33 in /local/bstt/ins_rutin.pl I do:

$dbh = DBI->connect('DBI:Informix:bstat') or die $dbh::errstr, exit 1;

When executing the script my environment has, amongst other
environment variables, this:
INFORMIXDIR=/SSW/informix9.4
LD_LIBRARY_PATH=/SSW/informix9.4/lib:/SSW/informix9.4/lib/esql:/SSW/informix9.4/lib/tools

What was the value of INFORMIXDIR when the DBD::Informix was compiled?
Did you build it with DBD_INFORMIX_RELOCATABLE_INFORMIXDIR=yes in
the environment.

My suspicion is that you built it without the relocatable flag - so
the library paths were hardwired to the INFORMIXDIR at the time of
compilation. I'm not 100% confident of that; I'd have at least half
expected the message to include the full pathname. Try running 'ldd'
on the Informix.so and see what it diagnoses...
 
C

Christian Eriksson

Jonathan Leffler said:
What was the value of INFORMIXDIR when the DBD::Informix was compiled?
Did you build it with DBD_INFORMIX_RELOCATABLE_INFORMIXDIR=yes in
the environment.
Sorry, but I don't know because I didn't build it myself!
My suspicion is that you built it without the relocatable flag - so
the library paths were hardwired to the INFORMIXDIR at the time of
compilation. I'm not 100% confident of that; I'd have at least half
expected the message to include the full pathname. Try running 'ldd'
on the Informix.so and see what it diagnoses...
Here's the output:
root@S0232053# pwd
/usr/perl5/5.6.1/site_perl/sun4-solaris/auto/DBD/Informix
root@S0232053# ldd Informix.so
libifsql.so => (file not found)
libifasf.so => (file not found)
libifgen.so => (file not found)
libifos.so => (file not found)
libifgls.so => (file not found)
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.1 => /usr/lib/libm.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libelf.so.1 => /usr/lib/libelf.so.1
libifglx.so => (file not found)
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1

What do you make of this?

/Christian
 
C

Christian Eriksson

Jonathan Leffler said:
What was the value of INFORMIXDIR when the DBD::Informix was compiled?
Did you build it with DBD_INFORMIX_RELOCATABLE_INFORMIXDIR=yes in
the environment.

My suspicion is that you built it without the relocatable flag - so
the library paths were hardwired to the INFORMIXDIR at the time of
compilation. I'm not 100% confident of that; I'd have at least half
expected the message to include the full pathname. Try running 'ldd'
on the Informix.so and see what it diagnoses...

My apologies for the recent reply. I ran the command on the wrong
machine ruining my credibility in this forum ;-)

OK, I give it another try. Here's the output from ldd on the right
machine as the user from the first post:

presto1@S0222035> echo $LD_LIBRARY_PATH
/SSW/informix9.4/lib:/SSW/informix9.4/lib/esql:/SSW/informix9.4/lib/tools
presto1@S0222035> ldd
/usr/perl5/5.6.1/site_perl/sun4-solaris/auto/DBD/Informix.so
libifsql.so => (file not found)
libifasf.so => (file not found)
libifgen.so => (file not found)
libifos.so => (file not found)
libifgls.so => (file not found)
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.1 => /usr/lib/libm.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libelf.so.1 => /usr/lib/libelf.so.1
libifglx.so => (file not found)
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/FJSV,GPUS/lib/libc_psr.so.1

My LD_LIBRARY_PATH points at 64-bit so-objects and I think that's the
problem because when I change LD_LIBRARY_PATH to:

presto1@S0222035> echo $LD_LIBRARY_PATH
/SSW/informix/sdk2.50/lib:/SSW/informix/sdk2.50/lib/esql
presto1@S0222035> ldd
/usr/perl5/5.6.1/site_perl/sun4-solaris/auto/DBD/Informix.so
libifsql.so => /SSW/informix/sdk2.50/lib/esql/libifsql.so
libifasf.so => /SSW/informix/sdk2.50/lib/libifasf.so
libifgen.so => /SSW/informix/sdk2.50/lib/esql/libifgen.so
libifos.so => /SSW/informix/sdk2.50/lib/esql/libifos.so
libifgls.so => /SSW/informix/sdk2.50/lib/esql/libifgls.so
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.1 => /usr/lib/libm.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libelf.so.1 => /usr/lib/libelf.so.1
libifglx.so => /SSW/informix/sdk2.50/lib/esql/libifglx.so
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/FJSV,GPUS/lib/libc_psr.so.1

everything looks fine because now libifsql.so, and the other lib
files, is 32-bit

presto1@S0222035> file /SSW/informix/sdk2.50/lib/esql/libifsql.so
/SSW/informix/sdk2.50/lib/esql/libifsql.so: ELF 32-bit MSB dynamic
lib SPARC
Version 1, dynamically linked, not stripped

and running

presto1@S0222035> ./ins_rutin.pl presto db-ladd-lan06
presto1@S0222035> echo $?
0

executes without error messages and carries out the expected
operations against the database. My INFORMIXDIR is
presto1@S0222035> echo $INFORMIXDIR
/SSW/informix9.4

/Christian Eriksson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top