我尝试使用使用scipy.weave进行数值优化的包,并使用来自scipy.weave.inline调用的CompileError。
一些实验给出了一个最小的失败例子:
import scipy.weave
scipy.weave.inline('printf("%d\\n",1);')这导致了一个巨大的错误转储,而由于空间原因,我已经安装了pastebin:http://pastebin.com/0QR4kq2V。
转储中的第一个错误是
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/complex:47:28: error: bits/c++config.h: No such file or directory最后的输出是
CompileError: error: Command "g++ -fno-strict-aliasing -fno-common -dynamic -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -O3 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/scipy/weave -I/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/scipy/weave/scxx -I/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -c /Users/mik/.python27_compiled/sc_f6039f30c0a12f4687924b6a12ef83730.cpp -o /var/folders/_z/qd8rt65n1n56_nvv4nyy7xlh0000gn/T/mik/python27_intermediate/compiler_ecdbc4f3f030692747d93319f8d429b2/Users/mik/.python27_compiled/sc_f6039f30c0a12f4687924b6a12ef83730.o" failed with exit status 1我运行MacOSX 10.8.4,
> g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.和
> python --version
Python 2.7.3 -- EPD 7.3-2 (32-bit)发布于 2013-08-09 06:50:34
我本人根本没有使用过weave,所以我不知道它是否有特定的SDK要求,但我怀疑问题是,您不应该在使用新的Xcode时使用10.5SDK。我也有那个版本,它只安装了10.7和10.8 SDK。返回Xcode的几个版本都停止使用/Developer文件夹,现在全部安装在Xcode应用程序包中。所以我要做的第一件事就是把/Developer移到别的地方,再试着再建一次,看看能不能解决这个问题。如果是这样,那么您应该能够完全删除/Developer。
https://stackoverflow.com/questions/18134751
复制相似问题