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

I tried to install Bundle::DBD::mysql with MCPAN. DBI installed (at least it didn't say it failed). When it started the DBD install, this is what I got (after some time). I"m running gnu gcc.

---------------------------

gcc -B/usr/ccs/bin/ -c -I/usr/local/lib/perl5/site_perl/5.8.3/sun4-so +laris/auto/DBI -I/usr/local/mysql/include -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9 + -fno-strict-aliasing <<<<<gcc: unrecognized option `-Xa'>>>>>>> gcc: language arch=v9 not recognized gcc: mysql.c: linker input file unused because linking not done Running Mkbootstrap for DBD::mysql () LD_RUN_PATH="/usr/lib" /usr/bin/perl myld gcc -B/usr/ccs/bin/ -G -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so -L/usr/local/mysql/lib -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm gcc: dbdimp.o: No such file or directory gcc: mysql.o: No such file or directory <<<<make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1 /usr/bin/make -- NOT OK >>> Running make test Can't test without successful make Running make test Can't test without successful make Bundle summary: The following items in bundle Bundle::DBD::mysql had installation problems: Mysql DBD::mysql

------------------------------

Edited 2004-03-31 by Ovid.

Replies are listed 'Best First'.
Re: DBI Installed DBD Failed
by dragonchild (Archbishop) on Mar 31, 2004 at 18:07 UTC
    Send this information to dbi-users@perl.org - they're the ones who'll know what to do about it.

    Additional information that they will ask for would be the output from "perl -V".

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

Re: DBI Installed DBD Failed
by JSchmitz (Canon) on Mar 31, 2004 at 19:33 UTC
    If mysql is installed on the machine, the mysql_config program is not in your path. The Makefile.PL script uses that program to determine how to configure the Perl XS module to link with the mysql client library.
    [snip] > cflags (guessed) = -I/usr/local/mysql/include > libs (guessed) = -L/usr/local/mysql/lib -lmysqlclient -l +z -lgz Without the mysql_config program the guess is that you need libgz. > nocatchstderr (default) = 0 > nofoundrows (default) = 0 > ssl (guessed) = 0 > testdb (default) = test > testhost (default) = > testpassword (default) = > testuser (default) = > > To change these settings, see 'perl Makefile.PL --help' and > 'perldoc INSTALL'. > > Note (probably harmless): No library found for -lgz If you do need to link with libgz, it cannot be found. This may or may not be a problem. I would set the path to find mysql_config and try again.
Re: DBI Installed DBD Failed
by tachyon (Chancellor) on Mar 31, 2004 at 23:59 UTC

    Of all the modules we use I found DBD::mysql the only one that was a pain to install. We are using RH7.3, perl 5.6.2 and the binary distro of mysql installed exactly as recommended. Anyway I would suggest you download DBD::mysql as the tar.gz so you can tinker with the Makefile args until make works. Hopefully the following will offer some hints even though our systems differ:

    DBD-Mysql (need to spcify a raft of options on the command line) It to +ok a while to get these right as it can't find the required libs and +includes without help. [root@devel3 DBD-mysql-2.9002]# perl Makefile.PL --cflags=-I'/usr/loc +al/mysql/include/' --libs=-L'/usr/local/mysql/lib/ -lmysqlclient -lz +' --testdb=test --testuser=root --testpassword=xxxxxxxxx --testhost=l +ocalhost I will use the following settings for compiling and testing: cflags (Users choice) = -I/usr/local/mysql/include/ libs (Users choice) = -L/usr/local/mysql/lib/ -lmysqlclient + -lz nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb (Users choice) = test testhost (Users choice) = localhost testpassword (Users choice) = xxxxxxxxxx testuser (Users choice) = root To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Using DBI 1.21 installed in /usr/lib/perl5/site_perl/5.6.1/i386-linux/ +auto/DBI Writing Makefile for DBD::mysql [root@devel3 DBD-mysql-2.9002]# make gcc -c -I/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI -I/usr/loc +al/mysql/include/ -fno-strict-aliasing -I/usr/local/include -O2 -marc +h=i386 -mcpu=i686 -DVERSION=\"2.9002\" -DXS_VERSION=\"2.9002\" -fPI +C -I/usr/lib/perl5/5.6.1/i386-linux/CORE dbdimp.c gcc -c -I/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI -I/usr/loc +al/mysql/include/ -fno-strict-aliasing -I/usr/local/include -O2 -marc +h=i386 -mcpu=i686 -DVERSION=\"2.9002\" -DXS_VERSION=\"2.9002\" -fPI +C -I/usr/lib/perl5/5.6.1/i386-linux/CORE mysql.c Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.so LD_RUN_PATH="/usr/local/mysql/lib:/usr/lib" /usr/bin/perl myld gcc -s +hared -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/ +mysql.so -L/usr/local/mysql/lib/ -lmysqlclient -lz chmod 755 blib/arch/auto/DBD/mysql/mysql.so cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs chmod 644 blib/arch/auto/DBD/mysql/mysql.bs Manifying blib/man3/DBD::mysql::INSTALL.3pm Manifying blib/man3/DBD::mysql.3pm Manifying blib/man3/Bundle::DBD::mysql.3pm Manifying blib/man3/Mysql.3pm [root@devel3 DBD-mysql-2.9002]# make test PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl +5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1 -e 'use Test::Harness qw(&r +untests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/00base...........ok + t/10dsnlist........ok + t/20createdrop.....ok + t/30insertfetch....ok + t/40bindparam......ok + t/40blobs..........ok + t/40listfields.....ok + t/40nulls..........ok + t/40numrows........ok + t/50chopblanks.....ok + t/50commit.........ok + 14/30 skipped: No transactions t/60leaks..........skipped all skipped: no reason given t/ak-dbd...........ok + t/akmisc...........ok + t/dbdadmin.........ok 6/21New DB not in DSN list + t/dbdadmin.........ok 10/21DSN testab not in DSN list. + t/dbdadmin.........ok 14/21DSN testac not in DSN list. + t/dbdadmin.........FAILED tests 7, 11, 15 + Failed 3/21 tests, 85.71% okay t/insertid.........ok + t/mysql2...........ok + t/mysql............ok + Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/dbdadmin.t 21 3 14.29% 7 11 15 1 test and 14 subtests skipped. Failed 1/18 test scripts, 94.44% okay. 3/759 subtests failed, 99.60% o +kay. make: *** [test_dynamic] Error 11 [root@devel3 DBD-mysql-2.9002]# You will not get any compile errors or warnings if you get the libs an +d includes right. Note the 3 test ‘failures’ are not important.

    cheers

    tachyon

      One little-known fact about RedHat is that they sometimes bundle CPAN modules as RPMs. They usually bundle popular modules that are difficult to compile, such as DBD::MySQL. They also provide source RPMs, so that you can tweak your makefile settings if you like (although I don't know how well these build, I've never tried them myself).

      There's definitely a lot more RPM-packaged modules out there. This method of installing modules has its ups and downs, but it's very quick in a pinch. For another cool CPAN/RPM interoperability tool, check out cpan2rpm. It's a tool to build RPMs of CPAN modules.

      :D

Re: DBI Installed DBD Failed
by blue_cowdawg (Monsignor) on Mar 31, 2004 at 18:10 UTC

        I"m running gnu gcc.

    Make sure you tell the DBI folks what platform you are trying this on as well.


    Peter L. Berghold -- Unix Professional
    Peter at Berghold dot Net
       Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice.
Re: DBI Installed DBD Failed
by zetetes (Pilgrim) on Apr 01, 2004 at 06:23 UTC
    installing DBI and DBD was quite... maybe this solution will help you? (i'm on mac os X)

    dub.
Re: DBI Installed DBD Failed
by wak (Initiate) on Apr 01, 2004 at 03:58 UTC
    Have you installed all the Mysql lib and header packages for your OS?

    I always get bit on DBD::mysql until I remember to also install the Mysql-dev packages.

    Make sure Mysql is running as well and the makefile knows what your test account is if you took out the stock Mysql "test" accounts and db.

    Finally as a last resort, install the DBD tarball by hand (perl Makefile.PL, make, make test, make install) as I have seen that work when the CPAN module got confused.