Opened 8 years ago

Closed 8 years ago

#11160 closed Bugs (fixed)

failed to build Boost.Math library with cray compiler 8.3.6 on CLE5.2

Reported by: Alan Wild <alan@…> Owned by: John Maddock
Milestone: To Be Determined Component: math
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

This is quite similar to

https://svn.boost.org/trac/boost/ticket/10925

Error is as follows:

    CC -c -g -O0 -hgnu -fPIC -h system_alloc -h tolerant -h fp0 -static -DBOOST_ALL_NO_LIB=1 -I"." -I"libs/math/src/tr1" -o "/dev/shm/build-boost-tmp-cce_8.3.6/boost/bin.v2/libs/math/build/cray/debug/boost.locale.icu-off/link-static/runtime-link-static/assoc_legendre.o" "libs/math/build/../src/tr1/assoc_legendre.cpp"

CC-70 crayc++: ERROR File = /dev/shm/boost_1_57_0/./boost/math/cstdfloat/cstdfloat_types.hpp, Line = 350
  The indicated type is incomplete.

        BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::is_iec559    == true, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
        ^

CC-70 crayc++: ERROR File = /dev/shm/boost_1_57_0/./boost/math/cstdfloat/cstdfloat_types.hpp, Line = 364
  The indicated type is incomplete.

        BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::is_iec559    == true, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");

I am getting around it for the time being with the following patch:

--- boost_1_57_0/boost/math/cstdfloat/cstdfloat_types.hpp       2014-10-30 06:35:53.000000000 -0500
+++ boost_1_57_0.xom/boost/math/cstdfloat/cstdfloat_types.hpp   2015-03-30 14:58:00.000000000 -0500
@@ -347,7 +347,13 @@
       typedef boost::float32_t float_fast32_t;
       typedef boost::float32_t float_least32_t;

+    #if defined(_CRAYC)
+      BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::has_infinity      == true, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+      BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::has_quiet_NaN     == true, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+      BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::has_signaling_NaN == true, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+    #else
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::is_iec559    == true, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+    #endif
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::radix        ==    2, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::digits       ==   24, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float32_t>::max_exponent ==  128, "boost::float32_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
@@ -361,7 +367,13 @@
       typedef boost::float64_t float_fast64_t;
       typedef boost::float64_t float_least64_t;

+    #if defined(_CRAYC)
+      BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::has_infinity      == true, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+      BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::has_quiet_NaN     == true, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+      BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::has_signaling_NaN == true, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+    #else
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::is_iec559    == true, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
+    #endif
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::radix        ==    2, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::digits       ==   53, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");
       BOOST_STATIC_ASSERT_MSG(std::numeric_limits<boost::float64_t>::max_exponent == 1024, "boost::float64_t has been detected in <boost/cstdfloat>, but verification with std::numeric_limits fails");

The -h fp0 flags I'm using for this build is the "most standards compliant/least optimizing" floating-point flag I've found for this compiler. I'm also attempting to open a bug with Cray to address this issue, but in the meantime is there something I should be doing differently or is this patch at least "reasonable".

Or is the write answer here not to attempt to provide Boost.Math to my users (for my 1.57 builds anyway). FWIW, I do believe this problem was introduced in 1.56... I've just never built it myself.

Change History (1)

comment:1 by John Maddock, 8 years ago

Resolution: fixed
Status: newclosed

This will be fixed in the next release - in the sense that that header will no longer be included by the rest of Boost.Math, so you will only see the error if you explicitly include <boost/cstdfloat.hpp> and try to use those types. In that context, the error is probably justified if there are no IEC559-conforming floats on that system.

Note: See TracTickets for help on using tickets.