3

I have installed boost_1_54 on windows by checkout from svn and then

bootstrap
.\b2

QuantLib library dependent on boost compiles well all but one project: test-suite which uses BOOST_MESSAGE. this is undefined. I can see that there is no BOOST_MESSAGE in my version of boost. Therefore is this QuantLib incompatibility or have I missed something? On my linux boost version the same thing applies to BOOST_MESSAGE - it is undefined

I have seen this but I am not sure how to interpret this.

4pie0
  • 29,204
  • 9
  • 82
  • 118
  • 2
    Do you know how deprecation works? It tells you: "Okay, we decided this way was bad and it's not really part of this library anymore. However, because we're nice we let you transition to the new stuff over a few releases, then it'll be gone for good." This is what happened to `BOOST_MESSAGE`. You might get away with a `#define BOOST_MESSAGE(msg) BOOST_TEST_MESSAGE(msg)` before including the QuantLib headers, though. – Xeo Mar 04 '13 at 01:54
  • thank you, but do you really think a brand new version of QuantLib downloaded via svn, which is built certainly everyday by it's developers has this bug and each user is forced do #define BOOST_MESSAGE(msg) BOOST_TEST_MESSAGE(msg) on it's own? It is possible though not sure, so better ask. I believe something else happend here – 4pie0 Mar 04 '13 at 08:33
  • Well, I don't think they also build Boost from svn source, as that would put a huge limit on the users of the library. It's a bit of a stretch to assume that libraries always stay on top of their dependencies, to be honest. – Xeo Mar 04 '13 at 08:35
  • this question is marked quantlib, because it is quantlib related, I am not sure if you explained deprecation to assure yourself or for other reasons but this question is rather for users of quantlib, not for those who "think" how it works – 4pie0 Mar 04 '13 at 08:45
  • And how does quantlib matter in any way to how Boost deprecates its stuff? – Xeo Mar 04 '13 at 09:07

3 Answers3

9

I'm afraid you gave us more credit than we deserved :)

We haven't compiled QuantLib against Boost svn yet. The latest I've tried is Boost 1.53 (the latest released version) in which BOOST_MESSAGE was still available.

Thanks for the heads-up, though. I'll patch the library so that it's ready for next version. As mentioned in the comments, it should be as simple as adding

#if BOOST_VERSION > 105300
#define BOOST_MESSAGE(msg) BOOST_TEST_MESSAGE(msg)
#endif

to test-suite/utilities.hpp.

Luigi Ballabio
  • 4,128
  • 21
  • 29
  • Hi Luigi, thanks for the answer, I have posted to quantlib-dev list too. BOOST_TEST_MESSAGE is undefined too, but I am still searching – 4pie0 Mar 04 '13 at 10:11
  • and there are more things: BOOST_ERROR, BOOST_CHECK, also ambiguities regarding const void*=&boost::test_tools::check_is_close – 4pie0 Mar 04 '13 at 10:16
  • I see. For the time being, I suggest sticking with Boost 1.53. – Luigi Ballabio Mar 04 '13 at 10:30
0

on linux I had to add

libboost_unit_test_framework.so

to the Linker->Libraries and

#include <boost/test/unit_test.hpp>

#define BOOST_MESSAGE( M )                  BOOST_TEST_MESSAGE( M )

is already present in test/test_tools.hpp. on windows I have different #defines and this is not present, so I added it to the

unit_test_log.hpp

where BOOST_TEST_MESSAGE is defined (in boost files to avoid same issue again in the case of other applications using BOOST_MESSAGE). BOOST_MESSAGE issue resolved but still can't disambiguate

const void* = boost::test_tools::check_is_close

and

const void* = boost::test_tools::check_is_small

because these are templates. so the solution is to remove it (test-suite compiles well) or use appropriate pointers to function templates

4pie0
  • 29,204
  • 9
  • 82
  • 118
0

on Windows, after romoval or function

_use_check

in utilities.hpp

changed to not have pointers to TEMPLATE functions as default, so changed to:

void _use_check(
                        const void*,
                        const void*) const {}

there were still errors while building test-suite project. unresolved externals: fdmhestonfwdop, fdmblackscholesfwdop, fdmsquarerootfwdop. obviously this classes (headers+source) I had to add to Quantlib project, build library QuantLib-vc110-mt-gd.lib again and rebuild test-suite project then. after pleasure with VS linker error "lnk1210 exceeded internal ilk size limit link with incremental no" (it really likes RAM, but on windows I have this resource quite limited), it is OK. compiled. : p

4pie0
  • 29,204
  • 9
  • 82
  • 118