Quantlib 1.5 build

时间:2015-05-18 02:30:36

标签: c++ boost quantlib

在CentOS 7下,我正在使用

[idf@node2 QuantLib-1.5]$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC) 
[idf@node2 QuantLib-1.5]$ 

使用Boost.1_58,构建QL 1.5时出现以下错误

Making all in math
make[4]: Entering directory `/mnt/gluster/Downloads/QuantLib-1.5/ql/experimental/math'
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../ql  -I../../.. -I../../..   -g -O2 -MT convolvedstudentt.lo -MD -MP -MF .deps/convolvedstudentt.Tpo -c -o convolvedstudentt.lo convolvedstudentt.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../ql -I../../.. -I../../.. -g -O2 -MT convolvedstudentt.lo -MD -MP -MF .deps/convolvedstudentt.Tpo -c convolvedstudentt.cpp  -fPIC -DPIC -o .libs/convolvedstudentt.o
convolvedstudentt.cpp: In member function 'QuantLib::Real QuantLib::InverseCumulativeBehrensFisher::operator()(QuantLib::Probability) const':
convolvedstudentt.cpp:194:29: error: call of overloaded 'bind(QuantLib::Probability (QuantLib::CumulativeBehrensFisher::*)(QuantLib::Real) const, QuantLib::CumulativeBehrensFisher&, boost::arg<1>&)' is ambiguous
                 distrib_, _1)), accuracy_, (xMin+xMax)/2., xMin, xMax);
                             ^
convolvedstudentt.cpp:194:29: note: candidates are:
In file included from /usr/local/include/boost/bind.hpp:22:0,
                 from convolvedstudentt.cpp:30:
/usr/local/include/boost/bind/bind.hpp:1602:5: note: boost::_bi::bind_t<R, F, typename boost::_bi::list_av_2<A1, A2>::type> boost::bind(F, A1, A2) [with R = double; F = double (QuantLib::CumulativeBehrensFisher::*)(double) const; A1 = QuantLib::CumulativeBehrensFisher; A2 = boost::arg<1>; typename boost::_bi::list_av_2<A1, A2>::type = boost::_bi::list2<boost::_bi::value<QuantLib::CumulativeBehrensFisher>, boost::arg<1> >]
     BOOST_BIND(F f, A1 a1, A2 a2)
     ^
/usr/local/include/boost/bind/bind_mf_cc.hpp:74:5: note: boost::_bi::bind_t<R, boost::_mfi::cmf1<R, T, A1>, typename boost::_bi::list_av_2<A1, A2>::type> boost::bind(R (T::*)(B1) const, A1, A2) [with R = double; T = QuantLib::CumulativeBehrensFisher; B1 = double; A1 = QuantLib::CumulativeBehrensFisher; A2 = boost::arg<1>; typename boost::_bi::list_av_2<A1, A2>::type = boost::_bi::list2<boost::_bi::value<QuantLib::CumulativeBehrensFisher>, boost::arg<1> >]
     BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
     ^
/usr/local/include/boost/bind/bind_mf_cc.hpp:96:5: note: boost::_bi::bind_t<Rt2, boost::_mfi::cmf1<R, T, B1>, typename boost::_bi::list_av_2<A1, A2>::type> boost::bind(R (T::*)(B1) const, A1, A2) [with Rt2 = double; R = double; T = QuantLib::CumulativeBehrensFisher; B1 = double; A1 = QuantLib::CumulativeBehrensFisher; A2 = boost::arg<1>; typename boost::_bi::list_av_2<A1, A2>::type = boost::_bi::list2<boost::_bi::value<QuantLib::CumulativeBehrensFisher>, boost::arg<1> >]
     BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
     ^
make[4]: *** [convolvedstudentt.lo] Error 1
make[4]: Leaving directory `/mnt/gluster/Downloads/QuantLib-1.5/ql/experimental/math'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/mnt/gluster/Downloads/QuantLib-1.5/ql/experimental'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/mnt/gluster/Downloads/QuantLib-1.5/ql'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/mnt/gluster/Downloads/QuantLib-1.5/ql'
make: *** [all-recursive] Error 1
[idf@node2 QuantLib-1.5]$ 

[idf@node2 math]$ make
/bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../ql  -I../../.. -I../../..   -g -O2 -MT convolvedstudentt.lo -MD -MP -MF .deps/convolvedstudentt.Tpo -c -o convolvedstudentt.lo convolvedstudentt.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../ql -I../../.. -I../../.. -g -O2 -MT convolvedstudentt.lo -MD -MP -MF .deps/convolvedstudentt.Tpo -c convolvedstudentt.cpp  -fPIC -DPIC -o .libs/convolvedstudentt.o
convolvedstudentt.cpp: In member function 'QuantLib::Real QuantLib::InverseCumulativeBehrensFisher::operator()(QuantLib::Probability) const':
convolvedstudentt.cpp:194:54: error: wrong type argument to unary minus
 -                &CumulativeBehrensFisher::operator (),
                                                      ^
convolvedstudentt.cpp:196:53: error: wrong type argument to unary plus
 +                &CumulativeBehrensFisher::operator(),
                                                     ^
make: *** [convolvedstudentt.lo] Error 1
[idf@node2 math]$ 

1 个答案:

答案 0 :(得分:1)

请参阅quantlib users mailing list和一些最近的消息 - 简而言之,Boost 1.58(在QuantLib 1.5之后发布)会产生一些问题,因此您最好的猜测可能是坚持使用Boost 1.57。

另一方面,如果你想坚持使用Boost 1.58,请尝试this patch