[Image-SIG] PIL and target processors and OSX, oh-my!

Jon McKamey jmcKamey at neatreceipts.com
Thu May 15 19:45:36 CEST 2008

After not getting a response, I sent this missive to the mod_python list
as well. They recommended 'thinning' the application, as is outlined in
the modwsgi tutorial for OSX.


That seems to work, and got things going. It also includes a good
explanation of exactly what the underlying problems was, in case my
question was not so clear.

- Jon McKamey

-----Original Message-----
From: Christopher Barker [mailto:Chris.Barker at noaa.gov] 
Sent: Thursday, May 15, 2008 1:23 PM
To: Jon McKamey; image-sig at python.org
Subject: Re: [Image-SIG] PIL and target processors and OSX, oh-my!

Jon McKamey wrote:
> I'm trying to get PIL and mod_python to run on apache2 on a Mac
> OSX 10.5  To give some background,  httpd is build with 4 target 
> processors, so everything loaded by it (mod_python, PIL, etc) has to
> built to handle all 4 target processors.  Including all PIL and it's 
> libraries. I am to the point where PIL has been rebuilt for the 4
> processors.   If I run otool on it, I get the list of modules it
> and not all of them are built for the 4 processors, some of which
> to be OS built-in libraries.
> So, the point I am stuck at:  It's not clear to me how and what to do
> rebuild those modules, and it's not clear to me if it's even safe to 
> rebuild and replace those modules with 4 processor versions of the 
> files.

I wouldn't. Also, I'm a bit confused. The Apple-supplied built-in ones 
should be dynamic libs, and I thought those only had to be built for the

processor you are running on.

Which libs are you having issues with?

Anyway, I wouldn't replace ANY system libs. If the system ones won't 
work for you, you'll probably need to build your own versions of them, 
install them elsewhere, and make sure PIL links to those.

 > Macports?

Last I heard MacPorts and Fink don't do any multi-processor building. 
Which leaves you with:

> Download the source and go?

The problem there is that many (most) libs don't build Universal out of 
the box, so you need o go in and hack the MakeFiles. I've only done dual

mode builds (PPC and Intel, 32bit), but I imagine it's a similar deal. 
One trick is going to be if Configure sets anything about 32 vs. 64 
bits, then you may run into issues. I think most of the endian issues 
have been addressed in the major libraries.

I'd try this question on the pythonmac list -- it's really more a Mac 
issue than a PIL one.

Good luck!


Christopher Barker, Ph.D.

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 Image-SIG mailing list