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

Can anyone offer help in resolving issue found while trying to install DB2 driver.
Running into an error while attempting to install DB2 Perl Database Interface for LUW.
The IBM website list the follow pre-reqs:
Linux: Perl version 5.8 or above
DBI version 1.53 and above
IBM DB2 client version 9 fp2 and above

openSUSE comes native with Perl:
linux-sy4t:/home/gman # perl -v
This is perl 5, version 18, subversion 1 (v5.18.1) built for x86_64-linux-thread-multi
Copyright 1987-2013, Larry Wall

DBI is installed,perldoc DBI #yeilds:
x86_64-linux-thread-multi::DBI(3) User Contributed Perl Documentation
x86_64-linux-thread-multi::DBI(3)
NAME
DBI - Database independent interface for Perl
SYNOPSIS
use DBI;
etc...

no drivers installed:
linux-sy4t:/home/gman/Documents/scripts # ./checkDbiDrivers.pl
Available DBI Drivers and Data Sources:
DBM
DBI:DBM:f_dir=.
ExampleP
dbi:ExampleP:dir=.
File
DBI:File:f_dir=.
Gofer
No known data sources
Proxy
No known data sources
SQLite
No known data sources
Sponge
No known data sources

DB2 Runtime client is installed
linux-sy4t:/opt/ibm/db2/V10.5 # ls
adm bnd conv dsdriver install java lib32 license .metadata rdf
security32 tivready bin cfg desktop function instance json lib64 logs msg
Readme security64 tools

The platform is a VirtualBox install of:
linux-sy4t:/opt/ibm/db2/V10.5 # cat /proc/version
Linux version 3.11.10-7-desktop (geeko@buildhost) (gcc version 4.8.1 20130909
gcc-4_8-branch revision 202388 (SUSE Linux) ) #1 SMP PREEMPT Mon Feb 3 09:41:24 UTC 2014 (750023e)

I went to http://search.cpan.org/~ibmtordb2/DBD-DB2/lib/Bundle/DBD/DB2.pm. I found it
suggested and ran "perl -MCPAN -e 'install Bundle::CPAN'" entering default values.
It terminated, stating make had failed and install seems impossible.
I then downloaded and ran:

linux-sy4t:/home/gman/Downloads/DBD-DB2-1.85 # ./Makefile.PL
./Makefile.PL: line 8: use: command not found
./Makefile.PL: line 9: use: command not found
./Makefile.PL: line 10: use: command not found
./Makefile.PL: line 13: use: command not found
./Makefile.PL: line 15: syntax error near unexpected token `('
./Makefile.PL: line 15: `my %opts = ('

Line 8 reads "use ExtUtils::MakeMaker ;#qw(&WriteMakefile $Verbose );" so I
installed ExtUtils-MakeMaker-6.94:
linux-sy4t:/home/gman/Downloads/ExtUtils-MakeMaker-6.94 # ./Makefile.PL
Using included version of JSON::PP (2.27203) as it is newer than the installed version (2.27202).
Using included version of JSON::PP::Compat5006 (1.09) because it is not already installed.
Using included version of Parse::CPAN::Meta (1.4405) as it is newer than the installed version (1.4404).
Using included version of File::Copy::Recursive (0.38) because it is not already installed.
Generating a Unix-style Makefile
Writing Makefile for ExtUtils::MakeMaker
Writing MYMETA.yml and MYMETA.json

The directory ExtUtils-MakeMaker-6.94 also contained a file "INSTALL" stating:
TO INSTALL
For all users on most Unix systems:
perl Makefile.PL
make
make test
sudo make install

Makefile.PL output is above. The others yielded:
linux-sy4t:/home/gman/Downloads/ExtUtils-MakeMaker-6.94 # make
If 'make' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf make
linux-sy4t:/home/gman/Downloads/ExtUtils-MakeMaker-6.94 # make test
If 'make' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf make
linux-sy4t:/home/gman/Downloads/ExtUtils-MakeMaker-6.94 # sudo make install
sudo: make: command not found

Reran linux-sy4t:/home/gman/Downloads/DBD-DB2-1.85 # ./Makefile.PL with same result as before.
linux-sy4t:/home/gman/Downloads/DBD-DB2-1.85 # ./Makefile.PL
./Makefile.PL: line 8: use: command not found
./Makefile.PL: line 9: use: command not found
./Makefile.PL: line 10: use: command not found
./Makefile.PL: line 13: use: command not found
./Makefile.PL: line 15: syntax error near unexpected token `('
./Makefile.PL: line 15: `my %opts = ('

I would certainly appreciate any help that could be offered.

  • Comment on DBD-DB2 install issue openSUSE 13 64bit

Replies are listed 'Best First'.
Re: DBD-DB2 install issue openSUSE 13 64bit
by ww (Archbishop) on Apr 06, 2014 at 02:25 UTC

    The suggestions at opensuse.org may help.
    But is there some reason you're not using a SUSE package via RPM? (Yes, lazy me: It's been a loooong time since I had a SUSE install... and I didn't check the current inventory, but for such a standard tool, it seems likely you'll find RPM helpful.)


    Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
    1. code
    2. verbatim error and/or warning messages
    3. a coherent explanation of what "doesn't work actually means.
Re: DBD-DB2 install issue openSUSE 13 64bit
by wazat (Monk) on Apr 06, 2014 at 05:08 UTC

    From the messages you show when running Makefile.PL, it looks like perl is not the interpreter being used.

    linux-sy4t:/home/gman/Downloads/DBD-DB2-1.85 # ./Makefile.PL ./Makefile.PL: line 8: use: command not found ./Makefile.PL: line 9: use: command not found ./Makefile.PL: line 10: use: command not found ./Makefile.PL: line 13: use: command not found ./Makefile.PL: line 15: syntax error near unexpected token `(' ./Makefile.PL: line 15: `my %opts = ('

    what happens when you explicitly use perl as your interpreter? (Note this is the the usual way for Makefile.PL)

    linux-sy4t:/home/gman/Downloads/DBD-DB2-1.85 # perl ./Makefile.PL
      Thanks wazat,
      your suggestion was spot on. I have continued to run into issues but I think I am well on the way to resolving the difficulties. Once completed I will post what I have found.

      Thanks again,
      exgman