Skip to content
Snippets Groups Projects
Commit 3ec24af8 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[CMake] Don't test for recent enough MPI version

We require MPI 2.1 anyway and nobody has reported problems.
parent 47830f03
No related branches found
No related tags found
No related merge requests found
......@@ -42,37 +42,6 @@ if(MPI_C_FOUND)
dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_MPI=1;MPICH_SKIP_MPICXX;MPIPP_H"
INCLUDE_DIRS "${MPI_DUNE_INCLUDE_PATH}"
LIBRARIES "${MPI_DUNE_LIBRARIES}")
# Check whether the MPI-2 standard is supported
include(CMakePushCheckState)
include(CheckFunctionExists)
include(CheckCXXSourceCompiles)
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES};${MPI_DUNE_LIBRARIES})
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} "-DENABLE_MPI=1 -DMPICH_SKIP_MPICXX -DMPIPP_H")
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${MPI_DUNE_INCLUDE_PATH})
check_function_exists(MPI_Finalized MPI_2)
# proper version check
check_cxx_source_compiles("
#include <mpi.h>
#if !((MPI_VERSION > 2) || (MPI_VERSION == 2 && MPI_SUBVERSION >= 1))
fail with a horribe compilation error due to old MPI version
#endif
int main(int argc, char** argv)
{
MPI_Init(&argc,&argv);
MPI_Finalize();
}
" MPI_VERSION_SUPPORTED)
cmake_pop_check_state()
if(NOT MPI_VERSION_SUPPORTED)
message(FATAL_ERROR "Your MPI implementation is too old. Please upgrade to an MPI-2.1 compliant version.")
endif()
endif(MPI_C_FOUND)
# adds MPI flags to the targets
......
......@@ -38,9 +38,7 @@
/* Define to 1 if you have the <malloc.h> header file. */
// Not used! #cmakedefine01 HAVE_MALLOC_H
/* Define if you have the MPI library. This is only true if MPI was found by
configure _and_ if the application uses the DUNEMPICPPFLAGS (or the
deprecated MPI_CPPFLAGS) */
/* Define if you have the MPI library. */
#cmakedefine HAVE_MPI ENABLE_MPI
/* Define if you have the GNU GMP library. The value should be ENABLE_GMP
......@@ -56,9 +54,6 @@
/* Define to 1 if you have <sys/mman.h>. */
#cmakedefine HAVE_SYS_MMAN_H 1
/* Define to 1 if the MPI2 Standard is supported */
#cmakedefine MPI_2 1
/* begin private */
/* Name of package */
......@@ -96,6 +91,7 @@
#define HAVE_NOEXCEPT_SPECIFIER 1
#define HAVE_STD_DECLVAL 1
#define HAVE_KEYWORD_FINAL 1
#define MPI_2 1
/* Define to 1 if the compiler properly supports testing for operator[] */
#cmakedefine HAVE_IS_INDEXABLE_SUPPORT 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment