http://qs1969.pair.com?node_id=1049178

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

Hello, I am new to Linux (used to Mac OS X). I am trying to compile DBD::Oracle on Oracle Linux Server release 5.8. I have the 11.2.0.3 Oracle client libs installed on the system, and am stuck in the older Perl 5.8.8. I am not an admin on the system, so these are things I have little control over. I also can't use CPAN, but am installing all modules manually with a custom path I can write to. I set $ORACLE_HOME, $LD_LIBRARY_PATH appropriately So here's what I am trying:
$ perl Makefile.PL PREFIX=/home/acenter/usr/perl/ Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) instal +led in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/a +uto/DBI/ Configuring DBD::Oracle for perl 5.008008 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/orasys/11.2.0.3_client DEFINE _SQLPLUS_RELEASE = "1102000300" (CHAR) Oracle version 11.2.0.3 (11.2) Found /usr/orasys/11.2.0.3_client/rdbms/lib/ins_rdbms.mk Using /usr/orasys/11.2.0.3_client/rdbms/lib/ins_rdbms.mk Your LD_LIBRARY_PATH env var is set to '/usr/orasys/11.2.0.3_client/li +b/' Reading /usr/orasys/11.2.0.3_client/rdbms/lib/ins_rdbms.mk Reading /usr/orasys/11.2.0.3_client/rdbms/lib/env_rdbms.mk WARNING: Oracle /usr/orasys/11.2.0.3_client/rdbms/lib/ins_rdbms.mk doe +sn't define a 'build' rule. WARNING: I will now try to guess how to build and link DBD::Oracle for + you. This kind of guess work is very error prone and Oracle-versio +n sensitive. It is possible that it won't be supported in future versions +of DBD::Oracle. *PLEASE* notify dbi-users about exactly _why_ you had to buil +d it this way. Found header files in /usr/orasys/11.2.0.3_client/rdbms/public. client_version=11.2 DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"11.2.0.3 +\" -DORA_OCI_102 -DORA_OCI_112 Checking for functioning wait.ph System: perl5.008008 linux ca-build10.us.oracle.com 2.6.20-1.3002.fc6x +en #1 smp thu apr 30 18:08:39 pdt 2009 x86_64 x86_64 x86_64 gnulinux Compiler: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexception +s -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_ +REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-afte +r-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_B +ITS=64 -I/usr/include/gdbm Linker: /usr/bin/ld Sysliblist: -ldl -lm -lpthread -lnsl -lirc -lipgo -lsvml Oracle makefiles would have used these definitions but we override the +m: CC: $(COMPDIR)/bin/gcc CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\ $(SHARED_CFLAG) $(USRFLAGS) [$(GFLAG) -O3 $(CDEBUG) -m32 -trigraphs -fPIC -I/usr/orasys +/11.2.0.3_client/rdbms/demo -I/usr/orasys/11.2.0.3_client/rdbms/publi +c -I/usr/orasys/11.2.0.3_client/plsql/public -I/usr/orasys/11.2.0.3_c +lient/network/public -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D +_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_T +HREADS -D__NO_CTYPE=1 -DLDAP_CM $(LPFLAGS) $(PLSQLNCGFLAGS) $(USRFLAG +S)] LDFLAGS: $(LDFLAGS32) [-m32 -o $@ -L/usr/orasys/11.2.0.3_client/rdbms//lib32/ -L/ +usr/orasys/11.2.0.3_client/lib32/ -L/usr/orasys/11.2.0.3_client/lib32 +/stubs/] Linking with -lclntsh -ldl -lm -lpthread -lnsl -lirc -lipgo -lsvml -l +dl -lm -lpthread [from $(OCISHAREDLIBS)] WARNING: META_MERGE is not a known parameter. Checking if your kit is complete... Warning: the following files are missing in your kit: Changes dbdimp.c examples/bind.pl examples/commit.pl examples/curref.pl examples/ex.pl examples/inserting_longs.pl examples/japh examples/mktable.pl examples/ora_explain.pl examples/oradump.pl examples/proc.pl examples/read_long_via_blob_read.pl examples/README examples/sql examples/tabinfo.pl hints/macos_lib.syms META.json mkta.pl oci8.c README.mkdn Please inform the author. 'META_MERGE' is not a known MakeMaker parameter name. LD_RUN_PATH=/usr/orasys/11.2.0.3_client/lib Using DBD::Oracle 1.64. Using DBD::Oracle 1.64. Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) instal +led in /usr/lib64/perl5/vendor_perl/5.8.8/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?) $ make cp lib/DBD/Oracle/Troubleshooting/Cygwin.pod blib/lib/DBD/Oracle/Troub +leshooting/Cygwin.pod cp lib/DBD/Oracle.pm blib/lib/DBD/Oracle.pm cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h cp lib/DBD/Oracle/Troubleshooting/Hpux.pod blib/lib/DBD/Oracle/Trouble +shooting/Hpux.pod cp lib/DBD/Oracle/Troubleshooting/Vms.pod blib/lib/DBD/Oracle/Troubles +hooting/Vms.pod cp lib/DBD/Oracle/Troubleshooting/Linux.pod blib/lib/DBD/Oracle/Troubl +eshooting/Linux.pod cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm cp lib/DBD/Oracle/Troubleshooting.pod blib/lib/DBD/Oracle/Troubleshoot +ing.pod cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h cp lib/DBD/Oracle/Troubleshooting/Sun.pod blib/lib/DBD/Oracle/Troubles +hooting/Sun.pod cp lib/DBD/Oracle/Troubleshooting/Macos.pod blib/lib/DBD/Oracle/Troubl +eshooting/Macos.pod cp lib/DBD/Oracle/Troubleshooting/Aix.pod blib/lib/DBD/Oracle/Troubles +hooting/Aix.pod cp lib/DBD/Oracle/Object.pm blib/lib/DBD/Oracle/Object.pm cp lib/DBD/Oracle/Troubleshooting/Win64.pod blib/lib/DBD/Oracle/Troubl +eshooting/Win64.pod cp lib/DBD/Oracle/Troubleshooting/Win32.pod blib/lib/DBD/Oracle/Troubl +eshooting/Win32.pod cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm /usr/bin/perl -p -e "s/~DRIVER~/Oracle/g" /usr/lib64/perl5/vendor_perl +/5.8.8/x86_64-linux-thread-multi/auto/DBI/Driver.xst > Oracle.xsi /usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/ +perl5/5.8.8/ExtUtils/typemap -typemap typemap Oracle.xs > Oracle.xsc + && mv Oracle.xsc Oracle.c gcc -c -I/usr/orasys/11.2.0.3_client/rdbms/public -I/usr/orasys/11.2. +0.3_client/rdbms/demo -I/usr/orasys/11.2.0.3_client/rdbms/public -I/u +sr/orasys/11.2.0.3_client/plsql/public -I/usr/orasys/11.2.0.3_client/ +network/public -I/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thre +ad-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pi +pe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SO +URCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -W +p,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buff +er-size=4 -m64 -mtune=generic -DVERSION=\"1.64\" -DXS_VERSION=\"1.6 +4\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" +-Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"11.2.0.3\" -DOR +A_OCI_102 -DORA_OCI_112 Oracle.c Running Mkbootstrap for DBD::Oracle () chmod 644 Oracle.bs rm -f blib/arch/auto/DBD/Oracle/Oracle.so gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions - +fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic Oracle +.o -o blib/arch/auto/DBD/Oracle/Oracle.so \ -L/usr/orasys/11.2.0.3_client/lib/ -lclntsh -ldl -lm -lpthread +-lnsl -lirc -lipgo -lsvml -ldl -lm -lpthread \ chmod 755 blib/arch/auto/DBD/Oracle/Oracle.so cp Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs chmod 644 blib/arch/auto/DBD/Oracle/Oracle.bs Manifying blib/man3/DBD::Oracle::Troubleshooting.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Cygwin.3pm Manifying blib/man3/DBD::Oracle.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Sun.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Hpux.3pm lib/DBD/Oracle/Troubleshooting/Hpux.pod:971: Unknown command paragraph + "=itme 3 Add the following line: " lib/DBD/Oracle/Troubleshooting/Hpux.pod:995: Unmatched =back Manifying blib/man3/DBD::Oracle::Troubleshooting::Vms.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Macos.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Aix.3pm Manifying blib/man3/DBD::Oracle::Object.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Linux.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Win64.3pm Manifying blib/man3/DBD::Oracle::Troubleshooting::Win32.3pm Manifying blib/man3/DBD::Oracle::GetInfo.3pm $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/000-report-versions-tiny....Test::More version 0.88 required--this i +s only version 0.62 at t/000-report-versions-tiny.t line 3. BEGIN failed--compilation aborted at t/000-report-versions-tiny.t line + 3. # Looks like your test died before it could output anything. t/000-report-versions-tiny....dubious + Test returned status 255 (wstat 65280, 0xff00) t/00versions..................Can't load '/tmp/perl_tmp/DBD-Oracle-1.6 +4/blib/arch/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: /tmp/p +erl_tmp/DBD-Oracle-1.64/blib/arch/auto/DBD/Oracle/Oracle.so: undefine +d symbol: charsetid at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-mul +ti/DynaLoader.pm line 230. at t/00versions.t line 10 Compilation failed in require at t/00versions.t line 10. BEGIN failed--compilation aborted at t/00versions.t line 10. # Looks like your test died before it could output anything. t/00versions..................dubious + Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-2 Failed 2/2 tests, 0.00% okay t/01base......................NOK 4 + # Failed test 'install_driver' # in t/01base.t at line 24. # got: 'install_driver(Oracle) failed: Can't load '/tmp/perl_ +tmp/DBD-Oracle-1.64/blib/arch/auto/DBD/Oracle/Oracle.so' for module D +BD::Oracle: /tmp/perl_tmp/DBD-Oracle-1.64/blib/arch/auto/DBD/Oracle/O +racle.so: undefined symbol: charsetid at /usr/lib64/perl5/5.8.8/x86_6 +4-linux-thread-multi/DynaLoader.pm line 230.
... all the tests fail with the "undefined symbol: charsetid" error. I've googled this error tracing along things for a long, long time but haven't seen anything relevant and I am stuck. Does anyone have ideas for what might cause this, what might be done to troubleshoot, or what might be a good avenue to work on this? All advice appreciated.

Replies are listed 'Best First'.
Re: DBD::Oracle charsetid symbol error
by Anonymous Monk on Aug 12, 2013 at 23:44 UTC
      If I intentionally mess up LD_LIBRARY_PATH it dies differently since it can't find the lib. In this case it finds the lib but grouches about the missing 'charsetid' symbol. And I said I had little control since I know I can install another Perl install, but with this system unable to hit the outside world with a network, getting the modules set up wouldn't be pretty and when I move to deploy it would be torturous. It's working other than this one part, so unless I was certain that this was due to an old Perl I wouldn't want to go that way. I am using DBD::Proxy as a workaround for now.

        If I intentionally mess up LD_LIBRARY_PATH it dies differently since it can't find the lib.

        Well, resolving symbols kind of happens make-ing/building/compiling at linking/linker time , so if the symbol was missing before DBD/Oracle.so was created, Oracle.so wouldn't have been created

        That Oracle.so now isn't being loaded because of a missing symbol says that LD_LIBRARY_PATH is wrong

        See also Re^4: DBD::mysql fail install check (objdump -p missing symbol)

Re: DBD::Oracle charsetid symbol error
by leuchuk (Novice) on Aug 13, 2013 at 08:25 UTC

    Are you sure that OEL 5.8 is good enough for Oracle 11.2.0.3? Admittingly I'm not sure about this question but I though it should be at least a OEL 6.x version.

    Leuchuk
Re: DBD::Oracle charsetid symbol error
by mje (Curate) on Aug 14, 2013 at 09:49 UTC

    Ignore the anonymous monk saying your LD_LIBRARY_PATH is wrong because you cannot get an Oracle.so if you have an undefined symbol because you can.

    charsetid is an extern referred to in dbdimp.h

    extern ub2 charsetid;

    I don't think I've tried 11.2.0.3. Do any of the headers or shared objects included in the build but from you Oracle client install mention charsetid? (you can use nm -a to show symbols in shared objects). I will download the latest instant client and try it myself.

    Why are you building an old DBD::Oracle? - the latest is 1.64.

    UPDATE: sorry, charsetid is defined in DBD::Oracle's dbdimp.c

      The warnings at the top of your build say oci8.c is missing. You cannot build DBD::Oracle without oci8.c (it is part of DBD::Oracle). This DBD::Oracle distribution seems fundamentally broken. I just downloaded DBD::Oracle 1.58 and it does contain oci8.c so the dir you are building DBD::Oracle in has been messed with. Untar it again and start from scratch.