From 654851ee0b7715f5356eb1389df64755becd7a80 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 13 Jul 2016 09:50:25 -0500 Subject: [PATCH] CMake: Add a check to ensure a working MPI interface --- cmake/configure/configure_1_mpi.cmake | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/cmake/configure/configure_1_mpi.cmake b/cmake/configure/configure_1_mpi.cmake index 781c47c806..6254ec58e5 100644 --- a/cmake/configure/configure_1_mpi.cmake +++ b/cmake/configure/configure_1_mpi.cmake @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2015 by the deal.II authors +## Copyright (C) 2012 - 2016 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -28,7 +28,25 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var) "Could not find a sufficient MPI version: " "Your MPI implementation must define MPI_SEEK_SET.") SET(MPI_ADDITIONAL_ERROR_STRING - "Your MPI implementation must define MPI_SEEK_SET.") + "Your MPI implementation must define MPI_SEEK_SET.\n") + SET(${var} FALSE) + ENDIF() + + CHECK_COMPILER_SETUP( + "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_SAVED} ${MPI_CXX_FLAGS}" + "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_SAVED} ${MPI_LINKER_FLAGS}" + MPI_WORKING_COMPILER + ${DEAL_II_LIBRARIES} ${MPI_LIBRARIES} + ) + + IF(NOT MPI_WORKING_COMPILER) + 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() -- 2.39.5