- 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 ------------------------------------------------------------