Why is Perl DBD :: DB2 unable to find dbivport.h during installation?

We are using the Perl utility to output data from the DB2 database. We have installed the DBI package and it asks for the DBD package as well.

We do not have root access and when we try to install the DBD package we get the following error:

    ERROR BUILDING DB2.pm
    [ lijumathew @ intblade03 DBD-DB2-1.78] $ make
    make [1]: Entering directory '/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants'
    gcc -c -I "/ db2 / db2tf1 / sqllib / include" -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I / usr / local / include -D_LARGEFILE_SOURCE -D_FILE_OF = 64FSI_BITS gdbm -O2 -g -pipe -m32 -march = i386 -mtune = pentium4 -DVERSION = \ "1.78 \" -DXS_VERSION = \ "1.78 \" -fPIC "-I / usr / lib / perl5 / 5.8.5 / i386 -linux-thread-multi / CORE "Constants.c
    Running Mkbootstrap for DBD :: DB2 :: Constants ()
    chmod 644 Constants.bs
    rm -f ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    gcc -shared -L / usr / local / lib Constants.o -o ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    chmod 755 ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    cp Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
    chmod 644 ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
    make [1]: Leaving directory `/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants'
    gcc -c -I "/ db2 / db2tf1 / sqllib / include" -I "/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -I "/ usr / lib /perl5/5.8.5/i386-linux-thread-multi/auto/DBI "-I" /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI "-I" /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI "-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I / usr / local / include -D_LARGEFILE_SOURCE D_FILE_OFFSET_BITS = 64 -I / usr / include / gdbm -O2 -g -pipe -m32 -march = i386 -mtune = pentium4 -DVERSION = \ "1.78 \" -DXS_VERSION = \ "1.78 \" -fPIC "-I / usr /lib/perl5/5.8.5/i386-linux-thread-multi/CORE "DB2.c
    In file included from DB2.h: 22,
                     from DB2.xs: 7:
    dbdimp.h: 10: 22: dbivport.h: No such file or directory
    make: *** [DB2.o] Error 1

How do we fix this? Do we need root access to fix this problem?

+2


a source to share


2 answers


You are having a problem because most perl modules, including DBD-DB2, are not written to be installed in different locations other than the DBI module, which is what happens if you try to install something as non-root. To get this to work, you need to add a line to your Makefile:

DEFINE =  -DDB2_CACHE_FIX  -I${DBI_INCL}

      



and set DBI_INCL to directory with DBI header files.

+2


a source


Please see the CPAN forum for DBD :: DB2 make failed

Also, if you do it below, you can help:

Set the DB2 environment variable

   1. In C Shell setenv DB2_HOME $HOME/sqllib
   2. In Bash Shell export DB2_HOME=$HOME/sqllib

      



Install the module:

# perl Makefile.PL PREFIX=path
# make
# make test
# make install

      

However, it would be helpful to answer the problem if you can provide us with the perl -V output, the platform you are on, and the DBI version.

+1


a source







All Articles