如何阻止 setup.py 尝试在 MacOSX 版本上包含 -arch ppc?
Xcode4 似乎不再包含 PPC 作为构建选项。当对包含 C 扩展的模块使用 setup.py 时,setup.py 始终尝试使用以下选项进行构建:
gcc-4.2 ... -DMACOSX -arch i386 -arch ppc ...
这会失败错误消息
/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
如果我只是从失败的命令中删除 -arch ppc,它会正常完成,我可以重新运行 setup.py build 继续下一步。
对于只包含一个 C 扩展的模块(例如 ssl)来说,这还可以,但对于像 PIL 这样构建大量扩展的模块来说,这是一个很大的痛苦。
有没有办法阻止 setup.py 在编译参数中包含 -arch ppc ?
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或者,修复有关 ppc 汇编器的 Xcode 4 安装。
Or, fix Xcode 4 installation about ppc assembler.