|
From: Luigi B. <lui...@gm...> - 2020-09-23 11:02:09
|
Hello,
the SWIG wrappers are not yet updated to use std pointers (there's a PR
for that on GitHub, but it's not merged).
For the time being, please run configure without --enable-std-classes and
recompile QuantLib.
Luigi
On Mon, Sep 21, 2020 at 11:57 PM Yoshiro Ozawa <yos...@ma...>
wrote:
> Hello,
>
> I am very sorry if this post appears twice, I was not subscribed to the
> list when I posted first.
>
> I have successfully built QuantLib 1.18 on Ubuntu.
>
> Following were my commands when building QL
>
> ./configure CXXFLAGS="-std=c++17 -g -O2 -Wno-deprecated-declarations"
> --enable-shared=no \
> --enable-static=yes \
> --enable-error-lines \
> --enable-error-functions \
> --enable-thread-safe-observer-pattern \
> --enable-std-classes
>
> sudo make -j4
> sudo make install
> sudo ldconfig
>
> After this, I downloaded Quantlib-SWIG tar and tried following
>
> ./configure
> --with-jdk-include=${JAVA_HOME}/include \
> --with-jdk-system-include=${JAVA_HOME}/include/linux \
> --disable-python \
> --disable-csharp \
> --disable-r \
> --disable-scala
>
> make -C Java
>
> I get errors building as follows
>
> ======================================
>
> /usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate
> expects 1 argument, 3 provided
> /usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate:
> ‘QuantLib::Swaption::Swaption(QuantLib::Swaption&&)’
> /usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate
> expects 1 argument, 3 provided
> quantlib_wrap.cpp: In function ‘jlong
> Java_org_quantlib_QuantLibJNI_new_1Swaption_1_1SWIG_12(JNIEnv*, jclass,
> jlong, jobject, jlong, jobject)’:
> quantlib_wrap.cpp:287193:133: error: no matching function for call to
> ‘QuantLib::Swaption::Swaption(const
> boost::shared_ptr<QuantLib::VanillaSwap>&, const
> boost::shared_ptr<QuantLib::Exercise>&)’
> 287193 | result = (Swaption *)new Swaption((boost::shared_ptr<
> VanillaSwap > const &)*arg1,(boost::shared_ptr< Exercise > const &)*arg2);
> |
> ^
> In file included from
> /usr/local/include/ql/experimental/basismodels/swaptioncfs.hpp:27,
> from
> /usr/local/include/ql/experimental/basismodels/all.hpp:4,
> from /usr/local/include/ql/experimental/all.hpp:7,
> from /usr/local/include/ql/quantlib.hpp:46,
> from quantlib_wrap.cpp:808:
> /usr/local/include/ql/instruments/swaption.hpp:85:9: note: candidate:
> ‘QuantLib::Swaption::Swaption(const
> std::shared_ptr<QuantLib::VanillaSwap>&, const
> std::shared_ptr<QuantLib::Exercise>&, QuantLib::Settlement::Type,
> QuantLib::Settlement::Method)’
> 85 | Swaption(const ext::shared_ptr<VanillaSwap>& swap,
> | ^~~~~~~~
> /usr/local/include/ql/instruments/swaption.hpp:85:54: note: no known
> conversion for argument 1 from ‘const
> boost::shared_ptr<QuantLib::VanillaSwap>’ to ‘const
> std::shared_ptr<QuantLib::VanillaSwap>&’
> 85 | Swaption(const ext::shared_ptr<VanillaSwap>& swap,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> /usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate:
> ‘QuantLib::Swaption::Swaption(const QuantLib::Swaption&)’
> 81 | class Swaption : public Option {
> | ^~~~~~~~
> ========================================
>
> quantlib_wrap.cpp: In function ‘jlong
> Java_org_quantlib_QuantLibJNI_new_1FloatFloatSwaption_1_1SWIG_10(JNIEnv*,
> jclass, jlong, jobject, jlong, jobject, jint, jint)’:
> quantlib_wrap.cpp:288061:166: error: no matching function for call to
> ‘QuantLib::FloatFloatSwaption::FloatFloatSwaption(const
> boost::shared_ptr<QuantLib::FloatFloatSwap>&, const
> boost::shared_ptr<QuantLib::Exercise>&, QuantLib::Settlement::Type&,
> QuantLib::Settlement::Method&)’
> 288061 | result = (FloatFloatSwaption *)new
> FloatFloatSwaption((boost::shared_ptr< FloatFloatSwap > const
> &)*arg1,(boost::shared_ptr< Exercise > const &)*arg2,arg3,arg4);
> |
> ^
> In file included from /usr/local/include/ql/instruments/all.hpp:26,
> from /usr/local/include/ql/quantlib.hpp:48,
> from quantlib_wrap.cpp:808:
> /usr/local/include/ql/instruments/floatfloatswaption.hpp:45:9: note:
> candidate: ‘QuantLib::FloatFloatSwaption::FloatFloatSwaption(const
> std::shared_ptr<QuantLib::FloatFloatSwap>&, const
> std::shared_ptr<QuantLib::Exercise>&, QuantLib::Settlement::Type,
> QuantLib::Settlement::Method)’
> 45 | FloatFloatSwaption(
> | ^~~~~~~~~~~~~~~~~~
> /usr/local/include/ql/instruments/floatfloatswaption.hpp:46:52: note: no
> known conversion for argument 1 from ‘const
> boost::shared_ptr<QuantLib::FloatFloatSwap>’ to ‘const
> std::shared_ptr<QuantLib::FloatFloatSwap>&’
> 46 | const ext::shared_ptr<FloatFloatSwap>& swap,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> /usr/local/include/ql/instruments/floatfloatswaption.hpp:41:11: note:
> candidate: ‘QuantLib::FloatFloatSwaption::FloatFloatSwaption(const
> QuantLib::FloatFloatSwaption&)’
> ===========================================
>
> I suspect that this has something to do with boost shared pointers vs
> standard pointers in c++ 11 and above.
>
> I also tried passing in
> CXXFLAGS="-std=c++17 -g -O2 -Wno-deprecated-declarations"
> for configure for SWIG build, however, I got the same errors.
>
> Has anyone seen this issue before?
>
> Any help is much appreciated.
>
> Thank you very much,
> Yoshiro
> Osaka,Japan
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|