【发布时间】:2011-09-10 04:59:09
【问题描述】:
我正在尝试构建 QuantLib Python 绑定。我设法使用these 指令构建了QuantLib(我找到了libboost_serialization 文件here)。当我尝试 python setup.py build 时,我收到以下错误
python setup.py build
running build
running build_py
running build_ext
building 'QuantLib._QuantLib' extension
C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Python26\PC -c QuantLib/quantlib_wrap.cpp -o build\temp.win32-2.6\Release\quantlib\quantlib_wrap.o
cc1plus: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
我听说 mno-cygwin 选项不再受支持,我已经看到它从 numpy distutils 中删除,但据我所知,这只是使用 python distutils。关于我应该看什么的任何提示?
- Windows 7
- python 2.6
- numpy 1.5.1
- QuantLib 1.46.1
【问题讨论】:
-
您链接的说明提到使用 Visual C++ Express,但您的输出告诉 distutils 尝试使用 gcc。你实际使用的是什么?
-
我认为 VC express 是用于编译 QuantLib 而不是用于 QuantLib 绑定。我已经成功地构建了 QuantLib 本身。您对说明的解释不同吗?
-
好吧,我没有在说明中的任何地方看到 mingw 或 gcc,我确实使用 VC++9 构建了绑定。 Distutils 与它配合得很好,因为 Python 本身是使用 Windows 上的 VC++ 编译器构建的。另外,我不知道用 VC++ 编译的库和用 gcc 编译的绑定是二进制兼容的......
标签: python quantlib quantlib-swig