boostorg / multiprecision

Boost.Multiprecision
Boost Software License 1.0
188 stars 112 forks source link

cpp_bin_float requires quadmath? #598

Closed NAThompson closed 5 months ago

NAThompson commented 5 months ago

In this build, we observe the following error:

In file included from condition_number_test.cpp:10:
../../../boost/multiprecision/cpp_bin_float.hpp: In instantiation of ‘typename std::enable_if<(std::is_same<Float, __float128>::value && (std::numeric_limits<Type>::digits <= Digits)), boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent>&>::type boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent>::assign_float(Float) [with Float = __float128; unsigned int Digits = 113; boost::multiprecision::backends::digit_base_type DigitBase = boost::multiprecision::backends::digit_base_10; Allocator = void; Exponent = int; Exponent MinExponent = 0; Exponent MaxExponent = 0; typename std::enable_if<(std::is_same<Float, __float128>::value && (std::numeric_limits<Type>::digits <= Digits)), boost::multiprecision::backends::cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent>&>::type = boost::multiprecision::backends::cpp_bin_float<113, boost::multiprecision::backends::digit_base_10, void, int, 0, 0>&]’:
...
/cygdrive/d/a/math/boost-root/libs/math/test/../../../boost/multiprecision/cpp_bin_float.hpp:316:(.text$_ZN5boost14multiprecision8backends13cpp_bin_floatILj113ELNS1_15digit_base_typeE10EviLi0ELi0EE12assign_floatIgEENSt9enable_ifIXaasrSt7is_sameIT_gE5valuelesrSt14numeric_limitsIS8_E6digitsLj113EERS4_E4typeES8_[_ZN5boost14multiprecision8backends13cpp_bin_floatILj113ELNS1_15digit_base_typeE10EviLi0ELi0EE12assign_floatIgEENSt9enable_ifIXaasrSt7is_sameIT_gE5valuelesrSt14numeric_limitsIS8_E6digitsLj113EERS4_E4typeES8_]+0x83): undefined reference to `signbitq'

My understanding was that cpp_bin_float did not require use of the quadmath library; is this understanding correct?

jzmaddock commented 5 months ago

My understanding was that cpp_bin_float did not require use of the quadmath library; is this understanding correct?

It doesn't in itself, but conversion to and from a __float128 does require libquadmath. And there are some things in Math that will use __float128 quad precision literals when using cpp_bin_float_quad specifically.