I have c++ source file, example.cpp, using some boost::math functions.
My boost library is also built.
To disable long double in boost::math, I did the following:
g++ -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS example.cpp -I<boost_header> -L<boost.*.so>
My question is whether do I need to rebuild boost library with -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS? Or, in other words, did the boost library differ with and without macro BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS?
Yes, there might be a difference. However, in practice, there will usually not be:
Boot Math docs: Building a Library
Since tr1.hpp does in fact use the
BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONSmacro, so yes there will probably be a relevant difference.In fact from a quick scan it looks like auto-linking (on MSVC) is only caused when the preprocessor condition is not defined. Which implies that building the library is completely unnecessary when the symbol is defined. Try not linking to the library to check that assumption:
Post Scriptum
The only use of the define in libs/math/src is in
boost_nexttowardandboost_nexttowardf.So unless you use these, there should be no issue.
In all of Boost 1.77 the only libraries that mention these
boost/math/tr1.hppare Multiprecision and Units - but it looks like they took great care to NOT expand macros and never explicitly call theboost_*symbols.All in all, you're only looking for direct calls to
[boost_]nexttoward[f]in your own code.