gpt4 book ai didi

python - 为什么 GCC 忽略 Snow Leopard 中的 ARCHFLAGS?

转载 作者:太空狗 更新时间:2023-10-30 00:28:40 25 4
gpt4 key购买 nike

我正在尝试安装 AMFASTvirtual_env基于依赖文件的位置。我在我的本地 .profile 中有 export ARCHFLAGS="-arch x86_64",并通过运行 env 并看到它列出来确认它的存在。但是,每当我针对虚拟环境运行 PIP 时,gcc 都会设置为针对 i386 和 ppc。我还尝试在 PIP 命令中添加 env ARCHFLAGS="-arch i386 -arch x86_64"env ARCHFLAGS="-arch x86_64" ,但 gcc 始终具有标记 -arch i386 -arch ppc -arch x86_64。我怎样才能让 gcc 读取我的 archflags?

例子:

sudo pip install -E ~/Documents/project/project_env -r ~/Documents/project/trunk/django/dependencies.txt`  

输出
...

Running setup.py install for amfast  
building 'amfast.encode' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c amfast/ext_src/encoder.c -o build/temp.macosx-10.6-universal-2.6/amfast/ext_src/encoder.o
/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
amfast/ext_src/encoder.c:2121: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input file: /var/tmp//ccoYlfhN.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1

最佳答案

最有可能的问题是 ARCHFLAGS 环境变量没有被 sudo 传递。默认情况下,某些版本的 sudo 会过滤掉大多数 env 变量作为安全措施(请参阅 man sudo)。尝试以这种方式运行它:

sudo ARCHFLAGS="-arch x86_64" pip install -E ~/Documents/project/project_env -r ~/Documents/project/trunk/django/dependencies.txt`

关于python - 为什么 GCC 忽略 Snow Leopard 中的 ARCHFLAGS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6988528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com