Python Swig not working.
Hi, I have got pyql bindings to work, did the test and install and also looked at examples all fine for pyql using git clone https://github.com/enthought/pyql.git cd pyql python setup.py build python setup.py test python setup.py install, but not the SWIG Python bindings. On a mac, with Boost and Quantlib 1.7.1 installed, also the xcode command line tools etc. cd to QuantLib-SWIG-1.7/Python then python setup.py build
and get the following - >
running build
running build_py
running build_ext
building 'QuantLib._QuantLib' extension
/usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -m32 -m32 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/opt/local/include -I/opt/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.9-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused -m32
In file included from QuantLib/quantlib_wrap.cpp:3940:
In file included from /opt/local/include/ql/quantlib.hpp:43:
In file included from /opt/local/include/ql/experimental/all.hpp:25:
In file included from /opt/local/include/ql/experimental/volatility/all.hpp:21:
In file included from /opt/local/include/ql/experimental/volatility/zabr.hpp:31:
In file included from /opt/local/include/ql/math/statistics/incrementalstatistics.hpp:35:
In file included from /opt/local/include/boost/accumulators/statistics/stats.hpp:14:
In file included from /opt/local/include/boost/accumulators/statistics_fwd.hpp:12:
/opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization
of non-static data member is a C++11 extension [-Wc++11-extensions]
const int m_x = 1 / (sizeof(T) - sizeof(T));
^
In file included from QuantLib/quantlib_wrap.cpp:3940:
In file included from /opt/local/include/ql/quantlib.hpp:47:
In file included from /opt/local/include/ql/math/all.hpp:38:
In file included from /opt/local/include/ql/math/matrixutilities/all.hpp:4:
In file included from /opt/local/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4032:59: error:
'value_type' is a private member of
'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
*> >'
__val_expr<_BinaryOp<__bit_shift_left
What Boost version are you using? Also, may you try the pre-release versions of QuantLib and QuantLib-SWIG at https://sourceforge.net/projects/quantlib/files/QuantLib/prerelease/ and see if they have the same problem?
Have got it working. Completely cleaned the Homebrew and macports installation of boost and quantlib. Then sudo port install boost, then installed QuantLib-1.8 and then only the QuantLib-SWIG-1.8 Python Swig. Other attempts failed so had to completely wipe any version of boost and quantlib before attempting. Cheers.
Ok, thanks.