【问题标题】:Building QuantLib python bindings on windows 7: 'unrecognized command line option '-mno-cygwin''在 Windows 7 上构建 QuantLib python 绑定:'无法识别的命令行选项'-mno-cygwin''
【发布时间】: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


【解决方案1】:

我完成了一个在 Windows(Vista 和 XP)上构建 Quantlib Python 绑定的教程。这可能也适用于 Windows 7,您不需要 Visual Studio。 here

【讨论】:

  • @sanjay-t-sharma 我很抱歉。我使用 Zone Edit 来管理我的 DNS(免费),但他们有时会让 DNS 服务器停机超过 48 小时。
【解决方案2】:

答案是 Python 2.6 distutils 还没有赶上 MinGW (source)。我现在收到另一个错误,但这是另一个问题。

【讨论】:

    猜你喜欢
    • 2012-11-15
    • 1970-01-01
    • 1970-01-01
    • 2015-04-01
    • 1970-01-01
    • 2018-02-11
    • 2012-02-13
    • 2021-08-21
    • 1970-01-01
    相关资源
    最近更新 更多