0

QuantLib をインストールしようとしていて、Python で使用したいと考えています。しかし、私は Quantlib-SWIG のビルドに大きな問題を抱えています。うまくいけば、ここで助けを得ることができます。

http://quantlib.org/install/macosx.shtmlの手順に従って、Quantlib をビルドし、すべてのテスト スイートを正常に実行することができました(問題があれば、Lion を使用しています)。Quantlib-SWIG をダウンロードして解凍し、python setup.py ビルドを実行しようとすると、多くのエラーが発生しました。すべて次のことを繰り返しているようです。

QuantLib/quantlib_wrap.cpp:5640:   instantiated from ‘static int swig::traits_asptr<std::vector<T, std::allocator<_CharT> > >::asptr(PyObject*, std::vector<T, std::allocator<_CharT> >**) [with T = boost::shared_ptr<QuantLib::Quote>]’

QuantLib/quantlib_wrap.cpp:4663:   instantiated from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >]’

QuantLib/quantlib_wrap.cpp:43476:   instantiated from here
/opt/local/include/boost/assign/assignment_exception.hpp:24: error: ‘boost::assign’ is not a function,

QuantLib/quantlib_wrap.cpp:5558: error:   conflict with ‘template<class SwigPySeq, class Seq> void swig::assign(const SwigPySeq&, Seq*)’

QuantLib/quantlib_wrap.cpp:5585: error:   in call to ‘assign’

/opt/local/include/boost/assign/assignment_exception.hpp: In static member function ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, Seq**) [with Seq = std::vector<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >, std::allocator<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > > > >, T = std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >]’:

QuantLib/quantlib_wrap.cpp:5640:   instantiated from ‘static int swig::traits_asptr<std::vector<T, std::allocator<_CharT> > >::asptr(PyObject*, std::vector<T, std::allocator<_CharT> >**) [with T = std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >]’

QuantLib/quantlib_wrap.cpp:4663:   instantiated from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > >, std::allocator<std::vector<boost::shared_ptr<QuantLib::Quote>, std::allocator<boost::shared_ptr<QuantLib::Quote> > > > >]’

QuantLib/quantlib_wrap.cpp:45813:   instantiated from here

/opt/local/include/boost/assign/assignment_exception.hpp:24: error: ‘boost::assign’ is not a function,

QuantLib/quantlib_wrap.cpp:5558: error:   conflict with ‘template<class SwigPySeq, class Seq> void swig::assign(const SwigPySeq&, Seq*)’

QuantLib/quantlib_wrap.cpp:5585: error:   in call to ‘assign’
/opt/local/include/boost/assign/assignment_exception.hpp: In static member function ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, Seq**) [with Seq = std::vector<boost::shared_ptr<QuantLib::StochasticProcess>, std::allocator<boost::shared_ptr<QuantLib::StochasticProcess> > >, T = boost::shared_ptr<QuantLib::StochasticProcess>]’:

QuantLib/quantlib_wrap.cpp:5640:   instantiated from ‘static int swig::traits_asptr<std::vector<T, std::allocator<_CharT> > >::asptr(PyObject*, std::vector<T, std::allocator<_CharT> >**) [with T = boost::shared_ptr<QuantLib::StochasticProcess>]’

QuantLib/quantlib_wrap.cpp:4663:   instantiated from ‘int swig::asptr(PyObject*, Type**) [with Type = std::vector<boost::shared_ptr<QuantLib::StochasticProcess>, std::allocator<boost::shared_ptr<QuantLib::StochasticProcess> > >]’

QuantLib/quantlib_wrap.cpp:124772:   instantiated from here
/opt/local/include/boost/assign/assignment_exception.hpp:24: error: ‘boost::assign’ is not a function,

QuantLib/quantlib_wrap.cpp:5558: error:   conflict with ‘template<class SwigPySeq, class Seq> void swig::assign(const SwigPySeq&, Seq*)’

QuantLib/quantlib_wrap.cpp:5585: error:   in call to ‘assign’

SWIG と Quantlib-SWIG のいくつかのバージョンを試してみましたが、うまくいかなかったようです。SWIG 3.0.6 と 3.0.2 を試しました。Quantlib-SWIG 1.5 および 1.6。Quantlib のバージョンは 1.6 で、macports からインストールしたのでブーストは最新のはずです。

不足しているものはありますか?

4

1 に答える 1

0

名前空間が指定されていない問題のようです。名前空間を追加した後、正しくコンパイルされました。

于 2015-09-15T02:57:49.747 に答える