简体   繁体   English

如何阻止setup.py尝试在MacOSX版本中包含-arch ppc?

[英]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. 似乎Xcode4不再包含PPC作为构建选项。 When using setup.py for modules that include C extensions, setup.py always attempts the build with these options: 将setup.py用于包含C扩展的模块时,setup.py始终使用以下选项尝试构建:

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. 如果我只是从失败的命令中删除-arch ppc它就完成了,我可以重新运行setup.py build继续下一步。

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. 这对于仅包含一个C扩展的模块(如ssl)是可以的,但对于像PIL这样构建大量扩展的东西来说,这是一个很大的痛苦。

Is there some way to prevent setup.py from including -arch ppc in the compilation parameters? 有没有办法阻止setup.py在编译参数中包含-arch ppc?

Or, fix Xcode 4 installation about ppc assembler. 或者,修复关于ppc汇编程序的Xcode 4安装。

$ 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM