rootcho has asked for the wisdom of the Perl Monks concerning the following question:

Found a clumsy solution, if anyone can come up with better one will be nice

As mje suspected (thanks) there was something fishy with those two "harmless" missing lib-links... here

Warning: -L../../ changed to -L/root/.cpan/build/DBD-Oracle-1.28-enbAG +6/../../ Note (probably harmless): No library found for -locci Note (probably harmless): No library found for -lclntsh

I used brute force i.e. created two symlinks in "/root/.cpan"

/root/.cpan/libclntsh.so -> /usr/lib64/oracle/11.2.0.2/client/lib/libc +lntsh.so.11.1 /root/.cpan/libocci.so -> /usr/lib64/oracle/11.2.0.2/client/lib/libocc +i.so.11.1
Now when I compile :
/root/.cpan/build/DBD-Oracle-1.28-enbAG6/blib/arch/auto/DBD/Oracle # ldd Oracle.so linux-vdso.so.1 => (0x00007fff821f7000) libclntsh.so.11.1 => /usr/lib/oracle/11.2.0.2/client/lib/libclntsh +.so.11.1 (0x00007f0a3c222000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0a3bfd7000) libc.so.6 => /lib/libc.so.6 (0x00007f0a3bc81000) libnnz11.so => /usr/lib/oracle/11.2.0.2/client/lib/libnnz11.so (0x +00007f0a3b8b9000) libdl.so.2 => /lib/libdl.so.2 (0x00007f0a3b6b4000) libm.so.6 => /lib/libm.so.6 (0x00007f0a3b432000) libnsl.so.1 => /lib/libnsl.so.1 (0x00007f0a3b21a000) libaio.so.1 => /usr/lib/libaio.so.1 (0x00007f0a3b017000) /lib64/ld-linux-x86-64.so.2 (0x00007f0a3ecaa000) librt.so.1 => /lib/librt.so.1 (0x00007f0a3ae0e000)

make test goes well as well

--------------------------------------------------------------------------------

Trying to install DBD::Oracle

export ORACLE_HOME=/usr/lib/oracle/11.2.0.2/client export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH C_INCLUDE_PATH=/usr/lib/oracle/11.2.0.2/client/include cpan -i DBD::Or +acle

It compiles OK.. but make test fails at :

undefined symbol: OCITypeByRef i.e.
...... Running make test PERL_DL_NONLAZY=1 /usr/bin/perl5.12.3 "-MExtUtils::Command::MM" "-e" " +test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01base.t .............. # Test loading DBI, DBD::Oracle and version t/01base.t .............. 1/6 # Failed test 'install_driver' # at t/01base.t line 22. Failed to load Oracle extension and/or shared libraries: install_driver(Oracle) failed: Can't load '/root/.cpan/build/DBD-Oracl +e-1.28-EfF3QS/blib/arch/auto/DBD/Oracle/Oracle.so' for module DBD::Or +acle: /root/.cpan/build/DBD-Oracle-1.28-EfF3QS/blib/arch/auto/DBD/Ora +cle/Oracle.so: undefined symbol: OCITypeByRef at /usr/lib64/perl5/5.1 +2.3/x86_64-linux-thread-multi/DynaLoader.pm line 200. at (eval 8) line 3 Compilation failed in require at (eval 8) line 3. Perhaps a required shared library or dll isn't installed where expecte +d at t/01base.t line 19
any ideas, why that could be ...

Replies are listed 'Best First'.
Re: DBD::Oracle installation
by Anonymous Monk on Jul 08, 2011 at 00:52 UTC

    any ideas, why that could be ...

    It is not a mystery. For whatever reason, LD_LIBRARY_PATH isn't getting through to the process running the test

    You need to set it in your bashrc/profile

    Instead of setting an enviroment variable, LD_LIBRARY_PATH, you need to use ldconfig

    LD_LIBRARY_PATH is a workaround for those who don't have root

      I put it in .bashrc (the exports) And yes I did ldconfig.
      # ld.so.conf autogenerated by env-update; make all changes to # contents of /etc/env.d directory /usr/local/lib /usr/lib32/opengl/xorg-x11/lib /usr/lib64/opengl/xorg-x11/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 /lib32 /usr/lib32 /usr/local/lib32 /usr/x86_64-pc-linux-gnu/lib /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2 /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/32 /usr/lib64/xulrunner-1.9.2 /usr/lib64/openmotif-2.2 /usr/lib64/oracle/11.2.0.2/client/lib /usr/lib64/postgresql-9.0/lib64 /usr/games/lib /usr/games/lib64 /usr/games/lib32 /opt/flash-libcompat /usr/lib/oracle/11.2.0.2/client/lib
Re: DBD::Oracle installation
by mje (Curate) on Jul 08, 2011 at 08:01 UTC

    Not sure why you set C_INCLUDE_PATH, I didn't think that was necessary. Would be interesting to see the output of running Makefile.PL and not just the test output. Are you sure your Oracle is 64bit as it looks like your Perl is (from /usr/lib64/perl5). Can you run ldd on the generated Oracle.so to see what it says?

      Here is how it looks if I do it manually (again I use INC otherwise I get errors for missing stuff..):
      # perl Makefile.PL INC='-I/usr/lib/oracle/11.2.0.2/client/rdbms/public + -I/usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi/auto/D +BI' Using DBI 1.616 (for perl 5.012003 on x86_64-linux-thread-multi) insta +lled in /usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi/a +uto/DBI/ Configuring DBD::Oracle for perl 5.012003 on linux (x86_64-linux-threa +d-multi) Remember to actually *READ* the README file! Especially if you have an +y problems. Installing on a linux, Ver#2.6 Using Oracle in /usr/lib/oracle/11.2.0.2/client DEFINE _SQLPLUS_RELEASE = "1102000200" (CHAR) Oracle version 11.2.0.2 (11.2) Found /usr/lib/oracle/11.2.0.2/client/rdbms/demo/demo_xe.mk Using /usr/lib/oracle/11.2.0.2/client/rdbms/demo/demo_xe.mk Looks like Oracle XE (/usr/lib/oracle/11.2.0.2/client/rdbms/demo/demo_ +xe.mk) Reading /usr/lib/oracle/11.2.0.2/client/rdbms/demo/demo_xe.mk Your LD_LIBRARY_PATH env var is set to '/usr/lib/oracle/11.2.0.2/clien +t/lib:/usr/lib/oracle/11.2.0.2/client/lib' client_version=11.2 DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"11.2.0.2 +\" -DORA_OCI_102 -DORA_OCI_112 Checking for functioning wait.ph System: perl5.012003 linux mybox 2.6.34-sabayon #1 smp mon may 31 16:0 +0:15 utc 2010 x86_64 intel(r) core(tm) i5 cpu m 520 @ 2.40ghz genuine +intel gnulinux Compiler: x86_64-pc-linux-gnu-gcc -O2 -march=x86-64 -pipe -D_REENTRA +NT -D_GNU_SOURCE -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FI +LE_OFFSET_BITS=64 Linker: /usr/bin/ld Sysliblist: Oracle makefiles would have used these definitions but we override the +m: CC: /usr/bin/gcc LDFLAGS: -g [-g] Linking with -L../../ -locci -lclntsh -lpthread Checking if your kit is complete... Looks good Warning: -L../../ changed to -L/root/.cpan/build/DBD-Oracle-1.28-enbAG +6/../../ Note (probably harmless): No library found for -locci Note (probably harmless): No library found for -lclntsh LD_RUN_PATH=/usr/lib/oracle/11.2.0.2/client/lib:/usr/lib/oracle/11.2.0 +.2/client/rdbms/lib Using DBD::Oracle 1.28. Using DBD::Oracle 1.28. Using DBI 1.616 (for perl 5.012003 on x86_64-linux-thread-multi) insta +lled in /usr/lib64/perl5/site_perl/5.12.3/x86_64-linux-thread-multi/a +uto/DBI/ Writing Makefile for DBD::Oracle *** If you have problems... read all the log printed above, and the README and README.help.tx +t files. (Of course, you have read README by now anyway, haven't you?)
        Similar post few weeks ago

        Remember to actually *READ* the README file! Especially if you have any problems.

        ***  If you have problems...
             read all the log printed above, and the README and README.help.txt files.
             (Of course, you have read README by now anyway, haven't you?)
        http://search.cpan.org/dist/DBD-Oracle/README

        If you're setting INC= you have to set LIBS= also, as in LIBS='-L/path/to/where/occi/lives  -locci -lclntsh -lpthread'

      If I don't specify C_INCLUDE_PATH it does not compile, because it can't find the include files.
      # ldd Oracle.so linux-vdso.so.1 => (0x00007fffb01ff000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f8a4cfb1000) libc.so.6 => /lib/libc.so.6 (0x00007f8a4cc5a000) /lib64/ld-linux-x86-64.so.2 (0x00007f8a4d443000)

        There is something very wrong with that. There is no reference to any Oracle shared libs. e.g. for my instant client installation ldd on Oracle.so shows:

        $ ldd /usr/local/lib/perl/5.10.0/auto/DBD/Oracle/Oracle.so linux-gate.so.1 => (0x00d22000) libclntsh.so.11.1 => /home/martin/instantclient_11_1/libclntsh.so. +11.1 (0x00d23000) libc.so.6 => /lib/libc.so.6 (0x00110000) libnnz11.so => /home/martin/instantclient_11_1/libnnz11.so (0x0026 +d000) libdl.so.2 => /lib/libdl.so.2 (0x00417000) libm.so.6 => /lib/libm.so.6 (0x0041b000) libpthread.so.0 => /lib/libpthread.so.0 (0x00441000) libnsl.so.1 => /lib/libnsl.so.1 (0x009bf000) libaio.so.1 => /lib/libaio.so.1 (0x0045b000) /lib/ld-linux.so.2 (0x00b71000)

        I guess we need to see the bit after perl Makefile.PL but before you run make test i.e., the compilation and linking phases.

        UPDATE: I've only just noticed:

        042 Note (probably harmless): No library found for -locci 043 Note (probably harmless): No library found for -lclntsh

        I doubt that is harmless at all