Opened 5 years ago
Closed 5 years ago
#13508 closed Bugs (fixed)
Errors compiling float128.h on windows with icc 17.0 and MSVC 14.11 toolchain
| Reported by: | Owned by: | John Maddock | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | multiprecision |
| Version: | Boost 1.66.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
The example code from the help here https://www.boost.org/doc/libs/1_66_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/float128.html cannot be compiled on windows using intel compiler version 17.0.6 and MSVC v14.11 toolchain. The errors reported are:
1>G:\Libraries\boost_1_66_0\boost/multiprecision/float128.hpp(487): error : identifier "fmaq" is undefined 1> result.value() = fmaq(a.value(), b.value(), c.value()); 1> ^ 1> 1>G:\Libraries\boost_1_66_0\boost/multiprecision/float128.hpp(492): error : the global scope has no "signbitq" 1> return ::signbitq(arg.value()); 1> ^ 1> 1>G:\Libraries\boost_1_66_0\boost/multiprecision/float128.hpp(556): error : the global scope has no "copysignq" 1> return ::copysignq(a.backend().value(), b.backend().value()); 1> ^ 1> 1>G:\Libraries\boost_1_66_0\boost/multiprecision/float128.hpp(561): error : identifier "remainderq" is undefined 1> result.value() = remainderq(a.value(), b.value()); 1> ^ 1> 1>G:\Libraries\boost_1_66_0\boost/multiprecision/float128.hpp(565): error : identifier "remquoq" is undefined 1> result.value() = remquoq(a.value(), b.value(), pi); 1> ^
Please note that newer MSVC toolchain versions seem to break the intel compiler (and the default version for MS2017 is newer), while for icc 18.0 one needs to remove -Za or the /permissive- options as they also need to problems with the compilation.
Change History (3)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Hi,
yes, I can confirm that the patch fixes the errors I was seeing. (side note, in the spirit of full transparency, I couldn't get git to apply the patch, almost sure it is because of copying from the web to a file and windows messing the line endings. The four inclusions were done by hand)
Thanks a lot.
Best,

Unfortunately, that configuration has dropped off our testing radar... can you tell me if the patch below fixes things?
include/boost/multiprecision/float128.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/multiprecision/float128.hpp b/include/boost/multiprecision/float128.hpp index a729523..095634f 100644 --- a/include/boost/multiprecision/float128.hpp +++ b/include/boost/multiprecision/float128.hpp @@ -482,15 +482,16 @@ inline void eval_atan2(float128_backend& result, const float128_backend& a, cons { result.value() = atan2q(a.value(), b.value()); } +#ifndef BOOST_MP_USE_QUAD inline void eval_multiply_add(float128_backend& result, const float128_backend& a, const float128_backend& b, const float128_backend& c) { result.value() = fmaq(a.value(), b.value(), c.value()); } - inline int eval_signbit BOOST_PREVENT_MACRO_SUBSTITUTION(const float128_backend& arg) { return ::signbitq(arg.value()); } +#endif inline std::size_t hash_value(const float128_backend& val) { @@ -550,6 +551,7 @@ inline std::size_t hash_value(const float128_backend& val) return log1pq(arg.backend().value()); } +#ifndef BOOST_MP_USE_QUAD template <multiprecision::expression_template_option ExpressionTemplates> inline boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates> copysign BOOST_PREVENT_MACRO_SUBSTITUTION(const boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates>& a, const boost::multiprecision::number<boost::multiprecision::backends::float128_backend, ExpressionTemplates>& b) { @@ -564,6 +566,7 @@ inline std::size_t hash_value(const float128_backend& val) { result.value() = remquoq(a.value(), b.value(), pi); } +#endif } // namespace multiprecision