AC_DEFUN(DEAL_II_CONFIGURE_PETSC, dnl
[
dnl First check for the PETSc directory
- AC_MSG_CHECKING(for PETSc library directory)
+ AC_MSG_CHECKING([for PETSc library directory])
AC_ARG_WITH(petsc,
[AS_HELP_STRING([--with-petsc=path/to/slepc],
dnl Make sure that what was specified is actually correct
if test ! -d $DEAL_II_PETSC_DIR/include \
; then
- AC_MSG_ERROR([Path to PETSc specified with --with-petsc does not
- point to a complete PETSc installation])
+ AC_MSG_ERROR([Path to PETSc specified with --with-petsc does not point to a complete PETSc installation])
fi
fi
],
dnl Make sure that what this is actually correct
if test ! -d $DEAL_II_PETSC_DIR/include \
; then
- AC_MSG_ERROR([The path to PETSc specified in the PETSC_DIR
- environment variable does not
- point to a complete PETSc installation])
+ AC_MSG_ERROR([The path to PETSc specified in the PETSC_DIR environment variable does not point to a complete PETSc installation])
fi
else
USE_CONTRIB_PETSC=no
DEAL_II_PETSC_DIR=""
- AC_MSG_RESULT(not found)
+ AC_MSG_RESULT([not found])
fi
])
if test "$USE_CONTRIB_PETSC" = "yes" ; then
- AC_DEFINE(DEAL_II_USE_PETSC, 1,
- [Defined if a PETSc installation was found and is going
- to be used])
+ AC_DEFINE([DEAL_II_USE_PETSC], [1],
+ [Defined if a PETSc installation was found and is going to be used])
dnl Set an additional variable (not via AC_DEFINE, since we don't want
dnl to have it in config.h) which we can use in doc/doxygen/options.dox.in.
dnl Also work around a stupidity in PETSc that makes sure it interferes in
dnl a completely obnoxious way with boost.
- AC_DEFINE(PETSC_SKIP_UNDERSCORE_CHKERR, 1,
- [Make sure PETSc doesn't re-define the underscore through the
- preprocessor, since this interferes with boost. PETSc redefines
- the underscore to be "__gterr =", but then forgets to undef this
- thing. Boost simply wants to concatenate the underscore with another
- string to form a class name, which then of course isn't valid
- any more. See mails in early Feb 2006.])
+ AC_DEFINE([PETSC_SKIP_UNDERSCORE_CHKERR], [1],
+ [Make sure PETSc doesn't re-define the underscore through the preprocessor, since this interferes with boost. PETSc redefines the underscore to be "__gterr =", but then forgets to undef this thing. Boost simply wants to concatenate the underscore with another string to form a class name, which then of course isn't valid any more. See mails in early Feb 2006.])
fi
-
dnl If we have found PETSc, determine additional pieces of data
if test "$USE_CONTRIB_PETSC" = "yes" ; then
DEAL_II_CONFIGURE_PETSC_VERSION
fi
fi
- dnl Make sure that the right values for PETSC vectors are written into
- dnl common/template-arguments.in
+ 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)
dnl ------------------------------------------------------------
-dnl Figure out the architecture used for PETSc, since that determines
-dnl where object and configuration files will be found.
+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_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 it is there
- 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
- ])
-
+ [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 Make sure that what was specified is actually correct. to be sure,
- dnl petsc changed the locations where they store their libraries
- dnl sometime in the middle...
- case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in
- 2.2*)
- if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
- ; then
-
- dnl Check whether PETSc is installed but someone has simply
- dnl forgotten to also compile for C++
- if test -d $DEAL_II_PETSC_DIR/lib/libg/$DEAL_II_PETSC_ARCH \
- -o -d $DEAL_II_PETSC_DIR/lib/libg_complex/$DEAL_II_PETSC_ARCH \
- ; then
- AC_MSG_ERROR([PETSc has not been compiled for C++ with scalar type real,
- but deal.II needs this for this PETSc version] $PETSC_VERSION)
- else
- AC_MSG_ERROR([PETSc has not been compiled for the architecture
- specified with --with-petsc-arch])
- fi
- fi
- ;;
- 2.3*)
+ 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
+ 2.3*) dnl
if test ! -d $DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH \
- ; then
- AC_MSG_ERROR([PETSc has not been compiled for the architecture
- specified with --with-petsc-arch])
+ ; then
+ AC_MSG_ERROR([PETSc has not been compiled for the architecture specified with --with-petsc-arch])
fi
;;
-
- 3.*)
+ 3.0*) 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])
+ ; 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])
;;
esac
dnl ------------------------------------------------------------
AC_DEFUN(DEAL_II_CONFIGURE_PETSC_VERSION, dnl
[
- AC_MSG_CHECKING(for PETSc version)
-
+ 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;'`
| 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"
- AC_MSG_RESULT($PETSC_VERSION)
-])
+ 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_VERSION_RELEASE" = "0" ; then
+ PETSC_VERSION+="-dev"
+ else
+ PETSC_VERSION+=""
+ fi
+ AC_MSG_RESULT($PETSC_VERSION)
+])
dnl ------------------------------------------------------------
dnl See if there is a library libmpiuni.a/so available. We need
-dnl to link with it on some systems.
+dnl to link with it on some systems where PETSc is built without
+dnl a real MPI and we need to handle trivial (one process) MPI
+dnl functionality.
dnl
dnl Usage: DEAL_II_CONFIGURE_PETSC_MPIUNI_LIB
dnl
dnl ------------------------------------------------------------
AC_DEFUN(DEAL_II_CONFIGURE_PETSC_MPIUNI_LIB, dnl
[
- AC_MSG_CHECKING(for PETSc libmpiuni library)
-
- if test -f $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH/libmpiuni.a ; then
- DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH/libmpiuni.a" ;
- else if test -f $DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.a ; then
- DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.a" ;
- else if test -f $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.a ; then
- DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.a" ;
- else if test -f $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH/libmpiuni.so ; then
- DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH/libmpiuni.so" ;
- else if test -f $DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.so ; then
- DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.so" ;
- else if test -f $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.so ; then
- DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.so" ;
- fi fi fi fi fi fi
+ AC_MSG_CHECKING([for PETSc libmpiuni library])
+ case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in
+ 2.3*) dnl
+ if test -f $DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.a ; then
+ DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.a"
+ fi
+ ;;
+ 3.0*) dnl
+ if test -f $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.a ; then
+ DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/lib/libmpiuni.a"
+ fi
+ ;;
+ *) dnl
+ AC_MSG_ERROR([Unknown PETSc version])
+ ;;
+ esac
if test "$DEAL_II_PETSC_MPIUNI_LIB" = "" ; then
- AC_MSG_RESULT(not found)
+ AC_MSG_RESULT([not found])
else
AC_MSG_RESULT($DEAL_II_PETSC_MPIUNI_LIB)
fi
dnl ------------------------------------------------------------
-dnl Figure out PETSc was compiled with scalar-type = complex.
-dnl To do this we need to scan the PETSc configuration file.
+dnl Figure out PETSc was compiled with --scalar-type=complex by
+dnl scanning PETSc configuration file.
+dnl
+dnl Warning: Up tp now, PETSc>3.0.0 is being supported and
+dnl deal.II will not safely compile if this option is "yes".
dnl
dnl Usage: DEAL_II_CONFIGURE_PETSC_COMPLEX
dnl
dnl ------------------------------------------------------------
AC_DEFUN(DEAL_II_CONFIGURE_PETSC_COMPLEX, dnl
[
- AC_MSG_CHECKING(for PETSc scalar complex)
-
case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in
- 2.*)
- dnl This should never happen, so we ignore the test
- DEAL_II_PETSC_COMPLEX="-1"
- ;;
- 3.*)
+ 3.0.1)
+ AC_MSG_CHECKING([for PETSc scalar complex])
DEAL_II_PETSC_COMPLEX=`cat $DEAL_II_PETSC_DIR/$DEAL_II_PETSC_ARCH/include/petscconf.h \
| grep "#define PETSC_USE_COMPLEX" \
| perl -pi -e 's/.*COMPLEX\s+//g;'`
- ;;
- *)
- AC_MSG_ERROR([Unknown PETSc version])
+ if test "$DEAL_II_PETSC_COMPLEX" = "1" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ dnl If we have previously found PETSc and here with a complex
+ dnl scalar type then set the DEAL_II_USE_COMPLEX macro
+ if test "$USE_CONTRIB_PETSC" = "yes" ; then
+ if test "$DEAL_II_PETSC_COMPLEX" = "1" ; then
+ AC_DEFINE([DEAL_II_USE_PETSC_COMPLEX], [1],
+ [Defined if a PETSc installation was found with complex scalar type and is going to be used])
+ fi fi
;;
esac
-
- if test "$DEAL_II_PETSC_COMPLEX" = "1" ; then
- AC_MSG_RESULT(yes)
-
- dnl If the check for complex scalar is ignored, say so and why
- else if test "$DEAL_II_PETSC_COMPLEX" = "-1" ; then
- AC_MSG_RESULT(ignored test. complex not supported)
-
- dnl Here "not found" means not found!
- else
- AC_MSG_RESULT(not found)
- fi fi
-
- dnl If we have previously found PETSc and here with a complex
- dnl scalar type then set the DEAL_II_USE_COMPLEX macro
- if test "$USE_CONTRIB_PETSC" = "yes" ; then
- if test "$DEAL_II_PETSC_COMPLEX" = "1" ; then
- AC_DEFINE(DEAL_II_USE_PETSC_COMPLEX, 1,
- [Defined if a PETSc installation was found with complex
- scalar type and is going to be used])
- fi fi
])
dnl ------------------------------------------------------------
AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
[
- dnl First check for the SLEPc directory
- AC_MSG_CHECKING(for SLEPc include directory)
-
+ AC_MSG_CHECKING([for SLEPc include directory])
AC_ARG_WITH(slepc,
[AS_HELP_STRING([--with-slepc=path/to/slepc],
[Specify the path to the SLEPc installation, for which the include directory is a subdir; use this if you want to override the SLEPC_DIR environment variable.])],
- [
- dnl Special case when someone does --with-slepc=no
- if test "x$withval" = "xno" ; then
- AC_MSG_RESULT([explicitly disabled])
- USE_CONTRIB_SLEPC=no
- else
- USE_CONTRIB_SLEPC=yes
- DEAL_II_SLEPC_DIR="$withval"
- AC_MSG_RESULT($DEAL_II_SLEPC_DIR)
-
- dnl Make sure that what was specified is actually correct
- if test ! -d $DEAL_II_SLEPC_DIR \
- -o ! -d $DEAL_II_SLEPC_DIR/include \
- ; then
- AC_MSG_ERROR([Path to SLEPc specified with --with-slepc does not
- point to a complete SLEPc installation])
- fi
-
- if test ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_PETSC_ARCH \
- -o ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_PETSC_ARCH/lib \
- ; then
+ [dnl Special case when someone does --with-slepc=no
+ if test "x$withval" = "xno" ; then
+ AC_MSG_RESULT([explicitly disabled])
+ USE_CONTRIB_SLEPC=no
+ else
+ USE_CONTRIB_SLEPC=yes
+ DEAL_II_SLEPC_DIR="$withval"
+ AC_MSG_RESULT($DEAL_II_SLEPC_DIR)
+
+ dnl Make sure that what was specified is actually correct
+ if test ! -d $DEAL_II_SLEPC_DIR \
+ -o ! -d $DEAL_II_SLEPC_DIR/include \
+ ; then
+ AC_MSG_ERROR([Path to SLEPc specified with --with-slepc does not point to a complete SLEPc installation])
+ fi
+
+ if test ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_PETSC_ARCH \
+ -o ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_PETSC_ARCH/lib \
+ ; then
AC_MSG_ERROR([SLEPc has not been compiled for the PETSc architecture])
- fi
- fi
- ],
- [
- dnl Take something from the environment variables, if it is there
- if test "x$SLEPC_DIR" != "x" ; then
- USE_CONTRIB_SLEPC=yes
- DEAL_II_SLEPC_DIR="$SLEPC_DIR"
- AC_MSG_RESULT($DEAL_II_SLEPC_DIR)
+ fi
+ fi
+ ],
+ [dnl Take something from the environment variables, if it is there
+ if test "x$SLEPC_DIR" != "x" ; then
+ USE_CONTRIB_SLEPC=yes
+ DEAL_II_SLEPC_DIR="$SLEPC_DIR"
+ AC_MSG_RESULT($DEAL_II_SLEPC_DIR)
+
+ dnl Make sure that what this is actually correct
+ if test ! -d $DEAL_II_SLEPC_DIR \
+ -o ! -d $DEAL_II_SLEPC_DIR/include \
+ ; then
+ AC_MSG_ERROR([The path to SLEPc specified in the SLEPC_DIR environment variable does not point to a complete SLEPc installation])
+ fi
+ else
+ USE_CONTRIB_SLEPC=no
+ DEAL_II_SLEPC_DIR=""
+ AC_MSG_RESULT(not found)
+ fi
+ ])
- dnl Make sure that what this is actually correct
- if test ! -d $DEAL_II_SLEPC_DIR \
- -o ! -d $DEAL_II_SLEPC_DIR/include \
- ; then
- AC_MSG_ERROR([The path to SLEPc specified in the SLEPC_DIR
- environment variable does not point to a
- complete SLEPc installation])
- fi
- else
- USE_CONTRIB_SLEPC=no
- DEAL_II_SLEPC_DIR=""
- AC_MSG_RESULT(not found)
- fi
- ])
if test "$USE_CONTRIB_SLEPC" = "yes" ; then
- AC_DEFINE(DEAL_II_USE_SLEPC, 1,
- [Defined if a SLEPc installation was found and is going
- to be used])
+ AC_DEFINE([DEAL_II_USE_SLEPC], [1],
+ [Defined if a SLEPc installation was found and is going to be used])
dnl Set an additional variable (not via AC_DEFINE, since we don't want
dnl to have it in config.h) which we can use in doc/doxygen/options.dox.in.
dnl Finally set with_slepc if this hasn't happened yet
if test "x$with_slepc" = "x" ; then
with_slepc="yes"
- fi
- fi
+ fi fi
])
dnl ------------------------------------------------------------
dnl ------------------------------------------------------------
AC_DEFUN(DEAL_II_CONFIGURE_SLEPC_VERSION, dnl
[
- AC_MSG_CHECKING(for SLEPc version)
-
+ AC_MSG_CHECKING([for SLEPc version])
DEAL_II_SLEPC_VERSION_MAJOR=`cat $DEAL_II_SLEPC_DIR/include/slepcversion.h \
| grep "#define SLEPC_VERSION_MAJOR" \
| perl -pi -e 's/.*MAJOR\s+//g;'`
| grep "#define SLEPC_VERSION_SUBMINOR" \
| perl -pi -e 's/.*MINOR\s+//g;'`
SLEPC_VERSION="$DEAL_II_SLEPC_VERSION_MAJOR.$DEAL_II_SLEPC_VERSION_MINOR.$DEAL_II_SLEPC_VERSION_SUBMINOR"
+
+ dnl Here is where we check if the SLEPc version we have is a
+ dnl release but do nothing about it.
+ SLEPC_RELEASE=`cat $DEAL_II_SLEPC_DIR/include/slepcversion.h \
+ | grep "#define SLEPC_VERSION_RELEASE" \
+ | perl -pi -e 's/.*RELEASE\s+//g;'`
+ if test "$SLEPC_RELEASE" = "0" ; then
+ SLEPC_VERSION+="-dev"
+ else
+ SLEPC_VERSION+=""
+ fi
AC_MSG_RESULT($SLEPC_VERSION)
- dnl Then check that PETSc and SLEPc versions are compatible
- dnl ie. that they are equivalent.
+ dnl Then check that PETSc and SLEPc versions are compatible ie. that
+ dnl they are equivalent. Patch numbers don't count for anything,
+ dnl but, we do include whether PETSc and SLEPc are both release
+ dnl versions in the check.
if test "${PETSC_VERSION}" != "${SLEPC_VERSION}" \
+ -o "${PETSC_RELEASE}" != "${SLEPC_RELEASE}" \
; then
- AC_MSG_ERROR([If SLEPc is used, you must use the same version
- number as your PETSc Installation])
+ AC_MSG_ERROR([If SLEPc is used, you must use the same version number as your PETSc Installation])
fi
])
dnl Make sure that what was specified is actually correct
if test ! -d $DEAL_II_TRILINOS_DIR/include \
-o ! -d $DEAL_II_TRILINOS_DIR/lib ; then
- AC_MSG_ERROR([Path to Trilinos specified with --with-trilinos does not
- point to a complete Trilinos installation])
+ AC_MSG_ERROR([Path to Trilinos specified with --with-trilinos does not point to a complete Trilinos installation])
fi
DEAL_II_TRILINOS_INCDIR="$DEAL_II_TRILINOS_DIR/include"