fi
- dnl Secondly, check for the PETSc architecture, since that determines
- dnl where object and configuration files will be found. Do so only
- dnl if we are interested in this information at all.
+ dnl If we have found PETSc, determine additional pieces of data
if test "$USE_CONTRIB_PETSC" = "yes" ; then
- AC_MSG_CHECKING(for PETSc library architecture)
+ DEAL_II_CONFIGURE_PETSC_ARCH
+ DEAL_II_CONFIGURE_PETSC_VERSION
+ fi
+])
+
- AC_ARG_WITH(petsc-arch,
- [ --with-petsc-arch=architecture Specify the architecture for your PETSc
+
+dnl ------------------------------------------------------------
+dnl Figure out the architecture used for PETSc, since that determines
+dnl 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,
+ [ --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
+ [
+ DEAL_II_PETSC_ARCH=$withval
+ AC_MSG_RESULT($DEAL_II_PETSC_ARCH)
+
+ dnl Make sure that what was specified is actually correct
+ if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
+ ; then
+ AC_MSG_ERROR([PETSc has not been compiled for the architecture
+ specified with --with-petsc-arch])
+ fi
+ ],
+ [
+ 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)
- dnl Make sure that what was specified is actually correct
+ dnl Make sure that what this is actually correct
if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
- ; then
+ ; then
AC_MSG_ERROR([PETSc has not been compiled for the architecture
- specified with --with-petsc-arch])
- fi
- ],
- [
- 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)
-
- dnl Make sure that what this is actually correct
- if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
- ; then
- AC_MSG_ERROR([PETSc has not been compiled for the architecture
- specified in the PETSC_ARCH environment variable])
- fi
- else
- AC_MSG_ERROR([If PETSc is used, you must specify the architectur
- either through the PETSC_ARCH environment variable,
- or through the --with-petsc-arch flag])
+ specified in the PETSC_ARCH environment variable])
fi
- ])
- fi
+ else
+ AC_MSG_ERROR([If PETSc is used, you must specify the architectur
+ either through the PETSC_ARCH environment variable,
+ or through the --with-petsc-arch flag])
+ 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"
+ AC_MSG_RESULT($PETSC_VERSION)
])
enable-shared = @enableshared@
DEAL_II_MAJOR = @DEAL_II_MAJOR@
DEAL_II_MINOR = @DEAL_II_MINOR@
+
USE_CONTRIB_HSL = @USE_CONTRIB_HSL@
+
USE_CONTRIB_PETSC = @USE_CONTRIB_PETSC@
DEAL_II_PETSC_DIR = @DEAL_II_PETSC_DIR@
DEAL_II_PETSC_ARCH = @DEAL_II_PETSC_ARCH@
+DEAL_II_PETSC_VERSION_MAJOR = @DEAL_II_PETSC_VERSION_MAJOR@
+DEAL_II_PETSC_VERSION_MINOR = @DEAL_II_PETSC_VERSION_MINOR@
+DEAL_II_PETSC_VERSION_SUBMINOR = @DEAL_II_PETSC_VERSION_SUBMINOR@
+
USE_CONTRIB_METIS = @USE_CONTRIB_METIS@
DEAL_II_METIS_DIR = @DEAL_II_METIS_DIR@
+
TECIO_INCLUDE = @TECPLOT_INCLUDE_PATH@
TECIO_LIBRARY = @TECPLOT_LIBRARY_PATH@
+
TARGET = @target@
# if HSL sublibs are used, add F77 libs to linker flags
ac_unique_file="deal.II"
ac_subdirs_all="$ac_subdirs_all contrib tests"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DEAL_II_VERSION DEAL_II_MAJOR DEAL_II_MINOR DEAL_II_PATH DEAL2_DIR build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GXX_VERSION CXXFLAGSG CXXFLAGSO CXXFLAGSPIC SHLIBLD LDFLAGSPIC enablemultithreading withmultithreading F77 F77_VERSION F77FLAGSO F77FLAGSG F77FLAGSPIC F77LIBS enableshared lib_suffix AR RANLIB ac_ct_RANLIB enablemultigrid TECPLOT_LIBRARY_PATH TECPLOT_INCLUDE_PATH USE_CONTRIB_HSL USE_CONTRIB_PETSC DEAL_II_PETSC_DIR DEAL_II_PETSC_ARCH USE_CONTRIB_METIS DEAL_II_METIS_DIR kdocdir kdocversion DOXYGEN PERL subdirs LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DEAL_II_VERSION DEAL_II_MAJOR DEAL_II_MINOR DEAL_II_PATH DEAL2_DIR build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GXX_VERSION CXXFLAGSG CXXFLAGSO CXXFLAGSPIC SHLIBLD LDFLAGSPIC enablemultithreading withmultithreading F77 F77_VERSION F77FLAGSO F77FLAGSG F77FLAGSPIC F77LIBS enableshared lib_suffix AR RANLIB ac_ct_RANLIB enablemultigrid TECPLOT_LIBRARY_PATH TECPLOT_INCLUDE_PATH USE_CONTRIB_HSL USE_CONTRIB_PETSC DEAL_II_PETSC_DIR DEAL_II_PETSC_ARCH DEAL_II_PETSC_VERSION_MAJOR DEAL_II_PETSC_VERSION_MINOR DEAL_II_PETSC_VERSION_SUBMINOR USE_CONTRIB_METIS DEAL_II_METIS_DIR kdocdir kdocversion DOXYGEN PERL subdirs LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
fi
- if test "$USE_CONTRIB_PETSC" = "yes" ; then
- echo "$as_me:$LINENO: checking for PETSc library architecture" >&5
+ if test "$USE_CONTRIB_PETSC" = "yes" ; then
+
+ echo "$as_me:$LINENO: checking for PETSc library architecture" >&5
echo $ECHO_N "checking for PETSc library architecture... $ECHO_C" >&6
if test "${with_petsc_arch+set}" = set; then
withval="$with_petsc_arch"
- DEAL_II_PETSC_ARCH=$withval
- echo "$as_me:$LINENO: result: $DEAL_II_PETSC_ARCH" >&5
+ DEAL_II_PETSC_ARCH=$withval
+ echo "$as_me:$LINENO: result: $DEAL_II_PETSC_ARCH" >&5
echo "${ECHO_T}$DEAL_II_PETSC_ARCH" >&6
- if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
- ; then
- { { echo "$as_me:$LINENO: error: PETSc has not been compiled for the architecture
- specified with --with-petsc-arch" >&5
+ if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
+ ; then
+ { { echo "$as_me:$LINENO: error: PETSc has not been compiled for the architecture
+ specified with --with-petsc-arch" >&5
echo "$as_me: error: PETSc has not been compiled for the architecture
- specified with --with-petsc-arch" >&2;}
+ specified with --with-petsc-arch" >&2;}
{ (exit 1); exit 1; }; }
- fi
+ fi
else
- if test "x$PETSC_ARCH" != "x" ; then
- DEAL_II_PETSC_ARCH="$PETSC_ARCH"
- echo "$as_me:$LINENO: result: $DEAL_II_PETSC_ARCH" >&5
+ if test "x$PETSC_ARCH" != "x" ; then
+ DEAL_II_PETSC_ARCH="$PETSC_ARCH"
+ echo "$as_me:$LINENO: result: $DEAL_II_PETSC_ARCH" >&5
echo "${ECHO_T}$DEAL_II_PETSC_ARCH" >&6
- if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
- ; then
- { { echo "$as_me:$LINENO: error: PETSc has not been compiled for the architecture
- specified in the PETSC_ARCH environment variable" >&5
+ if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \
+ ; then
+ { { echo "$as_me:$LINENO: error: PETSc has not been compiled for the architecture
+ specified in the PETSC_ARCH environment variable" >&5
echo "$as_me: error: PETSc has not been compiled for the architecture
- specified in the PETSC_ARCH environment variable" >&2;}
+ specified in the PETSC_ARCH environment variable" >&2;}
{ (exit 1); exit 1; }; }
- fi
- else
- { { echo "$as_me:$LINENO: error: If PETSc is used, you must specify the architectur
- either through the PETSC_ARCH environment variable,
- or through the --with-petsc-arch flag" >&5
+ fi
+ else
+ { { echo "$as_me:$LINENO: error: If PETSc is used, you must specify the architectur
+ either through the PETSC_ARCH environment variable,
+ or through the --with-petsc-arch flag" >&5
echo "$as_me: error: If PETSc is used, you must specify the architectur
- either through the PETSC_ARCH environment variable,
- or through the --with-petsc-arch flag" >&2;}
+ either through the PETSC_ARCH environment variable,
+ or through the --with-petsc-arch flag" >&2;}
{ (exit 1); exit 1; }; }
- fi
+ fi
fi;
+
+
+ echo "$as_me:$LINENO: checking for PETSc version" >&5
+echo $ECHO_N "checking for PETSc version... $ECHO_C" >&6
+
+ 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"
+ echo "$as_me:$LINENO: result: $PETSC_VERSION" >&5
+echo "${ECHO_T}$PETSC_VERSION" >&6
+
fi
+
+
+
echo "$as_me:$LINENO: checking for Metis library directory" >&5
echo $ECHO_N "checking for Metis library directory... $ECHO_C" >&6
s,@USE_CONTRIB_PETSC@,$USE_CONTRIB_PETSC,;t t
s,@DEAL_II_PETSC_DIR@,$DEAL_II_PETSC_DIR,;t t
s,@DEAL_II_PETSC_ARCH@,$DEAL_II_PETSC_ARCH,;t t
+s,@DEAL_II_PETSC_VERSION_MAJOR@,$DEAL_II_PETSC_VERSION_MAJOR,;t t
+s,@DEAL_II_PETSC_VERSION_MINOR@,$DEAL_II_PETSC_VERSION_MINOR,;t t
+s,@DEAL_II_PETSC_VERSION_SUBMINOR@,$DEAL_II_PETSC_VERSION_SUBMINOR,;t t
s,@USE_CONTRIB_METIS@,$USE_CONTRIB_METIS,;t t
s,@DEAL_II_METIS_DIR@,$DEAL_II_METIS_DIR,;t t
s,@kdocdir@,$kdocdir,;t t
AC_SUBST(USE_CONTRIB_PETSC)
AC_SUBST(DEAL_II_PETSC_DIR)
AC_SUBST(DEAL_II_PETSC_ARCH)
+AC_SUBST(DEAL_II_PETSC_VERSION_MAJOR)
+AC_SUBST(DEAL_II_PETSC_VERSION_MINOR)
+AC_SUBST(DEAL_II_PETSC_VERSION_SUBMINOR)
DEAL_II_CONFIGURE_METIS
AC_SUBST(USE_CONTRIB_METIS)
# have now centralized this part to one single place, and are back to where
# we want to be: have different libraries for debug and optimized mode,
# but in the same directory. And, voila, our build system works again :-)
+ #
+ # There is one gotcha: PETSc has a habit of making incompatible changes by
+ # simply changing the names of libraries between different versions. That
+ # really is too bad, so we have to conditionalize things.
lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/lib/libg_c++/$(DEAL_II_PETSC_ARCH)
lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/lib/libO_c++/$(DEAL_II_PETSC_ARCH)
- xlib.g = $(lib-contrib-petsc-path.g)/libpetscsles.so \
+ifeq (DEAL_II_PETSC_VERSION_MINOR,1)
+ xlib-ksp=libpetscsles
+else
+ xlib-ksp=libpetscksp
+endif
+ xlib.g = $(lib-contrib-petsc-path.g)/$(xlib-ksp).so \
$(lib-contrib-petsc-path.g)/libpetscdm.so \
$(lib-contrib-petsc-path.g)/libpetscmat.so \
$(lib-contrib-petsc-path.g)/libpetscvec.so \
$(lib-contrib-petsc-path.g)/libpetsc.so
- xlib.o = $(lib-contrib-petsc-path.o)/libpetscsles.so \
+ xlib.o = $(lib-contrib-petsc-path.o)/$(xlib-ksp).so \
$(lib-contrib-petsc-path.o)/libpetscdm.so \
$(lib-contrib-petsc-path.o)/libpetscmat.so \
$(lib-contrib-petsc-path.o)/libpetscvec.so \