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

Christopher Barker Chris.Barker at noaa.gov
Thu Jan 8 01:00:30 CET 2009


Joe Strout wrote:
> MySQLdb folder containing a bunch of other .pyc files.  Nothing else 
> though; just Python bytecode.  Is it possible that MySQLdb is written 
> entirely in Python, and was never the problem at all?

no -- there is C code that needs to be compiled, I"m pretty sure anyway! 
maybe I'll get a chance to try it myself.

>  I.e., that given 
> a suitable portable mysql client library, MySQLdb will Just Work?

that would be great, but no, I don't think so.

> But OK, now this brings up the question of why my 
> libmysqlclient_r.16.dylib is Intel-only, when I took pains to install a 
> UB version of MySQL (c.f. the "Installing MySQL" section of 
> <http://www.dotancohen.com/howto/python-app-mac.html>).  (I'm going to 
> do a fresh download of that mysql binary package and poke around inside 
> to see what I find.)


> 
>> You can find what it builds in the "build" directory that distutils 
>> creates when you run "setup.py build". It will be in something like:
>>
>> build/lib.macosx-10.3-ppc-2.5
>>
>> and I think will be called -mysql.so
> 
> But now I'm confused again.  I thought this library was part of the 
> mysql distribution -- not something created by the Python script 

"libmysqlclient" is part of mysql. I"m pretty sure that the python 
module requires a compiled extension, that links against it, and it will 
be called something like _mysql.so, and should get put in the build 
directory when you built it, and installed somewhere in site-packages 
when you install it.

> Thanks for your patience,

no problem -- this really is complex!

> /Users/jstrout/Downloads/mysql-5.1.30-osx10.4-universal/lib/libmysqlclient_r.16.dylib: 
> Mach-O dynamically linked shared library i386
> 
> So it turns out that the 10.4 Universal mysql isn't.  (Or at least, this 
> particular library isn't -- perhaps there's another library in here 
> somewhere with a different name, that serves the same function for PPC?)

could be -- I'm just guessing here, but I suspect that libmysqlclient 
may be used only for custom clients, so it may have gotten built 
non-universal and no one has noticed. What do the other libs in there 
look like?

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list