From 7f4d7d0257ae4912e3490880847a2078be3b146a Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 20 Sep 2012 09:05:43 +0000 Subject: [PATCH] Add a test for mpi support in p4est git-svn-id: https://svn.dealii.org/branches/branch_cmake@26547 0785d39b-7218-0410-832d-ea1e28bc413d --- .../cmake/configure/configure_p4est.cmake | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/deal.II/contrib/cmake/configure/configure_p4est.cmake b/deal.II/contrib/cmake/configure/configure_p4est.cmake index 469ce39c50..d296c28ff1 100644 --- a/deal.II/contrib/cmake/configure/configure_p4est.cmake +++ b/deal.II/contrib/cmake/configure/configure_p4est.cmake @@ -10,14 +10,35 @@ SET(FEATURE_P4EST_DEPENDS MACRO(FEATURE_P4EST_FIND_EXTERNAL var) FIND_PACKAGE(P4EST) - FIND_PACKAGE(SC) - - # - # TODO: Check for mpi consistency... - # + FIND_PACKAGE(SC) # TODO IF(P4EST_FOUND AND SC_FOUND) - SET(${var} TRUE) + + # + # Check whether p4est supports mpi: + # + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${P4EST_INCLUDE_DIR}) + CHECK_CXX_SOURCE_COMPILES( + " + #include + #ifndef P4EST_MPI + # error p4est compiled without mpi support + invalid + #endif + int main() { return 0; } + " + P4EST_WITH_MPI) + LIST(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${P4EST_INCLUDE_DIR}/p4est_config.h) + + IF(NOT P4EST_WITH_MPI) + MESSAGE(WARNING "\n" + "Could not find a sufficient p4est installation: " + "P4est has to be configured with MPI support enabled.\n\n" + ) + ELSE() + SET(${var} TRUE) + ENDIF() + ENDIF() ENDMACRO() -- 2.39.5