- # Execute the mpiname binary with the full path of the compiler wrapper
- # found, otherwise we run the risk of false positives.
- find_file(MPINAME_BIN mpiname
- HINTS ${_mpi_c_compiler_path}
- ${_cmake_c_compiler_path} ${_cmake_cxx_compiler_path}
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- if (MPINAME_BIN)
- exec_program(${MPINAME_BIN}
- ARGS -n -v
- OUTPUT_VARIABLE MVAPICH2_TYPE
- RETURN_VALUE MVAPICH2_EXEC_RETURN)
- if(MVAPICH2_EXEC_RETURN EQUAL 0)
- string(REGEX MATCH "MVAPICH2" MVAPICH2_NAME ${MVAPICH2_TYPE})
- # Want to check for MVAPICH2 in case some other library supplies mpiname
- string(REGEX REPLACE "MVAPICH2 \([0-9]+\\.[0-9]*[a-z]?\\.?[0-9]*\)" "\\1" MVAPICH2_VERSION ${MVAPICH2_TYPE})
- if(${MVAPICH2_NAME} STREQUAL "MVAPICH2" AND MVAPICH2_VERSION VERSION_LESS "1.5")
- # This test works correctly even with 1.5a1
- MESSAGE(WARNING
- "CMake found MVAPICH2 version ${MVAPICH2_VERSION} on your system. "
- "There are known problems with GROMACS and MVAPICH2 version < 1.5. "
- "Please consider updating your MVAPICH2 if your MPI wrapper compilers "
- "are using the above MVAPICH2 version.")
- endif()
- unset(MVAPICH2_VERSION)
- unset(MVAPICH2_NAME)
- unset(MVAPICH2_TYPE)
- unset(MVAPICH2_EXEC_RETURN)
- endif()
- endif()
- unset(MPINAME_BIN CACHE)
- else()
- message(FATAL_ERROR
- "MPI support requested, but no MPI compiler found. Either set the "
- "C-compiler (CMAKE_C_COMPILER) to the MPI compiler (often called mpicc), "
- "or set the variables reported missing for MPI_CXX above.")
- endif()
+ # Execute the mpiname binary with the full path of the compiler wrapper
+ # found, otherwise we run the risk of false positives.
+ find_file(MPINAME_BIN mpiname
+ HINTS ${_mpi_c_compiler_path}
+ ${_cmake_c_compiler_path} ${_cmake_cxx_compiler_path}
+ NO_DEFAULT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH)
+ if (MPINAME_BIN)
+ exec_program(${MPINAME_BIN}
+ ARGS -n -v
+ OUTPUT_VARIABLE MVAPICH2_TYPE
+ RETURN_VALUE MVAPICH2_EXEC_RETURN)
+ if (MVAPICH2_EXEC_RETURN EQUAL 0)
+ string(REGEX MATCH "MVAPICH2" MVAPICH2_NAME ${MVAPICH2_TYPE})
+ # Want to check for MVAPICH2 in case some other library supplies mpiname
+ string(REGEX REPLACE "MVAPICH2 \([0-9]+\\.[0-9]*[a-z]?\\.?[0-9]*\)" "\\1" MVAPICH2_VERSION ${MVAPICH2_TYPE})
+ if (${MVAPICH2_NAME} STREQUAL "MVAPICH2" AND MVAPICH2_VERSION VERSION_LESS "1.5")
+ # This test works correctly even with 1.5a1
+ MESSAGE(WARNING
+ "CMake found MVAPICH2 version ${MVAPICH2_VERSION} on your system. "
+ "There are known problems with GROMACS and MVAPICH2 version < 1.5. "
+ "Please consider updating your MVAPICH2 if your MPI wrapper compilers "
+ "are using the above MVAPICH2 version.")
+ endif ()
+ unset(MVAPICH2_VERSION)
+ unset(MVAPICH2_NAME)
+ unset(MVAPICH2_TYPE)
+ unset(MVAPICH2_EXEC_RETURN)
+ endif ()
+ endif ()
+ unset(MPINAME_BIN CACHE)
+ else ()
+ message(FATAL_ERROR
+ "MPI support requested, but no MPI compiler found. Either set the "
+ "C-compiler (CMAKE_C_COMPILER) to the MPI compiler (often called mpicc), "
+ "or set the variables reported missing for MPI_CXX above.")
+ endif ()