AC_MSG_ERROR([PETSc has not been compiled for the architecture specified with --with-petsc-arch])
fi
;;
- 3.0*) dnl
+ 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])
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;'`
+ | grep "#define PETSC_VERSION_RELEASE" \
+ | perl -pi -e 's/.*RELEASE\s+//g;'`
if test "$PETSC_VERSION_RELEASE" = "0" ; then
PETSC_VERSION+="-dev"
else
DEAL_II_PETSC_MPIUNI_LIB="$DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH/libmpiuni.a"
fi
;;
- 3.0*) dnl
+ 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
AC_DEFUN(DEAL_II_CONFIGURE_PETSC_COMPLEX, dnl
[
case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in
- 3.0.1)
+ 3.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" \
# -Wl,-rpath in our linker flags, we create one convenience library
# for all PETSc libraries in our own lib directory, and have this one
# twiddle with whatever is necessary to link in PETSc.
-#
-# to make things more fun, the whole scheme was changed in petsc 2.3.0
-# and then again in petsc 3.0.0
-#
-# also sort of annoying is the fact that on Mac OS X, the trick with the
-# one library doesn't appear to work. Instead of a single library, we therefore
-# have to list all of them, at least if we are using shared libs.
ifeq ($(USE_CONTRIB_PETSC),yes)
ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2)
- ifeq ($(DEAL_II_PETSC_VERSION_MINOR),2)
- 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)
- else
- lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)
- lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)
- endif
- ifeq ($(findstring darwin,$(TARGET)),)
- lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix)
- lib-contrib-petsc.o = $(LIBDIR)/libpetscall$(lib-suffix)
- else
- ifeq ($(enable-shared),yes)
- lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix))
- lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix))
- else
- lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix)
- lib-contrib-petsc.o = $(LIBDIR)/libpetscall$(lib-suffix)
- endif
- endif
+ lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)
+ lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)
else
lib-contrib-petsc-path.g = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib
lib-contrib-petsc-path.o = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib
- ifeq ($(findstring darwin,$(TARGET)),)
+ endif
+
+ # First up is a twiddle for Darwin/MacOSX
+ ifeq ($(findstring darwin,$(TARGET)),)
+ lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix)
+ lib-contrib-petsc.o = $(LIBDIR)/libpetscall$(lib-suffix)
+ else
+ ifeq ($(enable-shared),yes)
+ # Starting with PETSc versions 2.3.*:
+ ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2)
+ lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix))
+ lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/lib/$(DEAL_II_PETSC_ARCH)/*$(lib-suffix))
+ else
+ # which is the same for PETSc 3.0.0:
+ ifeq ($(DEAL_II_PETSC_VERSION_MAJOR)$(DEAL_II_PETSC_VERSION_MINOR),30)
+ lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix))
+ lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix))
+ else
+ # but after that (petsc-3.1++), we can use the simpler PETSc
+ # default "--with-single-library=1" like this:
+ lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix))
+ lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libpetsc$(lib-suffix))
+ endif
+ endif # if PETSC_VERSION
+ else
+ # and finally this goes for static libraries
lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix)
lib-contrib-petsc.o = $(LIBDIR)/libpetscall$(lib-suffix)
- else
- ifeq ($(enable-shared),yes)
- lib-contrib-petsc.g = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix))
- lib-contrib-petsc.o = $(shell echo $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/*$(lib-suffix))
- else
- lib-contrib-petsc.g = $(LIBDIR)/libpetscall.g$(lib-suffix)
- lib-contrib-petsc.o = $(LIBDIR)/libpetscall$(lib-suffix)
- endif
endif
endif
-endif
+endif # USE_CONTRIB_PETSC
ifeq ($(USE_CONTRIB_SLEPC),yes)
lib-contrib-slepc = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_PETSC_ARCH)/lib/libslepc$(lib-suffix)
else
xlib-ksp=libpetscksp
endif
-
- xlib.g = $(lib-contrib-petsc-path.g)/$(xlib-ksp)$(lib-suffix) \
- $(lib-contrib-petsc-path.g)/libpetscdm$(lib-suffix) \
+ # This is how it is done. Starting with PETSc versions 2.3.*:
+ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2)
+ xlib.g = $(lib-contrib-petsc-path.g)/libpetscksp$(lib-suffix) \
+ $(lib-contrib-petsc-path.g)/libpetscdm$(lib-suffix) \
$(lib-contrib-petsc-path.g)/libpetscmat$(lib-suffix) \
$(lib-contrib-petsc-path.g)/libpetscvec$(lib-suffix) \
$(lib-contrib-petsc-path.g)/libpetsc$(lib-suffix)
- xlib.o = $(lib-contrib-petsc-path.o)/$(xlib-ksp)$(lib-suffix) \
- $(lib-contrib-petsc-path.o)/libpetscdm$(lib-suffix) \
+ xlib.o = $(lib-contrib-petsc-path.o)/libpetscksp$(lib-suffix) \
+ $(lib-contrib-petsc-path.o)/libpetscdm$(lib-suffix) \
$(lib-contrib-petsc-path.o)/libpetscmat$(lib-suffix) \
$(lib-contrib-petsc-path.o)/libpetscvec$(lib-suffix) \
$(lib-contrib-petsc-path.o)/libpetsc$(lib-suffix)
+else
+ # which is the same for PETSc 3.0.0:
+ ifeq ($(DEAL_II_PETSC_VERSION_MAJOR)$(DEAL_II_PETSC_VERSION_MINOR),30)
+ xlib.g = $(lib-contrib-petsc-path.g)/libpetscksp$(lib-suffix) \
+ $(lib-contrib-petsc-path.g)/libpetscdm$(lib-suffix) \
+ $(lib-contrib-petsc-path.g)/libpetscmat$(lib-suffix) \
+ $(lib-contrib-petsc-path.g)/libpetscvec$(lib-suffix) \
+ $(lib-contrib-petsc-path.g)/libpetsc$(lib-suffix)
+ xlib.o = $(lib-contrib-petsc-path.o)/libpetscksp$(lib-suffix) \
+ $(lib-contrib-petsc-path.o)/libpetscdm$(lib-suffix) \
+ $(lib-contrib-petsc-path.o)/libpetscmat$(lib-suffix) \
+ $(lib-contrib-petsc-path.o)/libpetscvec$(lib-suffix) \
+ $(lib-contrib-petsc-path.o)/libpetsc$(lib-suffix)
+ else
+ # but after that (petsc-3.1++), we can use the simpler PETSc
+ # default "--with-single-library=1" like this:
+ xlib.g = $(lib-contrib-petsc-path.o)/libpetsc$(lib-suffix)
+ xlib.o = $(lib-contrib-petsc-path.o)/libpetsc$(lib-suffix)
+ endif
+endif
ifeq ($(enable-shared),yes)