distutils extension configuration problem

Art grenander at gmail.com
Fri Jun 5 21:04:47 CEST 2009


On May 26, 11:10 pm, Ron Garret <rNOSPA... at flownet.com> wrote:
> I'm trying to build PyObjC on an Intel Mac running OS X 10.5.7.  The
> build is breaking because distutils seems to want to build extension
> modules as universal binaries, but some of the libraries it depends on
> are built for intel-only, i.e.:
>
> [ron at mickey:~/Desktop/pyobjc-framework-ScreenSaver-2.2b2]$ python2.6
> setup.py build
> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils
> /dist.py:266: UserWarning: Unknown distribution option: 'options'
>   warnings.warn(msg)
> running build
> running build_py
> running build_ext
> building 'ScreenSaver._inlines' extension
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
> -bundle -undefined dynamic_lookup
> build/temp.macosx-10.3-i386-2.6/Modules/_ScreenSaver_inlines.o -o
> build/lib.macosx-10.3-i386-2.6/ScreenSaver/_inlines.so -framework
> ScreenSaver
> ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libTIFF.dylib, file
> is not of required architecture for architecture ppc
> collect2: ld returned 1 exit status
> lipo: can't open input file:
> /var/folders/nT/nTiypn-v2RatkU+BYncrKU+++TI/-Tmp-//ccMFYRkt.out (No such
> file or directory)
> error: command 'gcc' failed with exit status 1
>
> [ron at mickey:~/Desktop/pyobjc-framework-ScreenSaver-2.2b2]$ file
> build/temp.macosx-10.3-i386-2.6/Modules/_ScreenSaver_inlines.o
> build/temp.macosx-10.3-i386-2.6/Modules/_ScreenSaver_inlines.o: Mach-O
> universal binary with 2 architectures
> build/temp.macosx-10.3-i386-2.6/Modules/_ScreenSaver_inlines.o (for
> architecture ppc): Mach-O object ppc
> build/temp.macosx-10.3-i386-2.6/Modules/_ScreenSaver_inlines.o (for
> architecture i386):   Mach-O object i386
>
> [ron at mickey:~/Desktop/pyobjc-framework-ScreenSaver-2.2b2]$ file
> /usr/local/lib/libtiff.dylib
> /usr/local/lib/libtiff.dylib: Mach-O dynamically linked shared library
> i386
>
> How do I get distutils to stop trying to build extensions as universal
> binaries?
>
> Thanks,
> rg

I have the same questions but haven't found anything. I got this idea
from the apple site:

http://developer.apple.com/releasenotes/OpenSource/PerlExtensionsRelNotes/index.html

so I tried:

env CFLAGS='-arch i386' LDFLAGS='-arch i386' python setup.py build

and this removes the -arch ppc flags at least for the compiles but not
the links. Maybe something in this direction will work.

This didn't work:

env ARCHFLAGS='-arch i386' python setup.py install

Art



More information about the Python-list mailing list