在MacOSX上使用Enthought的scipy.weave编译错误

时间:2013-08-08 19:45:11

标签: macos scipy enthought

我尝试使用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)

1 个答案:

答案 0 :(得分:2)

我自己一直没有使用weave,所以我不知道它是否有特定的SDK要求,但我怀疑问题是你不应该将10.5 SDK与你看来更新的Xcode一起使用正在使用。我也有该版本,它只安装了10.7和10.8 SDK。几个版本的Xcode停止使用/ Developer文件夹,它现在都安装在Xcode应用程序包中。所以我要尝试的第一件事就是将/ Developer移动到某个地方,然后再次尝试构建,看看是否能够解决这个问题。如果是这样,那么你应该能够完全删除/ Developer。