]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Avoid another symbol clash with adol-c 10484/head
authorMatthias Maier <tamiko@43-1.org>
Tue, 9 Jun 2020 03:45:56 +0000 (22:45 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 9 Jun 2020 03:45:56 +0000 (22:45 -0500)
cmake/configure/configure_adolc.cmake

index aa22c462147ffde68bb64f4997d19049430a651d..6ad62473f8dc53077c835265e23a08a59573ce12 100644 (file)
@@ -68,6 +68,29 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var)
       SET(${var} FALSE)
     ENDIF()
 
+    #
+    # We have to avoid another symbol clash with the netcdf library that
+    # might get transitively pulled in by Trilinos (the libnetcdf.so shared
+    # object exports the global symbol 'function' but so does adolc
+    # itself).
+    #
+    IF("${Trilinos_TPL_LIBRARIES}" MATCHES "netcdf")
+      MESSAGE(STATUS
+        "Could not find a sufficient ADOL-C installation: "
+        "Possible symbol clash between the ADOL-C library and netcdf "
+        "(pulled in as optional external dependency of Trilinos) 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 netcdf "
+        "(pulled in as optional external dependency of Trilinos). "
+        "If you want to use ADOL-C, please configure deal.II to use a "
+        "Trilinos library with disabled netcdf bindings.\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.