Open ds283 opened 4 years ago
Probably relevant: https://github.com/boostorg/multiprecision/issues/159
I eventually had time to look into this. I believe I understand the issue, but having got to the key point it turned out the problem had already been written up at the other odeint-v2 repository belonging to boost.org:
https://github.com/boostorg/odeint/issues/40
To summarise the outcome of the ticket linked above, it is commit https://github.com/boostorg/multiprecision/commit/2f1cb020b08a1fbd0b8ea6ec26ff2928b3c7842a that is to blame. The problem is that the boost::multiprecision::number::value_type
member type it introduces resolves to boost::multiprecision::number
for non-complex types, setting up an infinite recursion in the odeint-v2 metafunction extract_value_type<>
.
I've confirmed that my codes build correctly with the immediately-prior commit https://github.com/boostorg/multiprecision/commit/339085567bcc3911b0c194bf5afc13f60c388831 but fail with https://github.com/boostorg/multiprecision/commit/2f1cb020b08a1fbd0b8ea6ec26ff2928b3c7842a itself. For now, this means the workaround is to revert to commit https://github.com/boostorg/multiprecision/commit/339085567bcc3911b0c194bf5afc13f60c388831 of Boost::Multiprecision
(or earlier).
To make progress we probably need some input from the maintainers as to how they wish to modify extract_value_type<>
to avoid this infinite loop.
Summary
For some years I have been successfully using odeint-v2 and boost::multiprecision for extended-precision arithmetic.
Recently MacPorts upgraded their version of Boost from 1.66 to 1.70. Since this happened, code using
boost::find_if
in conjunction with aboost::multiprecision
state type will no longer compile.I've attached a minimal example exhibiting the error, which is the standard
find_crossing.cpp
example generalised to useboost::multiprecision::cpp_dec_float_50
.The same error occurs using the mpfr library as the backend to
boost::multiprecision::number
, which is the arrangement used in my production code. Also, in production we are using odeint-v2 obtained direct from this GitHub repository at commit hash db8b39ae rather than the version bundled with Boost 1.70. None of these details seem to make a difference.On compilation the example attached above gives
Backtrace details
As far as I can tell, this is the error I am encountering in production code. Most of the template backtrace is identical:
In my production code I have a slightly longer backtrace that includes
From the line
iterator_core_access::increment(this->derived());
the backtraces agree.Issue occurs with multiple compilers
I've checked that I encounter the error with both Apple Clang
and the Intel compiler