建立Quantlib-swig python 1.7

时间:2017-01-02 21:40:56

标签: python boost quantlib

尝试构建Quantlib-SWIG python时,我遇到了一个奇怪的bootst错误。我使用的是boost_1.60。

[idf@mail QuantLib-SWIG-1.7]$ make -C Python
make: Entering directory `/home/idf/Downloads/QuantLib-SWIG-1.7/Python'
make  all-am
make[1]: Entering directory `/home/idf/Downloads/QuantLib-SWIG-1.7/Python'
CXXFLAGS="-g -O2 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings" /home/idf/anaconda2/bin/python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/QuantLib
copying QuantLib/__init__.py -> build/lib.linux-x86_64-2.7/QuantLib
copying QuantLib/QuantLib.py -> build/lib.linux-x86_64-2.7/QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/QuantLib
g++ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/idf/anaconda2/include/python2.7 -I/usr/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.linux-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused -g -O2 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from /usr/local/include/boost/random/hyperexponential_distribution.hpp:22:0,
                 from /usr/local/include/boost/random.hpp:69,
                 from /usr/local/include/ql/experimental/catbonds/catrisk.hpp:34,
                 from /usr/local/include/ql/experimental/catbonds/catbond.hpp:31,
                 from /usr/local/include/ql/experimental/catbonds/all.hpp:4,
                 from /usr/local/include/ql/experimental/all.hpp:7,
                 from /usr/local/include/ql/quantlib.hpp:43,
                 from QuantLib/quantlib_wrap.cpp:3940:
/usr/local/include/boost/math/special_functions/fpclassify.hpp:84:22: fatal error: quadmath.h: No such file or directory
 #include "quadmath.h"
                      ^
compilation terminated.
error: command 'g++' failed with exit status 1
make[1]: *** [.build-stamp] Error 1
make[1]: Leaving directory `/home/idf/Downloads/QuantLib-SWIG-1.7/Python'
make: *** [all] Error 2
make: Leaving directory `/home/idf/Downloads/QuantLib-SWIG-1.7/Python'
[idf@mail QuantLib-SWIG-1.7]$ 

1 个答案:

答案 0 :(得分:0)

在CentOS下,我需要安装

[idf@mail QuantLib-SWIG-1.7]$ sudo yum install  libquadmath-devel