]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Workaround: Try to drop "-fuse-ld=gold" in configure_1_mpi.cmake
authorMatthias Maier <tamiko@43-1.org>
Thu, 14 Jul 2016 00:51:39 +0000 (19:51 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 14 Jul 2016 00:56:08 +0000 (19:56 -0500)
cmake/configure/configure_1_mpi.cmake

index 6254ec58e534846d047ce15138f6596e580dda1c..8e8891a8c6d9fb9fa79371934c2fd223d90e7a3f 100644 (file)
@@ -40,15 +40,36 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var)
       )
 
     IF(NOT MPI_WORKING_COMPILER)
-      MESSAGE(STATUS "Could not find a sufficient MPI installation: "
-        "Unable to compile a simple test program."
+      #
+      # Try a workaround and drop "-fuse-ld=gold" (if present) from the
+      # linker invocation
+      #
+      MESSAGE(STATUS "Unable to compile a simple test program. "
+        "Try to drop \"-fuse-ld=gold\" from the linker flags."
         )
-      SET(MPI_ADDITIONAL_ERROR_STRING
-        ${MPI_ADDITIONAL_ERROR_STRING}
-        "Unable to compile and link a simple test program with your MPI installation. \n"
+      STRING(REPLACE "-fuse-ld=gold" "" _filtered_flags "${DEAL_II_LINKER_FLAGS}")
+
+      CHECK_COMPILER_SETUP(
+        "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_SAVED} ${MPI_CXX_FLAGS}"
+        "${_filtered_flags} ${DEAL_II_LINKER_FLAGS_SAVED} ${MPI_LINKER_FLAGS}"
+        MPI_WORKING_COMPILER
+        ${DEAL_II_LIBRARIES} ${MPI_LIBRARIES}
         )
-      SET(${var} FALSE)
+
+      IF(MPI_WORKING_COMPILER)
+        SET(DEAL_II_LINKER_FLAGS "${_filtered_flags}")
+      ELSE()
+        MESSAGE(STATUS "Could not find a sufficient MPI installation: "
+          "Unable to compile a simple test program."
+          )
+        SET(MPI_ADDITIONAL_ERROR_STRING
+          ${MPI_ADDITIONAL_ERROR_STRING}
+          "Unable to compile and link a simple test program with your MPI installation. \n"
+          )
+        SET(${var} FALSE)
+      ENDIF()
     ENDIF()
+
   ENDIF()
 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.