How do I stop setup.py from trying to include -arch ppc on MacOSX builds?
It appears that Xcode4 doesn't include PPC as a build option anymore. When using setup.py for modules that include C extensions, setup.py always attempts the build with these options:
gcc-4.2 ... -DMACOSX -arch i386 -arch ppc ...
This fails with the error message
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
If I just remove -arch ppc from the failed command it completes fine and I can rerun setup.py build
to move on to the next step.开发者_StackOverflow社区
This is okay for modules that only include one C extension, like ssl, but for something like PIL that builds a ton of extensions it is a major pain.
Is there some way to prevent setup.py from including -arch ppc in the compilation parameters?
- Remove ppc from compilation flags in python setup scripts
Or, fix Xcode 4 installation about ppc assembler.
$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /Developer/usr/libexec/gcc/darwin
$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /usr/libexec/gcc/darwin
精彩评论