]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add support for petsc, 1st part
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Sep 2012 13:50:38 +0000 (13:50 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Sep 2012 13:50:38 +0000 (13:50 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26661 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_petsc.cmake [new file with mode: 0644]

diff --git a/deal.II/cmake/configure/configure_petsc.cmake b/deal.II/cmake/configure/configure_petsc.cmake
new file mode 100644 (file)
index 0000000..a4ac110
--- /dev/null
@@ -0,0 +1,63 @@
+#
+# Configuration for the petsc library:
+#
+
+MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
+
+  FIND_PACKAGE(PETSC)
+
+  IF(PETSC_FOUND)
+    #
+    # So, we have found a petsc library. Let's check whether we can use it.
+    #
+    SET(${var} TRUE)
+
+    #
+    # We support petsc from version 3.x.x onwards
+    #
+    IF(PETSC_MAJOR LESS 3)
+      MESSAGE(STATUS
+        "Could not find a sufficient modern petsc installation: "
+        "Version >=3.0.0 required!"
+        )
+      SET(${var} FALSE)
+    ENDIF()
+
+    #
+    # Petsc has to be configured with the same MPI configuration as
+    # deal.II.
+    #
+    # petscconf.h should export PETSC_HAVE_MPI 1 if mpi support is enabled.
+    # So we check for this:
+    #
+    FILE(STRINGS "${PETSC_INCLUDE_DIR}/petscconf.h" PETSC_RELEASE_STRING
+      REGEX "#define.*PETSC_HAVE_MPI.*1")
+    IF("${PETSC_RELEASE_STRING}" STREQUAL "")
+      SET(PETSC_WITH_MPI FALSE)
+    ELSE()
+      SET(PETSC_WITH_MPI TRUE)
+    ENDIF()
+
+    IF( (PETSC_WITH_MPI AND NOT DEAL_II_COMPILER_SUPPORTS_MPI)
+         OR
+         (NOT PETSC_WITH_MPI AND DEAL_II_COMPILER_SUPPORTS_MPI))
+      MESSAGE(STATUS
+        "Could not find a sufficient petsc installation: "
+        "Petsc has to be configured with the same MPI configuration as deal.II."
+        )
+      SET(${var} FALSE)
+    ENDIF()
+
+
+
+  ENDIF()
+ENDMACRO()
+
+
+MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL var)
+  SET(${var} TRUE)
+ENDMACRO()
+
+
+CONFIGURE_FEATURE(PETSC)
+

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.