From ba7f112f4ed9f0b3b82c356de4b4cac66f0d51b7 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 13 Jul 2016 19:51:39 -0500 Subject: [PATCH] CMake: Workaround: Try to drop "-fuse-ld=gold" in configure_1_mpi.cmake --- cmake/configure/configure_1_mpi.cmake | 33 ++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/cmake/configure/configure_1_mpi.cmake b/cmake/configure/configure_1_mpi.cmake index 6254ec58e5..8e8891a8c6 100644 --- a/cmake/configure/configure_1_mpi.cmake +++ b/cmake/configure/configure_1_mpi.cmake @@ -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() -- 2.39.5