Installation problem with SWIG Python wrapper
Posted by eponalank on Mar 21, 2014; 1:44pm
URL: http://quantlib.414.s1.nabble.com/Installation-problem-with-SWIG-Python-wrapper-tp15085.html
Hello,
I am using QuanLlib 1.3, Boost 1.55, Python 2.7.6
I am having issues installing the SWIG-Python wrapper for QuantLib (using python setup.py install command), with two main errors. Would like to know if anyone has encountered this, and whether they solved it.
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/valarray:4027:59: error: 'value_type' is a
private member of 'boost::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >'
__val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/valarray:4030:1: note: while substituting
deduced template arguments into function template 'operator<<' [with _Expr =
boost::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >]
operator<<(const typename _Expr::value_type& __x, const _Expr& __y)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/valarray:4028:46: error: 'value_type' is a
private member of 'boost::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >'
__scalar_expr<typename _Expr::value_type>, _Expr> >
Here is the full error message:
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-2.7
creating build/lib.macosx-10.9-x86_64-2.7/QuantLib
copying QuantLib/__init__.py -> build/lib.macosx-10.9-x86_64-2.7/QuantLib
copying QuantLib/QuantLib.py -> build/lib.macosx-10.9-x86_64-2.7/QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
creating build/temp.macosx-10.9-x86_64-2.7
creating build/temp.macosx-10.9-x86_64-2.7/QuantLib
clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/quantlib/1.3/include -c QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.9-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused
QuantLib/quantlib_wrap.cpp:2375:23: warning: explicitly assigning a
variable of type 'int' to itself [-Wself-assign]
res = SWIG_AddCast(res);
~~~ ^ ~~~
QuantLib/quantlib_wrap.cpp:2378:23: warning: explicitly assigning a
variable of type 'int' to itself [-Wself-assign]
res = SWIG_AddCast(res);
~~~ ^ ~~~
QuantLib/quantlib_wrap.cpp:2900:9: warning: variable 'res' is used
uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (PyType_Ready(tp) < 0)
^~~~~~~~~~~~~~~~~~~~
QuantLib/quantlib_wrap.cpp:2924:10: note: uninitialized use occurs here
return res;
^~~
QuantLib/quantlib_wrap.cpp:2900:5: note: remove the 'if' if its
condition is always false
if (PyType_Ready(tp) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~
QuantLib/quantlib_wrap.cpp:2881:10: note: initialize the variable 'res'
to silence this warning
int res;
^
= 0
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:42:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/experimental/all.hpp:20:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/experimental/processes/all.hpp:7:
/usr/local/Cellar/quantlib/1.3/include/ql/experimental/processes/gemanroncoroniprocess.hpp:63:14: warning:
'QuantLib::GemanRoncoroniProcess::evolve' hides overloaded virtual
function [-Woverloaded-virtual]
Real evolve(Time t0, Real x0, Time dt, Real dw, const Ar...
^
/usr/local/Cellar/quantlib/1.3/include/ql/stochasticprocess.hpp:240:27: note:
hidden overloaded virtual function
'QuantLib::StochasticProcess1D::evolve' declared here
Disposable<Array> evolve(Time t0, const Array& x0,
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:45:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/legacy/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/legacy/libormarketmodels/all.hpp:5:
/usr/local/Cellar/quantlib/1.3/include/ql/legacy/libormarketmodels/lfmcovarproxy.hpp:48:22: warning:
'QuantLib::LfmCovarianceProxy::integratedCovariance' hides
overloaded virtual function [-Woverloaded-virtual]
virtual Real integratedCovariance(
^
/usr/local/Cellar/quantlib/1.3/include/ql/legacy/libormarketmodels/lfmcovarparam.hpp:52:36: note:
hidden overloaded virtual function
'QuantLib::LfmCovarianceParameterization::integratedCovariance'
declared here
virtual Disposable<Matrix> integratedCovariance(
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:45:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/legacy/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/legacy/libormarketmodels/all.hpp:11:
/usr/local/Cellar/quantlib/1.3/include/ql/legacy/libormarketmodels/lmconstwrappervolmodel.hpp:44:20: warning:
'QuantLib::LmConstWrapperVolatilityModel::volatility' hides
overloaded virtual function [-Woverloaded-virtual]
Volatility volatility(
^
/usr/local/Cellar/quantlib/1.3/include/ql/legacy/libormarketmodels/lmvolmodel.hpp:45:28: note:
hidden overloaded virtual function
'QuantLib::LmVolatilityModel::volatility' declared here
virtual Volatility volatility(
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:8:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackscholescalculator.hpp:48:14: warning:
'QuantLib::BlackScholesCalculator::delta' hides overloaded virtual
function [-Woverloaded-virtual]
Real delta() const;
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackcalculator.hpp:58:22: note:
hidden overloaded virtual function
'QuantLib::BlackCalculator::delta' declared here
virtual Real delta(Real spot) const;
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:8:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackscholescalculator.hpp:51:14: warning:
'QuantLib::BlackScholesCalculator::elasticity' hides overloaded
virtual function [-Woverloaded-virtual]
Real elasticity() const;
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackcalculator.hpp:65:22: note:
hidden overloaded virtual function
'QuantLib::BlackCalculator::elasticity' declared here
virtual Real elasticity(Real spot) const;
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:8:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackscholescalculator.hpp:54:14: warning:
'QuantLib::BlackScholesCalculator::gamma' hides overloaded virtual
function [-Woverloaded-virtual]
Real gamma() const;
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackcalculator.hpp:72:22: note:
hidden overloaded virtual function
'QuantLib::BlackCalculator::gamma' declared here
virtual Real gamma(Real spot) const;
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:8:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackscholescalculator.hpp:56:14: warning:
'QuantLib::BlackScholesCalculator::theta' hides overloaded virtual
function [-Woverloaded-virtual]
Real theta(Time maturity) const;
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackcalculator.hpp:75:22: note:
hidden overloaded virtual function
'QuantLib::BlackCalculator::theta' declared here
virtual Real theta(Real spot,
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:8:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackscholescalculator.hpp:59:14: warning:
'QuantLib::BlackScholesCalculator::thetaPerDay' hides overloaded
virtual function [-Woverloaded-virtual]
Real thetaPerDay(Time maturity) const;
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/blackcalculator.hpp:79:22: note:
hidden overloaded virtual function
'QuantLib::BlackCalculator::thetaPerDay' declared here
virtual Real thetaPerDay(Real spot,
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:46:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/math/all.hpp:36:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/valarray:4027:59: error:
'value_type' is a private member of
'boost::detail::operator_brackets_proxy<QuantLib::step_iterator<double
*> >'
__val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/valarray:4030:1: note:
while substituting deduced template arguments into function
template 'operator<<' [with _Expr =
boost::detail::operator_brackets_proxy<QuantLib::step_iterator<double
*> >]
operator<<(const typename _Expr::value_type& __x, const _Expr& __y)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/valarray:4028:46: error:
'value_type' is a private member of
'boost::detail::operator_brackets_proxy<QuantLib::step_iterator<double
*> >'
__scalar_expr<typename _Expr::value_type>, _Expr> >
^
QuantLib/quantlib_wrap.cpp:6833:62: warning: conversion from string
literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
PyObject* pyResult = PyObject_CallFunction(function_,"d",x);
^
QuantLib/quantlib_wrap.cpp:6841:43: warning: conversion from string
literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
PyObject_CallMethod(function_,"derivative","d",x);
^
QuantLib/quantlib_wrap.cpp:6841:56: warning: conversion from string
literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
PyObject_CallMethod(function_,"derivative","d",x);
^
QuantLib/quantlib_wrap.cpp:6873:62: warning: conversion from string
literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
PyObject* pyResult = PyObject_CallFunction(function_,"dd",x,y);
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:28:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/all.hpp:23:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdbermudanengine.hpp:47:14: warning:
'QuantLib::FDBermudanEngine<CrankNicolson>::calculate' hides
overloaded virtual function [-Woverloaded-virtual]
void calculate() const {
^
QuantLib/quantlib_wrap.cpp:9395:33: note: in instantiation of template
class 'QuantLib::FDBermudanEngine<CrankNicolson>' requested here
new FDBermudanEngine<>(bsProcess,timeSteps,
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdmultiperiodengine.hpp:76:22: note:
hidden overloaded virtual function
'QuantLib::FDMultiPeriodEngine<CrankNicolson>::calculate' declared
here
virtual void calculate(PricingEngine::results*) const;
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:28:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/all.hpp:21:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdamericanengine.hpp:29:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdstepconditionengine.hpp:28:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdvanillaengine.hpp:101:14: warning:
'QuantLib::FDEngineAdapter<QuantLib::FDAmericanCondition<QuantLib::FDStepConditionEngine<CrankNicolson>
>, QuantLib::OneAssetOption::engine>::calculate' hides overloaded
virtual function [-Woverloaded-virtual]
void calculate() const {
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdamericanengine.hpp:46:18: note:
in instantiation of template class
'QuantLib::FDEngineAdapter<QuantLib::FDAmericanCondition<QuantLib::FDStepConditionEngine<CrankNicolson>
>, QuantLib::OneAssetOption::engine>' requested here
: public FDEngineAdapter<FDAmericanCondition<
^
QuantLib/quantlib_wrap.cpp:9506:33: note: in instantiation of template
class 'QuantLib::FDAmericanEngine<CrankNicolson>' requested here
new FDAmericanEngine<>(bsProcess,timeSteps,
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdstepconditionengine.hpp:54:22: note:
hidden overloaded virtual function
'QuantLib::FDStepConditionEngine<CrankNicolson>::calculate'
declared here
virtual void calculate(PricingEngine::results*) const;
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:28:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/all.hpp:21:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdamericanengine.hpp:29:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdstepconditionengine.hpp:28:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdvanillaengine.hpp:101:14: warning:
'QuantLib::FDEngineAdapter<QuantLib::FDShoutCondition<QuantLib::FDStepConditionEngine<CrankNicolson>
>, QuantLib::OneAssetOption::engine>::calculate' hides overloaded
virtual function [-Woverloaded-virtual]
void calculate() const {
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdshoutengine.hpp:42:18: note:
in instantiation of template class
'QuantLib::FDEngineAdapter<QuantLib::FDShoutCondition<QuantLib::FDStepConditionEngine<CrankNicolson>
>, QuantLib::OneAssetOption::engine>' requested here
: public FDEngineAdapter<FDShoutCondition<
^
QuantLib/quantlib_wrap.cpp:9515:36: note: in instantiation of template
class 'QuantLib::FDShoutEngine<CrankNicolson>' requested here
new FDShoutEngine<>(bsProcess,timeSteps,
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdstepconditionengine.hpp:54:22: note:
hidden overloaded virtual function
'QuantLib::FDStepConditionEngine<CrankNicolson>::calculate'
declared here
virtual void calculate(PricingEngine::results*) const;
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:28:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/all.hpp:21:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdamericanengine.hpp:29:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdstepconditionengine.hpp:28:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdvanillaengine.hpp:101:14: warning:
'QuantLib::FDEngineAdapter<QuantLib::FDDividendEngine<CrankNicolson>,
QuantLib::DividendVanillaOption::engine>::calculate' hides
overloaded virtual function [-Woverloaded-virtual]
void calculate() const {
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fddividendeuropeanengine.hpp:43:18: note:
in instantiation of template class
'QuantLib::FDEngineAdapter<QuantLib::FDDividendEngine<CrankNicolson>,
QuantLib::DividendVanillaOption::engine>' requested here
: public FDEngineAdapter<FDDividendEngine<Scheme>,
^
QuantLib/quantlib_wrap.cpp:9629:24: note: in instantiation of template
class 'QuantLib::FDDividendEuropeanEngine<CrankNicolson>'
requested here
new FDDividendEuropeanEngine<>(bsProcess,timeSteps,
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdmultiperiodengine.hpp:76:22: note:
hidden overloaded virtual function
'QuantLib::FDMultiPeriodEngine<CrankNicolson>::calculate' declared
here
virtual void calculate(PricingEngine::results*) const;
^
In file included from QuantLib/quantlib_wrap.cpp:3819:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/quantlib.hpp:50:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/all.hpp:28:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/all.hpp:21:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdamericanengine.hpp:29:
In file included from /usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdstepconditionengine.hpp:28:
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdvanillaengine.hpp:101:14: warning:
'QuantLib::FDEngineAdapter<QuantLib::FDAmericanCondition<QuantLib::FDDividendEngine<CrankNicolson>
>, QuantLib::DividendVanillaOption::engine>::calculate' hides
overloaded virtual function [-Woverloaded-virtual]
void calculate() const {
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fddividendamericanengine.hpp:45:18: note:
in instantiation of template class
'QuantLib::FDEngineAdapter<QuantLib::FDAmericanCondition<QuantLib::FDDividendEngine<CrankNicolson>
>, QuantLib::DividendVanillaOption::engine>' requested here
: public FDEngineAdapter<FDAmericanCondition<FDDividendE...
^
QuantLib/quantlib_wrap.cpp:9638:24: note: in instantiation of template
class 'QuantLib::FDDividendAmericanEngine<CrankNicolson>'
requested here
new FDDividendAmericanEngine<>(bsProcess,timeSteps,
^
/usr/local/Cellar/quantlib/1.3/include/ql/pricingengines/vanilla/fdmultiperiodengine.hpp:76:22: note:
hidden overloaded virtual function
'QuantLib::FDMultiPeriodEngine<CrankNicolson>::calculate' declared
here
virtual void calculate(PricingEngine::results*) const;
^
QuantLib/quantlib_wrap.cpp:243361:14: warning: explicitly assigning a
variable of type 'void *' to itself [-Wself-assign]
clientdata = clientdata;
~~~~~~~~~~ ^ ~~~~~~~~~~
21 warnings and 2 errors generated.
error: command 'clang' failed with exit status 1
Thank you,
Francesco