]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a workaround for this C++ issue and trilinos.
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2012 20:34:22 +0000 (20:34 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2012 20:34:22 +0000 (20:34 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26576 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/cmake/configure/configure_trilinos.cmake

index 962de51f01974c210476343311312c30732e9b66..ea8d0239bd6ba1599530692590b21fd97b330d84 100644 (file)
@@ -110,16 +110,32 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
       int main(){ return 0; }
       "
       TRILINOS_SUPPORTS_CPP11)
-    STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-std=c++0x")
-    LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIR})
 
     IF(DEAL_II_CAN_USE_CXX11 AND NOT TRILINOS_SUPPORTS_CPP11)
-      MESSAGE(WARNING "\n"
-        "Your Trilinos installation is not compatible with the C++ standard selected for\n"
-        "this compiler. See the deal.II FAQ page for a solution.\n\n"
-        )
-      SET(${var} FALSE)
+      #
+      # Try whether exporting HAS_C99_TR1_CMATH helps:
+      #
+      ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-DHAS_C99_TR1_CMATH")
+      CHECK_CXX_SOURCE_COMPILES(
+        "
+        #include <Sacado_cmath.hpp>
+        int main(){ return 0; }
+        "
+        TRILINOS_HAS_C99_TR1_WORKAROUND)
+      STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-DHAS_C99_TR1_CMATH")
+
+      IF(TRILINOS_HAS_C99_TR1_WORKAROUND)
+        ADD_DEFINITIONS("-DHAS_C99_TR1_CMATH")
+      ELSE()
+        MESSAGE(WARNING "\n"
+          "Your Trilinos installation is not compatible with the C++ standard selected for\n"
+          "this compiler. See the deal.II FAQ page for a solution.\n\n"
+          )
+        SET(${var} FALSE)
+      ENDIF()
     ENDIF()
+    STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-std=c++0x")
+    LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIR})
 
   ENDIF(TRILINOS_FOUND)
 ENDMACRO()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.