]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Add a safeguard that disables ADOL-C in case SEACASChaco is enabled 8200/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 16 May 2019 15:33:57 +0000 (10:33 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 16 May 2019 15:38:07 +0000 (10:38 -0500)
cmake/configure/configure_adolc.cmake

index 0e37255b7021ec5292cb60fc6eb94cb45f73dfe7..f33ad4b1665ffe8e86a714440bf59c237eaa393a 100644 (file)
@@ -17,7 +17,7 @@
 # Configuration for the ADOL-C library:
 #
 
-SET(FEATURE_ADOLC_AFTER BOOST)
+SET(FEATURE_ADOLC_AFTER BOOST TRILINOS)
 
 MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
   FIND_PACKAGE(ADOLC)
@@ -47,6 +47,27 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
       SET(${var} FALSE)
     ENDIF()
 
+    #
+    # We have to avoid a symbol clash with Trilinos' SEACASChaco library
+    # (the libchaco.so shared object exports the global symbol 'divide' but
+    # so does adolc itself).
+    #
+    ITEM_MATCHES(_module_found SEACASChaco ${Trilinos_PACKAGE_LIST})
+    IF(_module_found)
+      MESSAGE(STATUS
+        "Could not find a sufficient ADOL-C installation: "
+        "Possible symbol clash between the ADOL-C library and Trilinos' SEACASChaco detected"
+        )
+      SET(ADOLC_ADDITIONAL_ERROR_STRING
+        ${ADOLC_ADDITIONAL_ERROR_STRING}
+        "Could not find a sufficient ADOL-C installation:\n"
+        "Possible symbol clash between the ADOL-C library and Trilinos' SEACASChaco detected."
+        "If you want to use ADOL-C, please configure deal.II to use a "
+        "Trilinos library with disabled SEACASChaco.\n\n"
+        )
+      SET(${var} FALSE)
+    ENDIF()
+
     #
     # Check whether we have a recent enough ADOL-C library that can return
     # values from constant objects.

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.