# Configuration for mpi support:
#
-
MACRO(FEATURE_MPI_FIND_EXTERNAL var)
+ #
+ # Obey a manual user override: If MPI_CXX_FOUND is set to true in the
+ # cache, we skip the FIND_PACKAGE calls:
+ #
+ IF(MPI_CXX_FOUND)
+ SET(MPI_FOUND TRUE)
+ ENDIF()
+
#
# If CMAKE_CXX_COMPILER is already an MPI wrapper, use it to determine
- # the mpi implementation:
+ # the mpi implementation. If MPI_CXX_COMPILER is defined use the value
+ # directly.
#
- SET_IF_EMPTY(MPI_C_COMPILER ${CMAKE_C_COMPILER})
SET_IF_EMPTY(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
+ SET_IF_EMPTY(MPI_C_COMPILER ${CMAKE_C_COMPILER}) # for good measure
FIND_PACKAGE(MPI)
IF(NOT MPI_CXX_FOUND)
# is set.
#
IF(DEAL_II_WITH_MPI)
- SET(MPI_FOUND)
- UNSET(MPI_C_COMPILER CACHE)
+ MESSAGE(STATUS
+ "MPI not found but DEAL_II_WITH_MPI is set to TRUE."
+ " Try again with more aggressive search paths:"
+ )
+ SET(MPI_FOUND) # clear this value so that FIND_PACKAGE runs again.
UNSET(MPI_CXX_COMPILER CACHE)
+ UNSET(MPI_C_COMPILER CACHE)
FIND_PACKAGE(MPI)
ENDIF()
ENDIF()
# "Build deal.II with support for mpi"
# )
#
+#
# Automatic detection:
#
# If DEAL_II_WITH_MPI is undefined, autodetection of MPI is very
-# conservative. Only the current compiler and the variables MPI_C_COMPILER
-# and MPI_CXX_COMPILER are used to find MPI. DEAL_II_WITH_MPI=ON will
-# trigger a more sophisticated search for MPI.
+# conservative. Only the current compiler and the variable MPI_CXX_COMPILER
+# is used to find MPI. (MPI_CXX_COMPILER takes precedence.)
+#
+# DEAL_II_WITH_MPI=ON will trigger a more sophisticated search for MPI.
#
# The best way to force a specific MPI implementation to be used is to set
-# set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the appropriate MPI wrapper.
+# CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the appropriate MPI wrapper
+# (See above).
#
-# Alternatively, specify the mpi wrappers that will be queried for the mpi
+# Alternatively, specify the mpi wrapper that will be queried for the mpi
# link interface:
#
-# SET(MPI_C_COMPILER "mpicc" CACHE STRING "")
# SET(MPI_CXX_COMPILER "mpicxx" CACHE STRING "")
#
+#
# Manual setup:
#
-# SET(MPI_FOUND TRUE CACHE BOOL "")
+# SET(MPI_CXX_FOUND TRUE CACHE BOOL "")
+#
+# and set the current compiler to an MPI wrapper. Alternatively, you can
+# specify the complete link interface as well as compile and link flags
+# via:
+#
# SET(MPI_CXX_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
# SET(MPI_CXX_INCLUDE_PATH "include directory for mpi" CACHE STRING "")
# SET(MPI_CXX_FLAGS "..." CACHE STRING "")