Build issue
Kmanolo opened this issue · comments
Hi,
I have downloaded pyql and Quantlib to a new Linux Mint system ( Linux Mint 17.2 cinnamon 64bit).
I am unable to build pyql with errors similar to 103.
The quantlib has build fine and I can run the examples fine. Please also note i am using Cython 0.23.4.
Any help is much appreciated, the error is attached below :
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -I/usr/local/include -I/usr/include -I. -I./cpp_layer -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c quantlib/time/date.cpp -o build/temp.linux-x86_64-2.7/quantlib/time/date.o
quantlib/time/date.cpp: In function ‘QuantLib::TimeUnit _Pyx_PyInt_As_enum__QuantLib_3a__3a_TimeUnit(PyObject)’:
quantlib/time/date.cpp:11386:188: error: invalid cast from type ‘QuantLib::Period’ to type ‘QuantLib::TimeUnit’
return (enum QuantLib::TimeUnit) (((enum QuantLib::TimeUnit)-1)(((((enum QuantLib::TimeUnit)digits[1]) << PyLong_SHIFT) | (enum QuantLib::TimeUnit)digits[0])));
^
quantlib/time/date.cpp:11404:245: error: invalid cast from type ‘QuantLib::Period’ to type ‘QuantLib::TimeUnit’
return (enum QuantLib::TimeUnit) (((enum QuantLib::TimeUnit)-1)(((((((enum QuantLib::TimeUnit)digits[2]) << PyLong_SHIFT) | (enum QuantLib::TimeUnit)digits[1]) << PyLong_SHIFT) | (enum QuantLib::TimeUnit)digits[0])));
^
quantlib/time/date.cpp:11422:302: error: invalid cast from type ‘QuantLib::Period’ to type ‘QuantLib::TimeUnit’
return (enum QuantLib::TimeUnit) (((enum QuantLib::TimeUnit)-1)_(((((((((enum QuantLib::TimeUnit)digits[3]) << PyLong_SHIFT) | (enum QuantLib::TimeUnit)digits[2]) << PyLong_SHIFT) | (enum QuantLib::TimeUnit)digits[1]) << PyLong_SHIFT) | (enum QuantLib::TimeUnit)digits[0])));
@Kmanolo This is a known issue. Either you have to downgrade cython to the same version used on master or patch the code to work with the latest Cython.
@dpinte thanks fro your reply. I misunderstood that its ok with Cython > 0.20. What would I have to patch to get it working with newer Cython ? Sth I missed on the previous issue ?
Many thanks!
@Kmanolo I haven't had the time to investigate the issue with the newest Cython. It seems the Period vs TimeUnit declarations in the pxd files should be reworked... You should look into quantlib/time/date.pyx
and quantlib/time/_date.pxd