[Pythonmac-SIG] How to get setuptools to build a Universal Binary?

Ned Deily nad at acm.org
Thu Jan 8 06:30:53 CET 2009


In article <496586D9.8000000 at strout.net>, Joe Strout <joe at strout.net> 
wrote:

> Ned Deily wrote:
> 
> > Hmm, there's omething odd about that download. 
> > ...
> 
> > $ file libmysqlclient_r.16.0.0.dylib
> > libmysqlclient_r.16.0.0.dylib: Mach-O universal binary with 3 
> > architectures
> > libmysqlclient_r.16.0.0.dylib (for architecture i386):   Mach-O 
> > dynamically linked shared library i386
> > libmysqlclient_r.16.0.0.dylib (for architecture ppc64):  Mach-O 64-bit 
> > dynamically linked shared library ppc64
> > libmysqlclient_r.16.0.0.dylib (for architecture ppc): Mach-O dynamically 
> > linked shared library ppc
> > 
> > $ file libmysqlclient_r.16.dylib
> > libmysqlclient_r.16.dylib: Mach-O dynamically linked shared library i386
> 
> OK, I think I see your point here.  In the 5.1 download, 
> libmysqlclient_r.16.0.0.dylib is universal, but 
> libmysqlclient_r.16.dylib is not.  From the looks of the 5.0 download, 
> these should be the same (both universal).
> 
> > Perhaps you can get away with making a symlink or copying from one to 
> > the other??
> 
> Seems reasonable, so as a test, I copied libmysqlclient_r.16.0.0.dylib 
> into my app bundle on top of libmysqlclient_r.16.dylib.  I verified with 
> "file" that my libmysqlclient_r.16.dylib is now universal, and verified 
> that my app still runs on an Intel Mac.  But on a PPC (10.4) Mac, it 
> still fails:
> 
>    File 
> "/Users/jstrout/Temp/etownCentral.app/Contents/Resources/IADB.py", line 
> 12, in <module>
>      import MySQLdb
>    File "MySQLdb/__init__.pyc", line 19, in <module>
> ImportError: 
> dlopen(/Users/jstrout/Temp/etownCentral.app/Contents/Resources/lib/python2.5/l
> ib-dynload/_mysql.so, 
> 2): Symbol not found: _mysql_get_host_info
>    Referenced from: 
> /Users/jstrout/Temp/etownCentral.app/Contents/Resources/lib/python2.5/lib-dynl
> oad/_mysql.so
>    Expected in: dynamic lookup

Did you try rebuilding the app bundle with py2app after the mysql libs 
were fixed?

> I used "otool -L" to check the dependencies of both _mysql.so and 
> libmysqlclient_r.16.dylib.  All seemed satisfactory, though the one for 
> the latter is a little strange:
> 
> $ otool -L libmysqlclient_r.16.dylib
> libmysqlclient_r.16.dylib:
>          /usr/local/mysql/lib/libmysqlclient_r.16.dylib (compatibility 
> version 17.0.0, current version 17.0.0)
>          /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, 
> current version 88.1.11)
> 
> I'm not sure why libmysqlclient_r.16.dylib is listing a dependency on 
> itself, but in /usr/local.  There is no /usr/local/mysql on a standard 
> machine (including the one where this is failing).  Yet otool does list 
> a "current version", perhaps because it's finding itself within the app 
> bundle?  Seems a little odd.

otools -L on the 5.0 libs I have installed shows similar results.  I 
wouldn't worry about it.

-- 
 Ned Deily,
 nad at acm.org



More information about the Pythonmac-SIG mailing list