QuantLib 没有在日内支持下编译

QuantLib was not compiled with intraday support

在 Mac 10.12.6 上编译 QuantLib v1.11,使用文档中的标准选项,启用日内支持

./configure --with-boost-include=/usr/local/include/ \
            --with-boost-lib=/usr/local/lib/ --prefix=/usr/local/ \
            CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \
            LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9' \
            --enable-intraday

为 Anaconda 安装了 QuantLib Python 3.6.2:

pip install QuantLib-Python

试图创建日内 ql.Date 对象失败:

>>> import QuantLib as ql
>>> import datetime as dt
>>> now = dt.datetime.today()
>>> ql.Date(now.day, now.month, now.year, now.hour, now.minute, now.second)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jason/anaconda3/lib/python3.6/site-packages/QuantLib/QuantLib.py", line 433, in __init__
    this = _QuantLib.new_Date(*args)
RuntimeError: QuantLib was not compiled with intraday support

这是一个错误还是我做错了什么?

(交叉发布于 GitHub

您使用 pip 安装的 QuantLib-Python 版本带有它自己的静态库版本,而不是 link 您编译的版本。如果你想使用后者,你必须自己编译包装器。