pythonpython-3.6quantlibquantlib-swig

QuantLib was not compiled with intraday support


Compiled QuantLib v1.11 on Mac 10.12.6 with standard options from documentation with intraday support enabled:

./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

Installed QuantLib for Anaconda Python 3.6.2:

pip install QuantLib-Python

Tried to create an intraday ql.Date object which fails:

>>> 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

Is this is a bug or am I doing something wrong?

(Cross posted on GitHub)


Solution

  • The version of QuantLib-Python that you installed using pip comes with its own static version of the library, and doesn't link to the one you compiled. If you want to use the latter, you'll have to compile the wrappers yourself.