lballabio / QuantLib

The QuantLib C++ library
http://quantlib.org
Other
5.26k stars 1.78k forks source link

Autotools and CMake builds produce different config.hpp #1988

Closed tomwhoiscontrary closed 3 months ago

tomwhoiscontrary commented 3 months ago

If i build like this:

./autogen.sh
./configure --enable-std-classes --enable-indexed-coupons --enable-error-lines
make
make install

And this:

cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D QL_USE_STD_CLASSES=ON -D QL_USE_INDEXED_COUPON=ON -D QL_ERROR_LINES=ON
make
make install

Then i get quite different contents in ql/config.hpp - see attached. In particular, they define feature flags in different ways; autotools has:

#define QL_USE_STD_SHARED_PTR 1

And CMake has:

#define QL_USE_STD_SHARED_PTR

I noticed this because i can use the former in a static_assert, but not the latter.

But really, they are very different files.

Is this intentional?

config.autotools.hpp.txt config.cmake.hpp.txt

lballabio commented 3 months ago

I don't think it was intentional — the config.hpp from the autotools was the original one and the one from cmake came much later as an attempt to provide the same configuration options. I'll have to check if the cmake version can be brought in sync.

lballabio commented 3 months ago

It should be fixed by #1993.