从python安装脚本中的编译标志中删除ppc [英] Remove ppc from compilation flags in python setup scripts

查看:97
本文介绍了从python安装脚本中的编译标志中删除ppc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Intel Mac OS X Leopard计算机上安装PIL.不幸的是,"setup.py build"认为它应该为ppc编译.

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

这失败了,因为我的机器上没有可用的ppc拱文件(也不想安装它们).我怎样才能告诉setup.py只做i386?

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?

我已经在/Library/Frameworks/Python.framework中查找了配置文件,但无济于事.

I've looked in /Library/Frameworks/Python.framework for a config file to no avail.

推荐答案

最简单的解决方案(针对单个或几个C文件)是复制编译器行,对其进行编辑,然后手动调用它,然后运行setup.py再次-它应该注意到此步骤已经完成.

The easiest solution (for a single or a few C files) is to copy the compiler line, edit it, and invoke it manually, then run setup.py again - it should notice that this step was already done.

要使setup.py不再使用这些选项,您需要在Python的config目录中更改Makefile,然后删除这些选项.

To make setup.py not use these options anymore, you need to change the Makefile in Python's config directory, and remove the options.

这篇关于从python安装脚本中的编译标志中删除ppc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆