]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a test for mpi support in p4est
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2012 09:05:43 +0000 (09:05 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 20 Sep 2012 09:05:43 +0000 (09:05 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26547 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/cmake/configure/configure_p4est.cmake

index 469ce39c5070898e335597e8f0213c70482d4d1a..d296c28ff1f38fc435cea2b819e092b5c74131e6 100644 (file)
@@ -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 <p4est_config.h>
+      #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()
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.