繁体   English   中英

Quantlib-Swig Python安装失败osx

[英]quantlib-swig python installation fails osx

Quantlib已安装,并且可以在/ usr / local / include和lib中正常工作。 尝试建立quantlib-swig时,出现许多错误。 我仅在下面粘贴一些示例。

我相信这些可能是编译器而不是链接问题,但是我不确定这是否正确或如何继续。

任何帮助和指针将不胜感激! 谢谢!

MBP:Python timo$ python setup.py build

QuantLib/quantlib_wrap.cpp:5201:41: error: no member named 'parse' in 'QuantLib::DateParser'
        return new Date(DateParser::parse(str,fmt));
In file included from QuantLib/quantlib_wrap.cpp:3467:
In file included from /usr/local/include/ql/quantlib.hpp:47:
In file included from /usr/local/include/ql/math/all.hpp:35:
In file included from /usr/local/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4035: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<typename _Expr::value_type>,
                                                      ^
QuantLib/quantlib_wrap.cpp:6170:23: note: while substituting deduced template arguments into function template 'operator<<' [with _Expr =
  boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >]
                s << (*self)[i][j];
                  ^
In file included from QuantLib/quantlib_wrap.cpp:3467:
In file included from /usr/local/include/ql/quantlib.hpp:47:
In file included from /usr/local/include/ql/math/all.hpp:35:
In file included from /usr/local/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4036:46: error: 'value_type' is a private member of
  'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double *> >'
           __scalar_expr<typename _Expr::value_type>, _Expr> >
QuantLib/quantlib_wrap.cpp:10789:19: error: no member named 'includeReferenceDateCashFlows' in 'QuantLib::Settings'
        self->includeReferenceDateCashFlows() = b;
        ~~~~  ^
QuantLib/quantlib_wrap.cpp:11175:17: error: no member named 'Surface' in namespace 'QuantLib' using QuantLib::Surface;
  ~~~~~~~~~~^
QuantLib/quantlib_wrap.cpp:11176:17: error: no member named 'Domain' in namespace 'QuantLib' using QuantLib::Domain;
  ~~~~~~~~~~^
QuantLib/quantlib_wrap.cpp:11178:80: error: use of undeclared identifier 'Surface' SWIGINTERN bool boost_shared_ptr_Sl_Surface_Sg____nonzero__(boost::shared_ptr< Surface > *self){
                                                                           ^
QuantLib/quantlib_wrap.cpp:11178:80: error: use of undeclared identifier 'Surface'
QuantLib/quantlib_wrap.cpp:11182:17: error: no member named 'TestSurface' in namespace 'QuantLib' using QuantLib::TestSurface;
  ~~~~~~~~~~^
QuantLib/quantlib_wrap.cpp:11183:27: error: use of undeclared identifier 'Surface'
typedef boost::shared_ptr<Surface> TestSurfacePtr;
                      ^
QuantLib/quantlib_wrap.cpp:11186:43: error: unknown type name 'TestSurface'
        return new TestSurfacePtr(new TestSurface);
                                      ^
QuantLib/quantlib_wrap.cpp:11204:254: error: function definition is not allowed here ...> > const &dates,std::vector< Rate,std::allocator< Rate > > const &yields,DayCounter const &dayCounter,Calendar const &calendar=Calendar(),Linear const &i=Linear()){
                                                                                                                                                                     ^
QuantLib/quantlib_wrap.cpp:11210:100: error: function definition is not allowed here SWIGINTERN std::vector< Date,std::allocator< Date > > const &ZeroCurvePtr_dates(ZeroCurvePtr *self){
                                                                                               ^
QuantLib/quantlib_wrap.cpp:11214:104: error: function definition is not allowed here SWIGINTERN std::vector< Rate,std::allocator< Rate > > const &ZeroCurvePtr_zeroRates(ZeroCurvePtr *self){
                                                                                                   ^
QuantLib/quantlib_wrap.cpp:11218:129: error: function definition is not allowed here SWIGINTERN std::vector< std::pair< Date,Rate >,std::allocator< std::pair< Date,Rate > > > ZeroCurvePtr_nodes(ZeroCurvePtr *self){
                                                                                                                            ^
QuantLib/quantlib_wrap.cpp:11223:8: error: expected unqualified-id extern "C" {
   ^
QuantLib/quantlib_wrap.cpp:196398:8: error: expected unqualified-id extern "C" {
   ^
QuantLib/quantlib_wrap.cpp:196596:8: error: expected unqualified-id extern "C" {
   ^
QuantLib/quantlib_wrap.cpp:196899:8: error: expected unqualified-id extern "C"

您可能正在尝试将QuantLib 1.5或更高版本与QuantLib-SWIG的早期版本一起使用。 问题中引用的成员和类在QuantLib 1.3(我认为)中已弃用,并最终在1.5版中删除。 QuantLib-SWIG 1.4或更早版本中定义的接口将尝试找到它们并失败。

您可以通过使用与您使用的QuantLib版本匹配的QuantLib-SWIG版本来避免错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM