eddelbuettel / rquantlib

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

QL_PACKAGE_VERSION does not exist when quantlib was built with cmake instead of autotools #180

Closed jeroen closed 9 months ago

jeroen commented 9 months ago

I see:

utils.cpp:651:24: error: use of undeclared identifier 'QL_PACKAGE_VERSION'
  651 |     return std::string(QL_PACKAGE_VERSION);
      |                        ^
1 warning and 1 error generated.

It turns out when quantlib is built with cmake instead of autotools, the include/ql/config.hpp looks like so:

#ifndef quantlib_config_h
#define quantlib_config_h

#define PACKAGE_NAME "QuantLib"
#define PACKAGE_STRING "QuantLib 1.32.0"
#define PACKAGE_TARNAME "QuantLib-1.32.0"
#define PACKAGE_VERSION "1.32.0"
#define PACKAGE_BUGREPORT "https://github.com/lballabio/QuantLib/issues/"
eddelbuettel commented 9 months ago

How irritating. Should we add another define / alias ? Or I guess I can handle it in utils.cpp conditionally.

jeroen commented 9 months ago

That PR fixes it already

eddelbuettel commented 9 months ago

Yes that (sub-aspect too) is perfect.