# Configuration for mpi support:
#
+SET(DEAL_II_ALLOW_GENERIC_MPI ON CACHE BOOL
+ "Allow the usage of an external mpi library even if the current compiler is not an mpi wrapper"
+ )
+
+
MACRO(FEATURE_MPI_FIND_EXTERNAL var)
- FIND_PACKAGE(MPI QUIET)
+ #
+ # If CMAKE_CXX_COMPILER is already an MPI wrapper, use it to determine
+ # the mpi implementation:
+ #
+ SET(MPI_C_COMPILER ${CMAKE_C_COMPILER})
+ SET(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
+ FIND_PACKAGE(MPI)
+
+ IF(NOT MPI_CXX_FOUND)
+ #
+ # CMAKE_CXX_COMPILER is apparently not an mpi wrapper.
+ # If we're allowed to do so, search for a generic mpi implementation
+ # and use it.
+ #
+ IF(DEAL_II_ALLOW_GENERIC_MPI)
+ SET(MPI_FOUND)
+ UNSET(MPI_C_COMPILER CACHE)
+ UNSET(MPI_CXX_COMPILER CACHE)
+ FIND_PACKAGE(MPI)
+ ENDIF()
+ ENDIF()
IF(MPI_CXX_FOUND)
# Hide some variables:
- MARK_AS_ADVANCED(
- MPI_EXTRA_LIBRARY
- MPI_LIBRARY
- )
+ MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY)
+
SET(${var} TRUE)
ENDIF()
ENDMACRO()
# The user has to know the location of the mpi headers as well:
LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH})
-
- SET(DEAL_II_USE_MPICXX OFF CACHE BOOL # Disabled by default
- "Set the compiler to the detected mpi wrapper ${MPI_CXX_COMPILER}"
- )
- IF(DEAL_II_USE_MPICXX)
- SET(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
- ENDIF()
-
ENDMACRO()
# "Build deal.II with support for mpi"
# )
#
-# SET(DEAL_II_USE_MPICXX ON CACHE BOOL
-# "Set the compiler to the detected mpi wrapper"
+# SET(DEAL_II_ALLOW_GENERIC_MPI ON CACHE BOOL
+# "Allow the usage of an external mpi library even if the current compiler is not an mpi wrapper"
# )
#
-# TODO
+# Automatic detection:
+#
+# Set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the appropriate MPI
+# wrapper.
+#
+# Manual setup:
+#
+# SET(MPI_FOUND TRUE CACHE BOOL "")
+# 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 "")
+# SET(MPI_CXX_LINK_FLAGS "..." CACHE STRING "")
#
#
# Manual setup:
#
-# SET(METIS_FOUND TRUE CACHE BOOL "")
-# SET(METIS_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
-# SET(METIS_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
-# SET(METIS_LINKER_FLAGS "..." CACHE STRING "")
+# SET(MUMPS_FOUND TRUE CACHE BOOL "")
+# SET(MUMPS_LIBRARIES "library;and;semicolon;separated;list;of;link;interface" CACHE STRING "")
+# SET(MUMPS_INCLUDE_DIRS "semicolon;separated;list;of;include;dirs" CACHE STRING "")
+# SET(MUMPS_LINKER_FLAGS "..." CACHE STRING "")
#