From e3bd217cce6789f6c92b242f0672c1c5be4e0679 Mon Sep 17 00:00:00 2001 From: maier Date: Fri, 15 Mar 2013 09:58:19 +0000 Subject: [PATCH] CMake: Final cleanup for the MPI stuff git-svn-id: https://svn.dealii.org/trunk@28910 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/configure/configure_1_mpi.cmake | 22 ++++++++++++++----- deal.II/doc/development/Config.sample | 22 +++++++++++++------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/deal.II/cmake/configure/configure_1_mpi.cmake b/deal.II/cmake/configure/configure_1_mpi.cmake index 0cf78901ff..e0c1766d41 100644 --- a/deal.II/cmake/configure/configure_1_mpi.cmake +++ b/deal.II/cmake/configure/configure_1_mpi.cmake @@ -16,14 +16,22 @@ # 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) @@ -33,9 +41,13 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) # 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() diff --git a/deal.II/doc/development/Config.sample b/deal.II/doc/development/Config.sample index 3fb2f0f142..a3f61ef7b8 100644 --- a/deal.II/doc/development/Config.sample +++ b/deal.II/doc/development/Config.sample @@ -236,25 +236,33 @@ # "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 "") -- 2.39.5