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

I'm on Perl 5.6.1 on Solaris 5.8 trying to install DBD::DB2. It's the latest version from CPAN (0.78).

I was successful in installing the latest version of DBI (1.46) (although I was forced into the somewhat puzzling detour of having to install Test::Simple and Test::Harness first).

When it came to DBD::DB2, I logged in as user db2inst1 (as recommended in the README) and ran "perl Makefile.PL" which ran fine. But when I ran "make" I got this:

$ make gcc -c -I"/usr/include" -fno-strict-aliasing -I/usr/local/include -D_L +ARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"0.22\" -DXS +_VERSION=\"0.22\" -fPIC -I/usr/local/lib/perl5/5.6.1/sun4-solaris/COR +E Constants.c cc1: warning: changing search order for system directory "/usr/local/i +nclude" cc1: warning: as it has already been specified as a non-system direc +tory cc1: warning: changing search order for system directory "/usr/include +" cc1: warning: as it has already been specified as a non-system direc +tory In file included from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +lsdio.h:5, from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/ipe +rlsys.h:300, from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +l.h:1947, from Constants.xs:10: /usr/include/stdio.h:143: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:144: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:145: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:146: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:147: warning: #pragma redefine_extname conflicts +with declaration In file included from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +l.h:1961, from Constants.xs:10: /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/scope.h:206: parse error +before "sigjmp_buf" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/scope.h:206: warning: no +semicolon at end of struct or union /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/scope.h:213: parse error +before '}' token In file included from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +l.h:2821, from Constants.xs:10: /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:247: parse error +before "off64_t" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:249: parse error +before "Perl_do_sysseek" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:249: parse error +before "off64_t" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:249: warning: dat +a definition has no type or storage class /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:250: parse error +before "Perl_do_tell" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:250: warning: dat +a definition has no type or storage class *** Error code 1 make: Fatal error: Command failed for target `Constants.o' Current working directory /tmp/PerlMods/DBD-DB2-0.78/Constants *** Error code 1 make: Fatal error: Command failed for target `subdirs' [root@dietls]tmp/PerlMods/DBD-DB2-0.78# cat make.out gcc -c -I"/usr/include" -fno-strict-aliasing -I/usr/local/include -D_L +ARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"0.22\" -DXS +_VERSION=\"0.22\" -fPIC -I/usr/local/lib/perl5/5.6.1/sun4-solaris/COR +E Constants.c cc1: warning: changing search order for system directory "/usr/local/i +nclude" cc1: warning: as it has already been specified as a non-system direc +tory cc1: warning: changing search order for system directory "/usr/include +" cc1: warning: as it has already been specified as a non-system direc +tory In file included from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +lsdio.h:5, from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/ipe +rlsys.h:300, from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +l.h:1947, from Constants.xs:10: /usr/include/stdio.h:143: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:144: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:145: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:146: warning: #pragma redefine_extname conflicts +with declaration /usr/include/stdio.h:147: warning: #pragma redefine_extname conflicts +with declaration In file included from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +l.h:1961, from Constants.xs:10: /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/scope.h:206: parse error +before "sigjmp_buf" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/scope.h:206: warning: no +semicolon at end of struct or union /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/scope.h:213: parse error +before '}' token In file included from /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/per +l.h:2821, from Constants.xs:10: /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:247: parse error +before "off64_t" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:249: parse error +before "Perl_do_sysseek" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:249: parse error +before "off64_t" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:249: warning: dat +a definition has no type or storage class /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:250: parse error +before "Perl_do_tell" /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/proto.h:250: warning: dat +a definition has no type or storage class *** Error code 1 make: Fatal error: Command failed for target `Constants.o' Current working directory /tmp/PerlMods/DBD-DB2-0.78/Constants *** Error code 1 make: Fatal error: Command failed for target `subdirs'

Replies are listed 'Best First'.
Re: Can't install DBD::DB2 module
by Tanktalus (Canon) on Jan 27, 2005 at 22:00 UTC

    I highly suspect that IBM only tested that with the Sun-provided compiler and not with gcc. (IBM writes/maintains that driver with a developer who is paid to do so as one of his regular duties. So of course, he uses exactly what IBM uses for compiling DB2 for all his testing.)

    You may actually be best off, if possible, with using the Sun compiler. If that is not possible, you may want to try to contact IBM with your question (assuming you have a support contract with them) - you might be able to get them to officially support gcc on Solaris.

      Mmm, it's unlikely that IBM will up and support a compiler for a single customer (unless you have a whole lot of money). The likely response you would get is "gcc is not supported on Sun; please use one of the supported compilers." (Both the Forte and Sun ONE Studio compilers are supported: DB2 supported development software, but Tanktalus is probably correct in that only the default Sun compiler is probably tested with DBD::DB2.)

      Given the results of Makefile.PL, I'm guessing you built your own version of Perl rather than using the binary version that is supplied with Solaris. Veering away from the standard binary version makes it almost impossible for IBM to offer support, given the vast number of combinations they would have to be able to reproduce.

      So my suggestion would be to revert to the version of Perl that comes with Solaris and try rebuilding DBI and DBD::DB2.

      Failing that, you may have to rebuild Perl itself--but this time, try using the Sun compiler.

      (Another resource to consider is the dbi-users mailing list at dbi-users@perl.org -- there are sure to be other people who have run into the same situation as you.)