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

I have downloaded the dbd:db2 module and tried to compile it and I get the error below. The version I downloaded was 1.8. I have also tried previous versions and get the same error.
# perl Makefile.PL Usage: Cwd::fastcwd() at /usr/opt/perl5/lib/5.8.8/aix-thread-multi/Dyn +aLoader.pm line 253. BEGIN failed--compilation aborted at /usr/opt/perl5/lib/site_perl/5.8. +8/aix-thread-multi/DBI.pm line 268. Compilation failed in require at Makefile.PL line 13. BEGIN failed--compilation aborted at Makefile.PL line 13.
This is the error I get when trying to install from CPAN
CPAN.pm: Going to build I/IB/IBMTORDB2/DBD-DB2-1.80a.tar.gz Usage: Cwd::fastcwd() at /usr/opt/perl5/lib/5.8.8/aix-thread-multi/Dyn +aLoader.pm line 253. BEGIN failed--compilation aborted at /usr/opt/perl5/lib/site_perl/5.8. +8/aix-thread-multi/DBI.pm line 268. Compilation failed in require at Makefile.PL line 13. BEGIN failed--compilation aborted at Makefile.PL line 13. Running make test Make had some problems, maybe interrupted? Won't test Running make install Make had some problems, maybe interrupted? Won't install AIX version 6.1 # oslevel -r 6100-05

Replies are listed 'Best First'.
Re: dbd:db2 module
by Anonymous Monk on Apr 26, 2011 at 03:24 UTC
    Have you followed the instruction in the README?
Re: dbd:db2 module
by Tanktalus (Canon) on Apr 26, 2011 at 23:16 UTC
    This looks like the version of DBI on your system is either broken or corrupt. Can you try upgrading that first? Makefile.PL starts by loading DBI - I'm not sure why, they could just put in a standard pre-req on it which would likely give a more useful error message. However, this is where the problem seems to be in your error messages, so that's where I'd start. For example, perl -le 'use DBI 999' or even just perl -MDBI -e 1, just to see if DBI is loading on its own.

      I ran your command and it is using DBI. Now I am getting this error after setting the DB2_HOME env.

      export DB2_HOME=/opt/IBM/db2/V9.7

      perl Makefile.PL

      hello1hello1 (echo commands added)

      Configuring DBD::DB2... Remember to actually read the README and CAVEATS files!

      Using DB2 in "/opt/IBM/db2/V9.7" System: perl5.008008 DBI1.616 aix akash79 3 5 00011a85d600 aix-thread-multi dl_aix.xs Compiler: cc_r -O -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong Includes: -I"/opt/IBM/db2/V9.7/include" -I"/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/5.8.8/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi/auto/DBI" Libraries: -L/opt/IBM/db2/V9.7/lib64 -ldb2

      Undefined subroutine &main::WriteMakefile called at Makefile.PL line 164.

      So here is line 164 in Makefile.pl

      WriteMakefile(%opts);

      So what do I do?

        Does line 8 look like this?

        use ExtUtils::MakeMaker qw(&WriteMakefile $Verbose );
        It should - but you may have touched it in some way while trying to get this all to work. If it doesn't, I'd suggest starting over - extract your DBD::DB2 tarball into a new directory, keep DB2_HOME set, and try there. If this still doesn't work, then I'd wonder about your ExtUtils::MakeMaker - though I'd hope that the above use line would have died if ExtUtils::MakeMaker was corrupt and/or the WriteMakefile function was not listed properly.