|
From: Yoshiro O. <yos...@ma...> - 2020-09-21 21:54:45
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hello,</div>
<div> </div>
<div>I am very sorry if this post appears twice, I was not subscribed to the list when I posted first.</div>
<div> </div>
<div>I have successfully built QuantLib 1.18 on Ubuntu.</div>
<div><br/>
Following were my commands when building QL</div>
<div> </div>
<div>./configure CXXFLAGS="-std=c++17 -g -O2 -Wno-deprecated-declarations" --enable-shared=no \<br/>
--enable-static=yes \<br/>
--enable-error-lines \<br/>
--enable-error-functions \<br/>
--enable-thread-safe-observer-pattern \<br/>
--enable-std-classes</div>
<div> </div>
<div>sudo make -j4<br/>
sudo make install<br/>
sudo ldconfig</div>
<div> </div>
<div>After this, I downloaded Quantlib-SWIG tar and tried following </div>
<div> </div>
<div>./configure <br/>
--with-jdk-include=${JAVA_HOME}/include \<br/>
--with-jdk-system-include=${JAVA_HOME}/include/linux \<br/>
--disable-python \<br/>
--disable-csharp \<br/>
--disable-r \<br/>
--disable-scala</div>
<div> </div>
<div>make -C Java</div>
<div> </div>
<div>I get errors building as follows</div>
<div> </div>
<div>======================================</div>
<div> </div>
<div>/usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate expects 1 argument, 3 provided<br/>
/usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate: ‘QuantLib::Swaption::Swaption(QuantLib::Swaption&&)’<br/>
/usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate expects 1 argument, 3 provided<br/>
quantlib_wrap.cpp: In function ‘jlong Java_org_quantlib_QuantLibJNI_new_1Swaption_1_1SWIG_12(JNIEnv*, jclass, jlong, jobject, jlong, jobject)’:<br/>
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>&)’<br/>
287193 | result = (Swaption *)new Swaption((boost::shared_ptr< VanillaSwap > const &)*arg1,(boost::shared_ptr< Exercise > const &)*arg2);<br/>
| ^<br/>
In file included from /usr/local/include/ql/experimental/basismodels/swaptioncfs.hpp:27,<br/>
from /usr/local/include/ql/experimental/basismodels/all.hpp:4,<br/>
from /usr/local/include/ql/experimental/all.hpp:7,<br/>
from /usr/local/include/ql/quantlib.hpp:46,<br/>
from quantlib_wrap.cpp:808:<br/>
/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)’<br/>
85 | Swaption(const ext::shared_ptr<VanillaSwap>& swap,<br/>
| ^~~~~~~~<br/>
/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>&’<br/>
85 | Swaption(const ext::shared_ptr<VanillaSwap>& swap,<br/>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~<br/>
/usr/local/include/ql/instruments/swaption.hpp:81:11: note: candidate: ‘QuantLib::Swaption::Swaption(const QuantLib::Swaption&)’<br/>
81 | class Swaption : public Option {<br/>
| ^~~~~~~~<br/>
========================================</div>
<div> </div>
<div>quantlib_wrap.cpp: In function ‘jlong Java_org_quantlib_QuantLibJNI_new_1FloatFloatSwaption_1_1SWIG_10(JNIEnv*, jclass, jlong, jobject, jlong, jobject, jint, jint)’:<br/>
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&)’<br/>
288061 | result = (FloatFloatSwaption *)new FloatFloatSwaption((boost::shared_ptr< FloatFloatSwap > const &)*arg1,(boost::shared_ptr< Exercise > const &)*arg2,arg3,arg4);<br/>
| ^<br/>
In file included from /usr/local/include/ql/instruments/all.hpp:26,<br/>
from /usr/local/include/ql/quantlib.hpp:48,<br/>
from quantlib_wrap.cpp:808:<br/>
/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)’<br/>
45 | FloatFloatSwaption(<br/>
| ^~~~~~~~~~~~~~~~~~<br/>
/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>&’<br/>
46 | const ext::shared_ptr<FloatFloatSwap>& swap,<br/>
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~<br/>
/usr/local/include/ql/instruments/floatfloatswaption.hpp:41:11: note: candidate: ‘QuantLib::FloatFloatSwaption::FloatFloatSwaption(const QuantLib::FloatFloatSwaption&)’</div>
<div>===========================================</div>
<div> </div>
<div>I suspect that this has something to do with boost shared pointers vs standard pointers in c++ 11 and above.</div>
<div><br/>
I also tried passing in <br/>
CXXFLAGS="-std=c++17 -g -O2 -Wno-deprecated-declarations" <br/>
for configure for SWIG build, however, I got the same errors.</div>
<div> </div>
<div>Has anyone seen this issue before?</div>
<div><br/>
Any help is much appreciated.</div>
<div> </div>
<div>Thank you very much,<br/>
Yoshiro<br/>
Osaka,Japan</div>
</div></div></body></html>
|