tags:

views:

170

answers:

1

I'm trying to install PIL on an Intel Mac OS X Leopard machine. Unfortunately, "setup.py build" thinks it should be compiling for ppc.

gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/sw/include -I/opt/local/include -I/Users/adam/Development/pinax-env/include -I/usr/local/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c libImaging/GifEncode.c -o build/temp.macosx-10.3-i386-2.5/libImaging/GifEncode.o

This fails because I don't have the ppc arch files available on my machine (nor do I want to install them). How can I tell setup.py to only do i386?

I've looked in /Library/Frameworks/Python.framework for a config file to no avail.

+3  A: 

The easiest solution (for a single or a few C files) is to copy the compiler line, edit it, and invoke it manually, then run setup.py again - it should notice that this step was already done.

To make setup.py not use these options anymore, you need to change the Makefile in Python's config directory, and remove the options.

Martin v. Löwis
setup.py did not notice :-(
Adam Nelson
What Makefile did you edit? What python binary are you using?
Martin v. Löwis
Got it. Info at the bottom of this page:http://wiki.python.org/moin/MacPython/UniversalLibrariesAndExtensions/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/MakefileI had tried just 'copying and pasting' the offending gcc - which is what didn't work. The Makefile needed to be changed in the end.
Adam Nelson