Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove ppc from compilation flags in python setup scripts

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.

like image 928
Adam Nelson Avatar asked Jul 31 '09 18:07

Adam Nelson


1 Answers

The solution that worked for me was:

ARCHFLAGS="-arch i386 -arch x86_64" python setup.py build

Just pass the values for the flag right in the command line.

like image 165
Mel Avatar answered Sep 23 '22 14:09

Mel