]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Add boost and adolc compatibility check
authorMatthias Maier <tamiko@43-1.org>
Wed, 25 Apr 2018 20:41:00 +0000 (15:41 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 26 Apr 2018 13:56:50 +0000 (08:56 -0500)
Make sure to only ever use an external ADOL-C library (that uses the
Boost pool allocator and is linked against external boost) if deal.II is
also configured with external Boost.

cmake/configure/configure_adolc.cmake

index 51bb5670c3bbc1d14a1dd96e413fce1691087eb6..1fd012f48b8776496b127eba9edaf12b512e2262 100644 (file)
@@ -35,6 +35,25 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
     #
     SET(${var} TRUE)
 
+    #
+    # If Adolc is configured to use the Boost allocator (of an external
+    # boost library) we must not use a bundled Boost library for deal.II.
+    #
+    IF(ADOLC_WITH_BOOST_ALLOCATOR AND FEATURE_BOOST_BUNDLED_CONFIGURED)
+      MESSAGE(STATUS
+        "Could not find a sufficient ADOL-C installation: "
+        "ADOL-C links against external Boost but deal.II was configured "
+        "with bundled Boost."
+        )
+      SET(ADOLC_ADDITIONAL_ERROR_STRING
+        ${ADOLC_ADDITIONAL_ERROR_STRING}
+        "Could not find a sufficient ADOL-C installation:\n"
+        "ADOL-C links against external Boost but deal.II was configured "
+        "with bundled Boost.\n\n"
+        )
+      SET(${var} FALSE)
+    ENDIF()
+
     #
     # Check whether we have a recent enough ADOL-C library that can return
     # values from constant objects.
@@ -65,7 +84,7 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
       {
         const adouble val_taped = 1.0;
         const adtl::adouble val_tapeless = 1.0;
-        
+
         std::ostringstream ss;
         ss << val_taped;
         ss << val_tapeless;
@@ -81,7 +100,7 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
         ${ADOLC_ADDITIONAL_ERROR_STRING}
         "Could not find a sufficient ADOL-C installation:\n"
         "ADOL-C cast check failed.\n"
-        "deal.II needs ADOL-C version 2.6.4 or newer."
+        "deal.II needs ADOL-C version 2.6.4 or newer.\n\n"
         )
       SET(${var} FALSE)
     ENDIF()
@@ -95,7 +114,7 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
         ${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."
+        "deal.II needs ADOL-C version 2.6.4 or newer.\n\n"
         )
       SET(${var} FALSE)
     ENDIF()
@@ -104,8 +123,9 @@ ENDMACRO()
 
 
 MACRO(FEATURE_ADOLC_CONFIGURE_EXTERNAL)
-  SET(DEAL_II_ADOLC_WITH_ATRIG_ERF ${ADOLC_WITH_ATRIG_ERF})
   SET(DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING ${ADOLC_WITH_ADVANCED_BRANCHING})
+  SET(DEAL_II_ADOLC_WITH_ATRIG_ERF ${ADOLC_WITH_ATRIG_ERF})
+  SET(DEAL_II_ADOLC_WITH_BOOST_ALLOCATOR ${ADOLC_WITH_BOOST_ALLOCATOR})
 
   SET(DEAL_II_EXPAND_ADOLC_TYPES "adouble; adtl::adouble")
 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.