4

First I wanted to build the DBD::mysql package. That kept failing because whatever make resulted in could not be loaded for the tests with a Symbol not found: _is_prefix. So I assumed that cpan might be a tad old. I know it's a random assumption, but cpan did tell me to install the latest Bundle::CPAN.

Who's successfully installed either DBD::mysql or Bundle::CPAN on Mac OS X 10.5? Could you recommend any thing I could be doing differently?

This is perl, v5.8.8 built for darwin-thread-multi-2level
(with 4 registered patches, see perl -V for more detail)
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.1.36,
for apple-darwin9.5.0 (i386) using readline 5.1

Here's a log of the CPAN output for DBD::mysql:

Writing Makefile for DBD::mysql
cc -c  -I/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3   -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\"  "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE"   dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI/Driver.xst > mysql.xsi

Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
/usr/bin/perl /System/Library/Perl/5.8.8/ExtUtils/xsubpp  -typemap /System/Library/Perl/5.8.8/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 650
cc -c  -I/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3   -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\"  "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE"   mysql.c
dbdimp.c: In function 'mysql_describe':
dbdimp.c:3309: warning: assignment from incompatible pointer type
dbdimp.c: In function 'mysql_describe':
dbdimp.c:3309: warning: assignment from incompatible pointer type
rm -f blib/arch/auto/DBD/mysql/mysql.bundle
LD_RUN_PATH="/usr/local/mysql/lib" /usr/bin/perl myld cc -mmacosx-version-min=10.5.7  -arch ppc -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.bundle    \
       -L/usr/local/mysql/lib -lmysqlclient -lz -lm     \

chmod 755 blib/arch/auto/DBD/mysql/mysql.bundle
Manifying blib/man3/DBD::mysql.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
  CAPTTOFU/DBD-mysql-4.012.tar.gz
  /usr/bin/make -j3 -j3 -- OK

Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t .................. 1/6 Bailout called.  Further testing stopped:  Unable to load DBD::mysql

#   Failed test 'use DBD::mysql;'
#   at t/00base.t line 21.
#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix
#   Referenced from: /Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle
#   Expected in: dynamic lookup
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
  CAPTTOFU/DBD-mysql-4.012.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports CAPTTOFU/DBD-mysql-4.012.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 CAPTTOFU/DBD-mysql-4.012.tar.gz              : make_test NO
1
  • Which version of Perl? Is it a system Perl? Commented Aug 14, 2009 at 20:22

6 Answers 6

5

Okay, if you get these errors I now know the following:

  1. MySQL 5.1 for Mac OS X x86_64 is not compatible with DBD::mysql (yet). Install the 32-bit x86 version, and try again. You'll succeed. I wish the perl Makefile.pl would just tell you that in a banner.
  2. Bundle::CPAN had issues because I wasn't installing as root. Why that makes it report circular references instead of installation permission issues, I'll never understand.

Please add a comment if and when this became outdated information.

2

Installing the (beta) 5.4.1 64 bit version of mysql, available from their developer website, fixes the issue. Tested on Snow Leopard.

3
  • I just tried the exact some version 4.5.1-beta-osx10.5-x86_64 on 10.6 (there's no 10.6 pkgs) and the install and run fine, but sudo perl -MCPAN -e 'shell' won't install Bundle::DBD::mysql. Test Summary Report ------------------- ... Failed during this command: CAPTTOFU/DBD-mysql-4.012.tar.gz : make_test NO
    – dlamblin
    Commented Sep 6, 2009 at 9:14
  • I'm not alone, someone on perlmonks.org has the same problem perlmonks.org/?node_id=793727
    – dlamblin
    Commented Sep 6, 2009 at 9:16
  • Finally got it to build and run and at least load the module with 5.4.1 64 bit version for 10.5 on 10.6. The tests still wouldn't run as it seemed mighty insistent on wanting to connect to a test db. Did get past the symbol errors even loading it though. Ended up force installing it and things are working beautifully.
    – mikegrb
    Commented Sep 14, 2009 at 2:08
1

Did you try installing Bundle::DBD::mysql?

2
  • Absolutely did. DBI installed just fine, but DBD::mysql did not.
    – dlamblin
    Commented Aug 14, 2009 at 21:08
  • The message about redefinition of function do is puzzling to me. I don't think you can have a function called do in a C program. Commented Aug 14, 2009 at 21:31
0

I haven't dealt with this problem, but I found that MacPorts cleaned up all my UNIX incompatibility problems. You might want to try that before enduring too much pain and suffering.

2
  • 2
    MacPorts does its magic by installing its own version of Perl. That may be a great idea - I prefer not to use Mac's system Perl for anything - but it's worth clarifying how MacPorts helps.
    – Telemachus
    Commented Aug 15, 2009 at 17:37
  • I personally find this to be massive overkill on the scale of warrants issued by the U.N. international courts.
    – dlamblin
    Commented Aug 17, 2009 at 3:19
0

Where is it complaining about a circular dependency? It looks like you are trying to link to an incompatible version of the mysql libraries. The symbol it's looking for isn't in the library you loaded. I don't think this is a problem caused by CPAN.pm or the cpan script.

Some questions:

  • Who compiled perl? Is this Apple's perl?
  • Who compiled mysql? Is that your own version since it's in /usr/local?
  • Did you previously compile other versions? I start with a compile to ensure everything points to the right places.
2
  • yes I understand that that the example doesn't show the circular dependancy. That's because it's the dbd::mysql part I showed. I'd closed the terminal with circular refs. now that I fixed it, I can't reproduce it. If people didn't keep changing my title, you'd see it IS "apple's" perl and mysql's mysql pkg. (stock). I want to compile as little as possible.
    – dlamblin
    Commented Aug 17, 2009 at 3:12
  • None of your title's ever mentioned Apple's perl. Since you can't reproduce the circular dependency stuff, you should remove that from your question. Commented Aug 17, 2009 at 22:53
0

Installing latest beta 64bit version of Mysql fixed problem on my computer.

1
  • Please identify the "latest version" with either a version number or build number. There are currently 3 latest versions available on the site, one is beta, one is recommended and another is an older but compatible (with older queries) version.
    – dlamblin
    Commented Sep 20, 2009 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.