]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add another compile-time check to Adol-C CMake module. 5878/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 9 Feb 2018 15:02:34 +0000 (16:02 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 9 Feb 2018 15:02:34 +0000 (16:02 +0100)
cmake/configure/configure_adolc.cmake
cmake/modules/FindADOLC.cmake

index d76d14233dc0a281a1cd91b059ac8cc171d3ada6..7a1b043293d3d2b8ba1cd35f13862d42aa807130 100644 (file)
@@ -48,6 +48,21 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
       }"
       ADOLC_DOUBLE_CAST_CHECK)
 
+    CHECK_CXX_SOURCE_COMPILES("
+      #include <adolc/adouble.h>
+      #include <adolc/adtl.h>
+      #include <sstream>
+      int main (int argc, char *argv[])
+      {
+        const adouble val_taped = 1.0;
+        const adtl::adouble val_tapeless = 1.0;
+        
+        std::ostringstream ss;
+        ss << val_taped;
+        ss << val_tapeless;
+      }"
+      ADOLC_ADOUBLE_OSTREAM_CHECK)
+
     IF(NOT ADOLC_DOUBLE_CAST_CHECK)
       MESSAGE(STATUS
         "Could not find a sufficient ADOL-C installation: "
@@ -61,6 +76,20 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
+
+    IF(NOT ADOLC_ADOUBLE_OSTREAM_CHECK)
+      MESSAGE(STATUS
+        "Could not find a sufficient ADOL-C installation: "
+        "deal.II needs ADOL-C version 2.6.4 or newer."
+        )
+      SET(ADOLC_ADDITIONAL_ERROR_STRING
+        ${ADOLC_ADDITIONAL_ERROR_STRING}
+        "Could not find a sufficient ADOL-C installation:\n"
+        "ADOL-C stream output check failed.\n"
+        "deal.II needs ADOL-C version 2.6.4 or newer."
+        )
+      SET(${var} FALSE)
+    ENDIF()
   ENDIF()
 ENDMACRO()
 
index 851d3e051a4408169021df17e646d88494d57132..8cf9263ccb749f2a0f1bb357518b5ec68f05f170 100644 (file)
@@ -83,5 +83,5 @@ DEAL_II_PACKAGE_HANDLE(ADOLC
   INCLUDE_DIRS REQUIRED ADOLC_INCLUDE_DIR
   USER_INCLUDE_DIRS REQUIRED ADOLC_INCLUDE_DIR
   CLEAR ADOLC_INCLUDE_DIR ADOLC_LIBRARY ADOLC_SETTINGS_H
-    ADOLC_DOUBLE_CAST_CHECK # clean up check in configure_adolc.cmake
+    ADOLC_DOUBLE_CAST_CHECK ADOLC_ADOUBLE_OSTREAM_CHECK # clean up checks in configure_adolc.cmake
   )

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.