From fa389365e5cdf9c24a30bfca218ad8fa0d6760eb Mon Sep 17 00:00:00 2001 From: young Date: Tue, 30 Mar 2010 09:14:58 +0000 Subject: [PATCH] i. Allow configure to work with petsc-3.1; ii. Removed rogue reference to unsupported petsc version 2.2 in common/Make.global_options.in git-svn-id: https://svn.dealii.org/trunk@20925 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 10 ++--- deal.II/common/Make.global_options.in | 65 ++++++++++++--------------- deal.II/lac/Makefile | 1 - deal.II/lib/Makefile | 31 ++++++++++--- 4 files changed, 60 insertions(+), 47 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 7c13c3e741..5824b91994 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -5834,7 +5834,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_ARCH, dnl 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]) @@ -5874,8 +5874,8 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_VERSION, dnl 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 @@ -5904,7 +5904,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_MPIUNI_LIB, dnl 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 @@ -5935,7 +5935,7 @@ dnl ------------------------------------------------------------ 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" \ diff --git a/deal.II/common/Make.global_options.in b/deal.II/common/Make.global_options.in index 01dc004362..7ff04c54e1 100644 --- a/deal.II/common/Make.global_options.in +++ b/deal.II/common/Make.global_options.in @@ -120,51 +120,44 @@ endif # -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) diff --git a/deal.II/lac/Makefile b/deal.II/lac/Makefile index 57a1c482ac..8d1d0eeeae 100644 --- a/deal.II/lac/Makefile +++ b/deal.II/lac/Makefile @@ -42,7 +42,6 @@ source/%.inst : source/%.inst.in $D/common/template-arguments \ @echo "=====lac============================= $(@F)" @$D/common/scripts/expand_instantiations $D/common/template-arguments < $< > $@ - # rules lib: $(LIBDIR)/liblac.g$(lib-suffix) $(LIBDIR)/liblac$(lib-suffix) libg: $(LIBDIR)/liblac.g$(lib-suffix) diff --git a/deal.II/lib/Makefile b/deal.II/lib/Makefile index 714f6ec82a..7861a669db 100644 --- a/deal.II/lib/Makefile +++ b/deal.II/lib/Makefile @@ -43,17 +43,38 @@ ifeq ($(DEAL_II_PETSC_VERSION_MINOR),1) 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) -- 2.39.5