Thursday, March 24, 2005

Library linking

I am trying to get a perl script to work on a machine to connect to an Oracle database. It has modules installed. When I ran it, I got:

install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: /usr/local/bin/perl: fatal: libwtc8.so: open failed: No such file or directory at /usr/local/lib/perl5/5.00503/sun4-solaris/DynaLoader.pm line 169.

An lld command reveals that it could not be found. So I went into /usr/local and /u01/app/oracle directory to search for it, and surely enough I found it. Then adding the new path to the LD_LIBRARY_PATH and re-run it, then another error comes:

install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: /usr/local/bin/perl: fatal: ./libclntsh.so.8.0: wrong ELF class: ELFCLASS64 at /usr/local/lib/perl5/5.00503/sun4-solaris/DynaLoader.pm line 169.

I did a search in Google for that error, here is what I found in one article:

It appears that you are using the 64-bit Solaris Oracle drivers, however native driver support in S-PLUS uses the 32-bit drivers. The Oracle 64-bit Solaris driver installation does include the 32-bit drivers, however they are not used by default. The following should solve your problem:

The 32-bit driver libraries can be found in {ORACLE_HOME}/lib32 where ORACLE_HOME is the path to your Oracle installation. To ensure that S-PLUS can find this library you can set the flag at the top of the script used to start S-PLUS, usually installed as /usr/local/bin/Splus. Include the following:

LD_LIBRARY_PATH=${ORACLE_HOME}/lib32:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH

This should resolve the problem, however if not, as an alternative try backing up the ORACLE_HOME/lib directory and then renaming ORACLE_HOME/lib32 as ORACLE_HOME/lib, as this should ensure the libraries are correctly available.

I surely found the lib32 library, and linked the file and everything is working now.
Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?