From c7703c094968efc83a9c2d4bf4dcd8ad6c81ce17 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Sat, 9 Nov 2013 16:53:44 +0100 Subject: [PATCH] fix test for HAVE_QUAD on some instances of ubuntu 13.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I haven't figured out why this happens, but on one of my computers running kubuntu 13.10 g++ says the following if one tries to use quadruple precision math: /home/erne/src/ewoms/ewoms/common/quad.hh: In static member function ‘static quad std::numeric_limits<__float128>::min()’: /home/erne/src/ewoms/ewoms/common/quad.hh:52:14: error: unable to find numeric literal operator ‘operator"" Q’ { return FLT128_MIN; } since this happens only on this machine and only with the c++ (but not the C) compiler, i suppose that this is either an upgrade issue with kubuntu or an issue with the ubuntu gcc stack. Strangely enough, my other kubuntu machine does not have a problem with that... In any case also testing for assignability of constants and using the C++ compiler for the quadmath test won't hurt... --- cmake/Modules/FindQuadmath.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindQuadmath.cmake b/cmake/Modules/FindQuadmath.cmake index 4d0efd40..51948d2a 100644 --- a/cmake/Modules/FindQuadmath.cmake +++ b/cmake/Modules/FindQuadmath.cmake @@ -12,11 +12,12 @@ include(CMakePushCheckState) cmake_push_check_state() list(APPEND CMAKE_REQUIRED_LIBRARIES "quadmath") -CHECK_C_SOURCE_COMPILES(" +CHECK_CXX_SOURCE_COMPILES(" #include int main(void){ __float128 foo = sqrtq(123.456); + foo = FLT128_MIN; }" HAVE_QUAD) cmake_pop_check_state()