]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
i. Allow configure to work with petsc-3.1; ii. Removed rogue reference to unsupported...
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 30 Mar 2010 09:14:58 +0000 (09:14 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 30 Mar 2010 09:14:58 +0000 (09:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@20925 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/common/Make.global_options.in
deal.II/lac/Makefile
deal.II/lib/Makefile

index 7c13c3e741b704419cd4d8b5d793d6f4275044b9..5824b9199480bda61c07e283a8d68a9f052a85e5 100644 (file)
@@ -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" \
index 01dc004362ac053e72846c9c3c1320e51db6ac7d..7ff04c54e1a122f2b19e9598539999d3bc2b346a 100644 (file)
@@ -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)
index 57a1c482acf30087bfaa22aa0d5781b0fdf06707..8d1d0eeeae1806b2afd437df7f5432dca560b3ca 100644 (file)
@@ -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)
index 714f6ec82aa9b426d9f9bfbb54a6efeda6688567..7861a669dbaa9287031dd388508ac893cf5265a5 100644 (file)
@@ -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)
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.