]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
The changes during the reset...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Sep 2012 13:49:57 +0000 (13:49 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 24 Sep 2012 13:49:57 +0000 (13:49 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26660 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/README_CMAKE
deal.II/TODO_CMAKE
deal.II/cmake/modules/FindPETSC.cmake
deal.II/cmake/petsc.m4
deal.II/cmake/setup_finalize.cmake

index a5534b622ca92ac8c5547abf3b0646f09265dc06..893672ae82f9a1e4a8c603aaf445139cefe6a86a 100644 (file)
@@ -95,7 +95,11 @@ OPTION(DEAL_II_WITH_NETCDF
   OFF)
 
 OPTION(DEAL_II_WITH_P4EST
-  "Build deal.II with support for P4EST."
+  "Build deal.II with support for p4est."
+  OFF)
+
+OPTION(DEAL_II_WITH_PETSC
+  "Build deal.II with support for petsc."
   OFF)
 
 OPTION(DEAL_II_WITH_TBB
@@ -126,9 +130,7 @@ OPTION(DEAL_II_WITH_ZLIB
 #
 
 OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
-  "configure sensible default CFLAGS and CXXFLAGS depending on platform,
-  compiler and build target. Disabling this option will turn off almost all
-  compiler flag setup."
+  "configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
   ON)
 
 #
index 7d5a57178afe567126ee3abde44589db282e209e..39eb60ef6bf15cdb10b773626df261f89c072158 100644 (file)
@@ -252,8 +252,8 @@ CONFIGURATION
       Currently, the following variables will be considered:
 
         METIS_DIR,
-        P4EST_DIR,
-        PETSC_DIR (and SC_DIR),
+        P4EST_DIR (and SC_DIR),
+        PETSC_DIR and PETSC_ARCH (forming ${PETSC_DIR}/${PETSC_ARCH}),
         TRILINOS_DIR,
         UMFPACK_DIR (and AMD_DIR)
 
index 49f2ea516e1cf10cc80648d46d9d4928e1e8c9f4..5dc74bce05fe5369b26a9b9a45b191f09fd31cd5 100644 (file)
@@ -7,7 +7,6 @@ Major:
 
 * The following features have to be written:
     * HDF5
-    * PETSC
     * MUMPS
     * SLEPC
     * HSL
index 97e7da47484febf8d2c15f71e2c843ba874b5f33..fc6d183fc9f7bf25a7f19e71ab6221f7807ae2ce 100644 (file)
@@ -24,6 +24,29 @@ FIND_LIBRARY(PETSC_LIBRARY
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PETSC DEFAULT_MSG PETSC_LIBRARY PETSC_INCLUDE_DIR)
 
 IF(PETSC_FOUND)
+
+  FILE(STRINGS "${PETSC_INCLUDE_DIR}/petscversion.h" PETSC_MAJOR_STRING
+    REGEX "#define.*PETSC_VERSION_MAJOR")
+  STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1" PETSC_MAJOR "${PETSC_MAJOR_STRING}")
+
+  FILE(STRINGS "${PETSC_INCLUDE_DIR}/petscversion.h" PETSC_MINOR_STRING
+    REGEX "#define.*PETSC_VERSION_MINOR")
+  STRING(REGEX REPLACE "^.*PETSC_VERSION_MINOR.*([0-9]+).*" "\\1" PETSC_MINOR "${PETSC_MINOR_STRING}")
+
+  FILE(STRINGS "${PETSC_INCLUDE_DIR}/petscversion.h" PETSC_SUBMINOR_STRING
+    REGEX "#define.*PETSC_VERSION_SUBMINOR")
+  STRING(REGEX REPLACE "^.*PETSC_VERSION_SUBMINOR.*([0-9]+).*" "\\1" PETSC_SUBMINOR "${PETSC_SUBMINOR_STRING}")
+
+  FILE(STRINGS "${PETSC_INCLUDE_DIR}/petscversion.h" PETSC_RELEASE_STRING
+    REGEX "#define.*PETSC_VERSION_RELEASE.*1")
+  IF("${PETSC_RELEASE_STRING}" STREQUAL "")
+    SET(PETSC_RELEASE FALSE)
+  ELSE()
+    SET(PETSC_RELEASE TRUE)
+  ENDIF()
+
+  SET(PETSC_VERSION "${PETSC_MAJOR}.${PETSC_MINOR}.${PETSC_SUBMINOR}")
+
   MARK_AS_ADVANCED(
     PETSC_LIBRARY
     PETSC_INCLUDE_DIR
index e9be2b4df37c0240b0496ad51d05f6f4034555e4..03813cfd9a33840ae76e13d8a26d6122b9126264 100644 (file)
 
 
 
-  dnl If we have found PETSc, determine additional pieces of data
-  if test "$USE_CONTRIB_PETSC" = "yes" ; then
-    DEAL_II_CONFIGURE_PETSC_VERSION
-    DEAL_II_CONFIGURE_PETSC_ARCH
-
-    DEAL_II_CONFIGURE_PETSC_MPIUNI_LIB
-    DEAL_II_CHECK_PETSC_MPI_CONSISTENCY
-    DEAL_II_CONFIGURE_PETSC_COMPLEX
-
     DEAL_II_EXPAND_PETSC_VECTOR="PETScWrappers::Vector"
     DEAL_II_EXPAND_PETSC_MPI_VECTOR="PETScWrappers::MPI::Vector"
     DEAL_II_EXPAND_PETSC_BLOCKVECTOR="PETScWrappers::BlockVector"
     DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR="PETScWrappers::MPI::BlockVector"
 
-    dnl Finally set with_petsc if this hasn't happened yet
-    if test "x$with_petsc" = "x" ; then
-      with_petsc="yes"
-    fi
-  fi
-
-  dnl Make sure that the right values for PETSC vectors are written
-  dnl into common/template-arguments.in
-  AC_SUBST(DEAL_II_EXPAND_PETSC_VECTOR)
-  AC_SUBST(DEAL_II_EXPAND_PETSC_MPI_VECTOR)
-  AC_SUBST(DEAL_II_EXPAND_PETSC_BLOCKVECTOR)
-  AC_SUBST(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR)
-])
-
-
-
-dnl ------------------------------------------------------------
-dnl Figure out the architecture used for PETSc, since that
-dnl determines where object and configuration files will be found.
-dnl
-dnl Usage: DEAL_II_CONFIGURE_PETSC_ARCH
-dnl
-dnl ------------------------------------------------------------
-AC_DEFUN(DEAL_II_CONFIGURE_PETSC_ARCH, dnl
-[
-  AC_MSG_CHECKING([for PETSc library architecture])
-
-  AC_ARG_WITH(petsc-arch,
-              [AS_HELP_STRING([--with-petsc-arch=architecture],
-              [Specify the architecture for your PETSc installation; use this if you want to override the PETSC_ARCH environment variable.])],
-              [DEAL_II_PETSC_ARCH="$withval"
-               AC_MSG_RESULT($DEAL_II_PETSC_ARCH)
-              ],
-              [dnl Take something from the environment variables
-               if test "x$PETSC_ARCH" != "x" ; then
-                 DEAL_II_PETSC_ARCH="$PETSC_ARCH"
-                 AC_MSG_RESULT($DEAL_II_PETSC_ARCH)
-               else
-                 AC_MSG_ERROR([If PETSc is used, you must specify the architecture either through the PETSC_ARCH environment variable, or through the --with-petsc-arch flag])
-               fi
-              ])
-
-  if test "x$PETSC_ARCH" != "x" ; then
-
-    dnl PETSc change the locations where they store their libraries
-    dnl from time-to-time; so make sure that what was specified is
-    dnl actually correct.
-    case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in
-      3.*) dnl
-        if test ! -d $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib \
-           ; then
-          AC_MSG_ERROR([PETSc has not been compiled for the architecture specified with --with-petsc-arch])
-        fi
-        ;;
-      *)    dnl
-        AC_MSG_ERROR([Unknown PETSc version ${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}])
-        ;;
-    esac
-  fi
-])
-
-
-
-dnl ------------------------------------------------------------
-dnl Figure out the version numbers of PETSc. This is unfortunately
-dnl necessary since PETSc has a habit to change function signatures,
-dnl library names, etc, in random ways between versions...
-dnl
-dnl Usage: DEAL_II_CONFIGURE_PETSC_VERSION
-dnl
-dnl ------------------------------------------------------------
-AC_DEFUN(DEAL_II_CONFIGURE_PETSC_VERSION, dnl
-[
-  AC_MSG_CHECKING([for PETSc version])
-  DEAL_II_PETSC_VERSION_MAJOR=`cat $DEAL_II_PETSC_DIR/include/petscversion.h \
-                               | grep "#define PETSC_VERSION_MAJOR" \
-                               | perl -pi -e 's/.*MAJOR\s+//g;'`
-  DEAL_II_PETSC_VERSION_MINOR=`cat $DEAL_II_PETSC_DIR/include/petscversion.h \
-                               | grep "#define PETSC_VERSION_MINOR" \
-                               | perl -pi -e 's/.*MINOR\s+//g;'`
-  DEAL_II_PETSC_VERSION_SUBMINOR=`cat $DEAL_II_PETSC_DIR/include/petscversion.h \
-                               | grep "#define PETSC_VERSION_SUBMINOR" \
-                               | perl -pi -e 's/.*MINOR\s+//g;'`
-  PETSC_VERSION="$DEAL_II_PETSC_VERSION_MAJOR.$DEAL_II_PETSC_VERSION_MINOR.$DEAL_II_PETSC_VERSION_SUBMINOR"
-
-  dnl Here is where we check if the PETSc version we have is a
-  dnl release but do nothing about it.
-  PETSC_RELEASE=`cat $DEAL_II_PETSC_DIR/include/petscversion.h \
-                     | grep "#define PETSC_VERSION_RELEASE" \
-                     | perl -pi -e 's/.*RELEASE\s+//g;'`
-  if test "$PETSC_RELEASE" = "0" ; then
-    PETSC_VERSION+="-dev"
-    DEAL_II_PETSC_VERSION_DEV=yes
     AC_DEFINE([DEAL_II_USE_PETSC_DEV], [1],
               [Defined if a PETSc installation was found and is not a release])
-  else
-    DEAL_II_PETSC_VERSION_DEV=no
-  fi
-
-  AC_MSG_RESULT($PETSC_VERSION)
-])
-
-
-dnl -------------------------------------------------------------
-dnl Make sure that if PETSc and deal.II were built with the same
-dnl MPI enabled (or disabled) functionality.
-dnl
-dnl Usage: DEAL_II_CHECK_PETSC_MPI_CONSISTENCY
-dnl
-dnl -------------------------------------------------------------
-AC_DEFUN(DEAL_II_CHECK_PETSC_MPI_CONSISTENCY, dnl
-[
-  dnl Then check for MPI consistency.
-  AC_MSG_CHECKING(for consistency of PETSc and deal.II MPI settings)
 
-  if test "x$DEAL_II_USE_MPI" = "xyes" ; then
-
-  dnl So we support MPI. Check that our PETSc installation does
-  dnl too. PETSc sets the variable PETSC_HAVE_MPIUNI to 1 in case
-  dnl he *does not* support MPI, so just read out that information.
-  dnl
-  dnl Like always, we have to cake care of version control!
-    case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in
-      3.*) dnl
-        AC_TRY_COMPILE(
-        [#include "$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/include/petscconf.h"
-        ],
-        [#ifdef PETSC_HAVE_MPIUNI
-           compile error;
-         #endif
-        ],
-        [AC_MSG_RESULT(yes)],
-        [AC_MSG_ERROR([PETSc was not built for MPI, but deal.II is!]
-        )])
-      ;;
-      *) dnl
-        AC_MSG_ERROR([Unknown PETSc version ${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}])
-      ;;
-    esac
-  else
-    case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in
-      3.*) dnl
-        AC_TRY_COMPILE(
-        [#include "$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/include/petscconf.h"
-        ],
-        [#ifndef PETSC_HAVE_MPIUNI
-           compile error;
-         #endif],
-        [AC_MSG_RESULT(yes)],
-        [AC_MSG_ERROR([PETSc was built for MPI, but deal.II is not!])
-        ])
-      ;;
-      *) dnl
-        AC_MSG_ERROR([Unknown PETSc version ${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}])
-      ;;
-    esac
-  fi
-])
 
 
 dnl ------------------------------------------------------------
index 3cfa8b06b586e8f6da7cf6bb3a9100042b6128c5..7c4884e9069b76b016f629cd023ffe91c34cde28 100644 (file)
@@ -28,6 +28,13 @@ IF(NOT DEAL_II_WITH_BOOST)
 ENDIF()
 
 
+#
+# Hide some cmake specific cached variables. This is annoying...
+#
+MARK_AS_ADVANCED(
+  file_cmd
+  )
+
 
 #
 # Append the saved initial (cached) variables ${flags}_SAVED at the end of

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.