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

Following 846325, I am attempting to install DBI and DBD::Oracle under a newer version of Perl. DBI was successful. For DBD::Oracle, I:

  1. Exported my $ORACLE_HOME and added $ORACLE_HOME/lib to $LD_LIBRARY_PATH.
  2. Added use lib '/home/hbm/perllib/DBI' to Makefile.PL.
  3. Ran perl Makefile.PL LIB=/home/hbm/perllib -m $ORACLE_HOME/rdbms/demo/demo_rdbms.mk, and got "kit… looks good".
  4. Ran make and got:
    cp Oracle.pm blib/lib/DBD/Oracle.pm cp oraperl.ph blib/lib/oraperl.ph cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h cp Oraperl.pm blib/lib/Oraperl.pm cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h cp lib/DBD/Oracle/Object.pm blib/lib/DBD/Oracle/Object.pm cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm /usr/bin/perl/bin/perl -p -e "s/~DRIVER~/Oracle/g" /home/hbm/perllib/s +un4-solaris/auto/DBI/Driver.xst > Oracle.xsi /usr/bin/perl/bin/perl /usr/bin/perl/lib/5.8.3/ExtUtils/xsubpp -typem +ap /usr/bin/perl/lib/5.8.3/ExtUtils/typemap -typemap typemap Oracle. +xs > Oracle.xsc && mv Oracle.xsc Oracle.c gcc -B/usr/ccs/bin/ -c -I/orahome/rdbms/public -I/orahome/rdbms/demo +-I/orahome/rdbms/demo -I/orahome/rdbms/public -I/orahome/plsql/public + -I/orahome/network/public -I/home/hbm/perllib/sun4-solaris/auto/DBI +-fno-strict-aliasing -I/usr/local/include -I/opt/local/include -D_LAR +GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.24\" -DXS_VER +SION=\"1.24\" -fPIC "-I/usr/bin/perl/lib/5.8.3/sun4-solaris/CORE" -W +all -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"8.1.7.0\" -DUSE_O +RA_OCI_STMNT_FETCH Oracle.c cc1: Invalid option '-fno-strict-aliasing' In file included from Oracle.xs:1: Oracle.h:135: parse error before 'OCIXMLType' Oracle.xs: In function 'XS_DBD__Oracle__db_ora_lob_append': Oracle.xs:358: warning: unused variable `startp' Oracle.c: In function 'boot_DBD__Oracle': Oracle.c:1845: 'OCI_FETCH_CURRENT' undeclared (first use this function +) Oracle.c:1845: (Each undeclared identifier is reported only once Oracle.c:1845: for each function it appears in.) gcc: file path prefix '/usr/ccs/bin/' never used make: *** [Oracle.o] Error 1
  5. I commented out -fno-strict-aliasing from Makefile, but that didn’t get me further.

Node 765053 was promising, but my line of Oracle.h looks fine (I think?):

sword OCIXMLTypeCreateFromSrc( OCISvcCtx *svchp, OCIError *errhp, OCIDuration dur, ub1 src_type, dvoid *src_ptr, sb4 ind, OCIXMLType **retInstance );

Any advice? Thanks.

 

Update:

Thank you almut and mje! I didn't confirm your theories individually, but I believe you were both correct. I started over with DBD::Oracle v1.17 and put a newer version of gcc in my PATH. Those changes got me past make.

  1. Then make test failed, unable to find DBI.
  2. I added use lib qw(/home/hbm/perllib/DBI) to t/*.
  3. That improved things, but one test failed, "ld.so.1: perl: fatal: libmm.so.12".
  4. Per 598996, I ran ldd -s blib/arch/auto/DBD/Oracle/Oracle.so. (Thanks again, almut!)
  5. I located libmm.so.12 and added its path to LD_LIBRARY_PATH.
  6. Almost there, I exported ORACLE_USERID="myuser/pass" and ORACLE_SID="mysid".
  7. All tests passed; it installed; and no more segmentation fault!

Replies are listed 'Best First'.
Re: DBD::Oracle install errors
by almut (Canon) on Jun 25, 2010 at 20:49 UTC
    cc1: Invalid option `-fno-strict-aliasing'

    What version is your gcc?  The error could be because your gcc is too old.

    Oracle.h:135: parse error before `OCIXMLType'

    You could replace the -c with -E (="stop after the preprocessing stage") in that long command line, i.e.

    gcc -B/usr/ccs/bin/ -E ... Oracle.c > preprocessed

    and then look in preprocessed for the respective line that corresponds to Oracle.h:135 in order to figure out why the compiler thinks there's an error before OCIXMLType.  Sometimes, such errors are the result of some macro having been expanded incorrectly, or not at all.

Re: DBD::Oracle install errors
by mje (Curate) on Jun 28, 2010 at 08:58 UTC

    I believe the Oracle you are building against is too old for DBD 1.24 - see Which version DBD::Oracle is for me?. You could download a newer InstantClient and it should work with DBD::Oracle 1.24.