eddelbuettel / rquantlib

R interface to the QuantLib library
120 stars 50 forks source link

Doesn't compile with quantlib 1.35rc #187

Closed Kupac closed 4 months ago

Kupac commented 4 months ago

I was testing reverse deps of the upcoming release of quantlib, and RQuantLib seems to use some functions that are no longer present in the new release. Let me know if this should be fixed in quantlib itself, or here. Relevant logs below, full log here


vanilla.cpp:90:124: error: no matching function for call to 'QuantLib::AnalyticDividendEuropeanEngine::AnalyticDividendEuropeanEngine(boost::shared_ptr<QuantLib::BlackScholesMertonProcess>&)'
   90 |         QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engine(new QuantLib::AnalyticDividendEuropeanEngine(stochProcess));
      |                                                                                                                            ^
In file included from /nix/store/h9awq1sk4qmds3bwy6zxxyxv5i5xv8ry-quantlib-1.35rc-dev/include/ql/pricingengines/vanilla/all.hpp:6:
/nix/store/h9awq1sk4qmds3bwy6zxxyxv5i5xv8ry-quantlib-1.35rc-dev/include/ql/pricingengines/vanilla/analyticdividendeuropeanengine.hpp:40:9: note: candidate: 'QuantLib::AnalyticDividendEuropeanEngine::AnalyticDividendEuropeanEngine(boost::shared_ptr<QuantLib::GeneralizedBlackScholesProcess>, QuantLib::DividendSchedule)'
   40 |         AnalyticDividendEuropeanEngine(ext::shared_ptr<GeneralizedBlackScholesProcess> process,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/h9awq1sk4qmds3bwy6zxxyxv5i5xv8ry-quantlib-1.35rc-dev/include/ql/pricingengines/vanilla/analyticdividendeuropeanengine.hpp:40:9: note:   candidate expects 2 arguments, 1 provided
/nix/store/h9awq1sk4qmds3bwy6zxxyxv5i5xv8ry-quantlib-1.35rc-dev/include/ql/pricingengines/vanilla/analyticdividendeuropeanengine.hpp:38:11: note: candidate: 'QuantLib::AnalyticDividendEuropeanEngine::AnalyticDividendEuropeanEngine(const QuantLib::AnalyticDividendEuropeanEngine&)'
   38 |     class AnalyticDividendEuropeanEngine : public VanillaOption::engine {
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/h9awq1sk4qmds3bwy6zxxyxv5i5xv8ry-quantlib-1.35rc-dev/include/ql/pricingengines/vanilla/analyticdividendeuropeanengine.hpp:38:11: note:   no known conversion for argument 1 from 'boost::shared_ptr<QuantLib::BlackScholesMertonProcess>' to 'const QuantLib::AnalyticDividendEuropeanEngine&'
/nix/store/h9awq1sk4qmds3bwy6zxxyxv5i5xv8ry-quantlib-1.35rc-dev/include/ql/pricingengines/vanilla/analyticdividendeuropeanengine.hpp:38:11: note: candidate: 'QuantLib::AnalyticDividendEuropeanEngine::AnalyticDividendEuropeanEngine(QuantLib::AnalyticDividendEuropeanEngine&&)'
/nix/store/h9awq1sk4qmds3bwy6zxxyxv5i5xv8ry-quantlib-1.35rc-dev/include/ql/pricingengines/vanilla/analyticdividendeuropeanengine.hpp:38:11: note:   no known conversion for argument 1 from 'boost::shared_ptr<QuantLib::BlackScholesMertonProcess>' to 'QuantLib::AnalyticDividendEuropeanEngine&&'
vanilla.cpp:93:19: error: 'DividendVanillaOption' is not a member of 'QuantLib'; did you mean 'ForwardVanillaOption'?
   93 |         QuantLib::DividendVanillaOption option(payoff, exercise, discDivDates, discDividends);
      |                   ^~~~~~~~~~~~~~~~~~~~~
      |                   ForwardVanillaOption
vanilla.cpp:95:9: error: 'option' was not declared in this scope; did you mean 'optind'?
   95 |         option.setPricingEngine(engine);
      |         ^~~~~~
      |         optind
vanilla.cpp: In function 'Rcpp::List americanOptionEngine(std::string, double, double, double, double, double, double, int, int, std::string, Rcpp::Nullable<Rcpp::Vector<14, Rcpp::PreserveStorage> >, Rcpp::Nullable<Rcpp::Vector<14, Rcpp::PreserveStorage> >)':
vanilla.cpp:189:19: error: 'DividendVanillaOption' is not a member of 'QuantLib'; did you mean 'ForwardVanillaOption'?
  189 |         QuantLib::DividendVanillaOption option(payoff, exercise, discDivDates, discDividends);
      |                   ^~~~~~~~~~~~~~~~~~~~~
      |                   ForwardVanillaOption
vanilla.cpp:200:13: error: 'option' was not declared in this scope; did you mean 'optind'?
  200 |             option.setPricingEngine(fdcnengine);
      |             ^~~~~~
      |             optind
make: *** [/nix/store/35ws8rzvrjhg9vr1sv05kh30401c25vw-R-4.4.1/lib/R/etc/Makeconf:204: vanilla.o] Error 1
make: *** Waiting for unfinished jobs....
ERROR: compilation failed for package 'RQuantLib'
* removing '/nix/store/wbg2zwjx0b78fwsg5b1rvj7y35w6g23z-r-RQuantLib-0.4.22/library/RQuantLib'
eddelbuettel commented 4 months ago

You are ahead of me. I prepare 1.35rc yesterday, and also prepared a local package for my use. Will check.

eddelbuettel commented 4 months ago

Can confirm. Will work on this over the next few days. Also note that 1.35 is not yet released either so it is not that urgent yet.

But appreciate the heads-up!

Kupac commented 4 months ago

Indeed, not that urgent. Thanks for the quick check!

eddelbuettel commented 4 months ago

I just committed a (tiny) change (required code was already in place, commented out) for vanilla.cpp; this now builds.

It still emits (new) deprecation warnings from another file, I will get to that in a day or two max.

eddelbuettel commented 4 months ago

And looks like I broke my own CI -- which I now fixed.

eddelbuettel commented 4 months ago

Closing this as it has been fixed in the main branch. Thanks again for the heads-up.