Loading DBD::Oracle on Solaris 9

The Problem

When loading DBD::Oracle onto a Solaris 9 E450 with 64bit Oracle 9.2.0.1.0 using cpan I encountered the following error:

rm -f blib/arch/auto/DBD/Oracle/Oracle.so LD_RUN_PATH="/opt/oracle/product/9.2.0.1.0/lib:/opt/oracle/product/9.2.0.1.0/rdbms/lib" gcc -B/usr/ccs/bin/ -G - L/usr/local/lib Oracle.o dbdimp.o oci7.o oci8.o -L/opt/SUNWcluster/lib -R/opt/SUNWcluster/lib -o build -L/opt/ oracle/product/9.2.0.1.0/rdbms/lib/ -L/opt/oracle/product/9.2.0.1.0/lib/ -lclntsh -lnbeq9 -lnhost9 -lnus9 -lnld ap9 -lldapclnt9 -lnsslb9 -lnnis9 -lnoname9 -lntcp9 -lntcps9 -lnsslb9 -lntcp9 -lntns9 -lnsl -lsocket -lgen -ldl -R /opt/oracle/product/9.2.0.1.0/lib -laio -lposix4 -lkstat -lm -lthread -o blib/arch/auto/DBD/Oracle/Oracle.so ld: warning: option -o appears more than once, first setting taken ld: fatal: file /opt/oracle/product/9.2.0.1.0/lib//libclntsh.so: wrong ELF class: ELFCLASS64 ld: fatal: File processing errors. No output written to build

It is a 64 bit verses 32 bit problem.

The Solution

The solution I found was to use the 32 bit libraries instead of 64 bit.


mv $ORACLE_HOME/lib $ORACLE_HOME/lib64
mv $ORACLE_HOME/lib32 $ORACLE_HOME/lib.
mv $ORACLE_HOME/rdbms/demo/demo_rdbms.mk $ORACLE_HOME/rdbms/demo/demo_rdbms64.mk
mv $ORACLE_HOME/rdbms/demo/demo_rdbms32.mk $ORACLE_HOME/rdbms/demo/demo_rdbms.mk

Then run install DBD::Oracle again from cpan.

Even then the cpan make test failed (because the oracle db did not have a scott/tiger account). So I had to exit cpan and do a make install in .cpan/build/DBD-Oracle-1.14.


Author: Lance Rathbone
Last modified: Wednesday June 18, 2008