Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 65462
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: CAPTTOFU [...] cpan.org
Requestors: jwhansen [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Compiling DBD:mysql on Mac OS X 10.6.6 fails
Date: Fri, 4 Feb 2011 17:20:17 -0500
To: bug-DBD-mysql [...] rt.cpan.org
From: John Hansen <jwhansen [...] gmail.com>
Gents, While attempting to install DBD:mysql on Mac OS X 10.6.6 it fails the 'make test'. Below is the data you may need. ** Perl version *** perl -v This is perl 5, version 12, subversion 2 (v5.12.2) built for darwin-thread-multi-2level (with 8 registered patches, see perl -V for more detail Binary build 1203 [294165] provided by ActiveState http://www.ActiveState.com Built Dec 9 2010 04:11:19 ** DBD Bundle ** DBD:mysql bundle: CAPTTOFU/DBD-mysql-4.018.tar.gz ** System OS ** Mac OS X 10.6.6 (10J567) on Macbook Air Darwin macbook 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 ** Problem ** compiling and performing 'make test' results in error: macbook:DBD-mysql-4.018-9F3Dsr root# make test PERL_DL_NONLAZY=1 /usr/local/ActivePerl-5.12/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00base.t .................. 1/6 # Failed test 'use DBD::mysql;' # at t/00base.t line 21. Bailout called. Further testing stopped: Unable to load DBD::mysql # Tried to use 'DBD::mysql'. # Error: Can't load '/private/var/root/.cpan/build/DBD-mysql-4.018-9F3Dsr/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/private/var/root/.cpan/build/DBD-mysql-4.018-9F3Dsr/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix # Referenced from: /private/var/root/.cpan/build/DBD-mysql-4.018-9F3Dsr/blib/arch/auto/DBD/mysql/mysql.bundle # Expected in: dynamic lookup # at (eval 9) line 2 # Compilation failed in require at (eval 9) line 2. # BEGIN failed--compilation aborted at (eval 9) line 2. FAILED--Further testing stopped: Unable to load DBD::mysql make: *** [test_dynamic] Error 255 ---------------------------- I would be happy to send any additional info to assist you. Thank you, John Hansen jwhansen@gmail.com
Subject: Re: [rt.cpan.org #65462] AutoReply: Compiling DBD:mysql on Mac OS X 10.6.6 fails
Date: Mon, 7 Feb 2011 14:25:35 -0500
To: bug-DBD-mysql [...] rt.cpan.org
From: John Hansen <jwhansen [...] gmail.com>
update - 1. I removed 5.5.8 and installed Mysql 5.1.49. 2. I did a clean install of Mysql 5.1.49 3. I removed Activestate Perl and used the default version of perl that came with the Macbook Air under OS X 10.6.6 perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=darwin, osvers=10.0, archname=darwin-thread-multi-2level uname='darwin scream.apple.com 10.0 darwin kernel version 10.0.0: fri jul 31 22:46:25 pdt 2009; root:xnu-1456.1.25~1release_x86_64 x86_64 ' Under this environment the 'make test' finished correctly and the 'make install' correctly installed. Tested the access to a table and it worked. John Hansen jwhansen@gmail.com
Looking into this issue.
Can someone please set me up with a OS X 10.6.6 environment? I don't yet have access to one. I really want to fix this and have been slammed, but if someone can help me out with a test env, that would be a HUGE help.
From: francois1+bitcard [...] gmail.com
There are potentially two issues: - the (infamous) "Xcode4 breaks CPAN" problem: http://deflatermouse.livejournal.com/149721.html for which the easiest fix until Apple fixes this is, for the user, to modify /System/Library/Perl/5.10.0/darwin-thread-multi- 2level/Config_heavy.pl to remove the -arch ppc from $ENV{ARCHFLAGS}. - the bug report above is because the libraries flags are wrong during compilation, and can manifest itself slightly differently. Here's what I get: iMac:DBD-mysql-4.019-FNGA1g francois$ sudo 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 # Failed test 'use DBD::mysql;' # at t/00base.t line 21. Bailout called. Further testing stopped: Unable to load DBD::mysql # Tried to use 'DBD::mysql'. # Error: Can't load '/Users/francois/.cpan/DBD-mysql-4.019- FNGA1g/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/francois/.cpan/DBD-mysql-4.019- FNGA1g/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.18.dylib # Referenced from: /Users/francois/.cpan/DBD-mysql-4.019- FNGA1g/blib/arch/auto/DBD/mysql/mysql.bundle # Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi- 2level/DynaLoader.pm line 207. # 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 Now, look at the defaults generated by perl Makefile.pl, it finds the proper location of the MySQL client library (which is /usr/local/mysql/lib for binaries installed from dev.mysql.com): I will use the following settings for compiling and testing: cflags (mysql_config) = -I/usr/local/mysql/include -Os -g -fno-common -fno-strict- aliasing -arch x86_64 embedded (mysql_config) = libs (mysql_config) = -L/usr/local/mysql/lib -lmysqlclient -lpthread mysql_config (guessed ) = mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb (default ) = test testhost (default ) = testpassword (default ) = testsocket (default ) = testuser (guessed ) = francois BUT, if you look at the generated Makefile, you will see this instead: LDDLFLAGS = -arch x86_64 -bundle -undefined dynamic_lookup -L/usr/local/lib LDFLAGS = -arch x86_64 -L/usr/local/lib In those two lines, replacing /usr/local/lib by /usr/local/mysql/lib will fix it, and tests will pass (tested with mysql-5.5.12-osx10.6-x86_64.dmg).
From: francois1+bitcard [...] gmail.com
Ah, actually there is one catch with my test above, make test will run on my machine only if I have set this environment variable: DYLD_LIBRARY_PATH=/usr/local/mysql/lib Which in practice isn't working outside my shell session. So no, it's not solved yet :(.
This command will resolve the lib issue, however it would need to be executed outside of the build process most likely. sudo ln -s /usr/local/mysql/lib/*.dylib . Making that change, removing ALL references to i386 and ppc arch in the Makefile, and correcting the paths as outlined by other responders, allowed it to compile correctly against 64bit version of Perl and MySQL 5.5. All tests passed. This does appear to be a possible issue with XCode4 wanting to allow the build for all arch types. Researching appropriate flags to avoid this issue. On Tue May 24 02:28:59 2011, ubiquitic wrote: Show quoted text
> Ah, actually there is one catch with my test above, make test will run > on my machine only if I > have set this environment variable: > > DYLD_LIBRARY_PATH=/usr/local/mysql/lib > > Which in practice isn't working outside my shell session. > > So no, it's not solved yet :(.
Might help if I post which directory to cd into before running ln cd /usr/local/lib sudo ln -s /usr/local/mysql/lib/*.dylib . On Sat Jun 11 13:02:30 2011, AARONJJ wrote: Show quoted text
> This command will resolve the lib issue, however it would need to be > executed outside of the > build process most likely. > > sudo ln -s /usr/local/mysql/lib/*.dylib . > > Making that change, removing ALL references to i386 and ppc arch in > the Makefile, and > correcting the paths as outlined by other responders, allowed it to > compile correctly against > 64bit version of Perl and MySQL 5.5. All tests passed. > > This does appear to be a possible issue with XCode4 wanting to allow > the build for all arch > types. Researching appropriate flags to avoid this issue. > > On Tue May 24 02:28:59 2011, ubiquitic wrote:
> > Ah, actually there is one catch with my test above, make test will
> run
> > on my machine only if I > > have set this environment variable: > > > > DYLD_LIBRARY_PATH=/usr/local/mysql/lib > > > > Which in practice isn't working outside my shell session. > > > > So no, it's not solved yet :(.
> >
From: thierryv [...] mac.com
Got into the same issue with DBD-mysql-4.020 and MacOSX 2.6.8 The issue is in the linking of mysql.bundle with the MySQL dylib file. The path is NOT SET explicitly (- install_name) by the linker. The problem is in the Makefile. Show quoted text
># otool -L blib/arch/auto/DBD/mysql/mysql.bundle
blib/arch/auto/DBD/mysql/mysql.bundle: libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) Even if mysql_config reports the right lib path, that path is not set at the link step. I'm not an expert in Makefiles so I can't propose a definitive fix. However, to "correctly" solve the problem while waiting for a fix in the Makefile.PL WITHOUT resorting into using DYLD_LIBRARY_PATH which can cause trouble elsewhere, you must manually fix the installed shared library names using the install_name_tool utility. It's very simple. After doing the make, and before make test and make install, fix mysql.bundle using install_name_tool and the lib path provided by the mysql_config of your MySQL engine. In my case it's the Sun provided build. Don't use DYLD_LIBRARY_PATH, nor ln -s to fix this problem. It's all within the mysql.bundle file that is not correctly linked. Show quoted text
># mysql_config --libs
-L/usr/local/mysql/lib -lmysqlclient -lpthread #> make Show quoted text
># otool -L blib/arch/auto/DBD/mysql/mysql.bundle
blib/arch/auto/DBD/mysql/mysql.bundle: libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) #> install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib blib/arch/auto/DBD/mysql/mysql.bundle Show quoted text
># otool -L blib/arch/auto/DBD/mysql/mysql.bundle
blib/arch/auto/DBD/mysql/mysql.bundle: /usr/local/mysql/lib/libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) #> make test ... Result: PASS
This is no longer a problem on modern OS X (or macOS).