]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Upgraded: Configure script to migrate to PETSc 3.0.0
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Mar 2009 13:10:06 +0000 (13:10 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Mar 2009 13:10:06 +0000 (13:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@18530 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/common/Make.global_options.in
deal.II/doc/news/changes.h

index f0d32d7604157f37dc1fb57fc6e678cfc759ba84..162a5933887878d3d8f3c96f28823b109a8223e8 100644 (file)
@@ -5363,7 +5363,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC, dnl
 
           dnl Make sure that what was specified is actually correct
           if test ! -d $DEAL_II_PETSC_DIR/include \
-               -o ! -d $DEAL_II_PETSC_DIR/lib ; then
+               ; then
             AC_MSG_ERROR([Path to PETSc specified with --with-petsc does not
                          point to a complete PETSc installation])
          fi
@@ -5378,7 +5378,7 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC, dnl
 
           dnl Make sure that what this is actually correct
           if test ! -d $DEAL_II_PETSC_DIR/include \
-               -o ! -d $DEAL_II_PETSC_DIR/lib ; then
+               ; then
             AC_MSG_ERROR([The path to PETSc specified in the PETSC_DIR
                          environment variable does not
                          point to a complete PETSc installation])
@@ -5497,6 +5497,14 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_ARCH, dnl
         fi
         ;;
 
+      3.*)
+        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])
+        fi
+        ;;
+
       *)
         AC_MSG_ERROR([Unknown PETSc version])
        ;;
@@ -5559,10 +5567,9 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_MPIUNI_LIB, dnl
 ])
 
 
-
 dnl ------------------------------------------------------------
 dnl Check whether SLEPc is installed, and if so store the 
-dnl respective links
+dnl respective links
 dnl
 dnl Usage: DEAL_II_CONFIGURE_SLEPC
 dnl
@@ -5570,13 +5577,13 @@ dnl ------------------------------------------------------------
 AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
 [
   dnl First check for the SLEPc directory
-  AC_MSG_CHECKING(for SLEPc library directory)
+  AC_MSG_CHECKING(for SLEPc include directory)
 
   AC_ARG_WITH(slepc,
   [  --with-slepc=/path/to/slepc  Specify the path to the SLEPc installation,
-                          of which the include and library directories
-                          are subdirs; use this if you want to override
-                          the SLEPC_DIR environment variable.],
+                               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
@@ -5588,8 +5595,9 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
          AC_MSG_RESULT($DEAL_II_SLEPC_DIR)
 
           dnl Make sure that what was specified is actually correct
-          if test ! -d $DEAL_II_SLEPC_DIR/include \
-               -o ! -d $DEAL_II_SLEPC_DIR/lib ; then
+          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
@@ -5603,11 +5611,12 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
          AC_MSG_RESULT($DEAL_II_SLEPC_DIR)
 
           dnl Make sure that what this is actually correct
-          if test ! -d $DEAL_II_SLEPC_DIR/include \
-               -o ! -d $DEAL_II_SLEPC_DIR/lib ; then
+          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])
+                         environment variable does not point to a
+                         complete SLEPc installation])
          fi
         else
          USE_CONTRIB_SLEPC=no
@@ -5626,14 +5635,13 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
     dnl defining the string "DEAL_II_USE_SLEPC" for the preprocessor. If
     dnl we don't have no SLEPc, then it does not define this string.
     DEAL_II_DEFINE_DEAL_II_USE_SLEPC=DEAL_II_USE_SLEPC
-
   fi
 
-
   dnl If we have found SLEPc, determine additional pieces of data
-  if test "$USE_CONTRIB_SLEPC" = "yes" ; then
-    DEAL_II_CONFIGURE_SLEPC_VERSION
+  if test "$USE_CONTRIB_SLEPC" = "yes" \
+       ; then
     DEAL_II_CONFIGURE_SLEPC_ARCH
+    DEAL_II_CONFIGURE_SLEPC_VERSION
 
     dnl Finally set with_slepc if this hasn't happened yet
     if test "x$with_slepc" = "x" ; then
@@ -5645,8 +5653,9 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC, dnl
 
 
 dnl ------------------------------------------------------------
-dnl Figure out the architecture used for SLEPc, since that determines
-dnl where object and configuration files will be found.
+dnl Figure out the architecture used for SLEPc and if the 
+dnl library directory exists, since that determines where object
+dnl and configuration files will be found.
 dnl
 dnl Usage: DEAL_II_CONFIGURE_SLEPC_ARCH
 dnl
@@ -5657,8 +5666,8 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC_ARCH, dnl
 
   AC_ARG_WITH(slepc-arch,
   [  --with-slepc-arch=architecture  Specify the architecture for your SLEPc
-                          installation; use this if you want to override
-                          the SLEPC_ARCH environment variable.],
+                                  installation; use this if you want to  
+                                  override the SLEPC_ARCH environment variable.],
      [
         DEAL_II_SLEPC_ARCH="$withval"
        AC_MSG_RESULT($DEAL_II_SLEPC_ARCH)
@@ -5675,10 +5684,10 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC_ARCH, dnl
         fi
      ])
 
-
   if test "x$SLEPC_ARCH" != "x" ; then
     dnl Make sure that what was specified is actually correct.
-    if test ! -d $DEAL_II_SLEPC_DIR/lib/$DEAL_II_SLEPC_ARCH \
+    if test ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_SLEPC_ARCH \
+         -o ! -d $DEAL_II_SLEPC_DIR/$DEAL_II_SLEPC_ARCH/lib \
          ; then
       AC_MSG_ERROR([SLEPc has not been compiled for the architecture
                     specified with --with-slepc-arch])
@@ -5687,7 +5696,8 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC_ARCH, dnl
 
   dnl Then check that PETSc and SLEPc architectures are compatible 
   dnl ie. that they are the same.
-  if test "$DEAL_II_SLEPC_ARCH" != "$DEAL_II_PETSC_ARCH" ; then
+  if test "$DEAL_II_SLEPC_ARCH" != "$DEAL_II_PETSC_ARCH" \
+       ; then
          AC_MSG_ERROR([If SLEPc is used, you must specify the same 
                         architecture as your PETSc Installation either
                         through the SLEPC_ARCH environment variable,
@@ -5725,9 +5735,8 @@ AC_DEFUN(DEAL_II_CONFIGURE_SLEPC_VERSION, dnl
 
   dnl Then check that PETSc and SLEPc versions are compatible 
   dnl ie. that they are equivalent.
-  if test "${DEAL_II_PETSC_VERSION_MAJOR}"    != "${DEAL_II_SLEPC_VERSION_MAJOR}" \
-       -o "${DEAL_II_PETSC_VERSION_MINOR}"    != "${DEAL_II_SLEPC_VERSION_MINOR}" \
-       -o "${DEAL_II_PETSC_VERSION_SUBMINOR}" != "${DEAL_II_SLEPC_VERSION_SUBMINOR}" ; then
+  if test "${PETSC_VERSION}" != "${SLEPC_VERSION}" \
+       ; then
          AC_MSG_ERROR([If SLEPc is used, you must use the same version
                         number as your PETSc Installation])
   fi 
index a1a8c67831d064a2ac466e90b4527d62829e1da3..fd60f055c99eda5cfb5450fb10916669aa292147 100644 (file)
@@ -124,36 +124,53 @@ endif
 # 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
+# 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_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))
+  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  
+  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)),)
       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
 
-# similar (and simpler) for slepc
 ifeq ($(USE_CONTRIB_SLEPC),yes)
-  lib-contrib-slepc = $(DEAL_II_SLEPC_DIR)/lib/$(DEAL_II_SLEPC_ARCH)/libslepc$(lib-suffix)
+  lib-contrib-slepc    = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_SLEPC_ARCH)/lib/libslepc$(lib-suffix)
 endif
 
 # same for metis, except that there is only one library in that case
@@ -233,9 +250,13 @@ lib-deal2-3d.g = $(LIBDIR)/libdeal_II_3d.g$(lib-suffix)
 # environment variable, since the compiler will evaluate the value of
 # that anyway at compile time
 include-path-petsc           = $(DEAL_II_PETSC_DIR)/include
-include-path-petsc-bmake     = $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH)
+ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2)
+  include-path-petsc-bmake   = $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH)
+else
+  include-path-petsc-bmake   = $(DEAL_II_PETSC_DIR)/$(DEAL_II_PETSC_ARCH)/include
+endif
 include-path-slepc           = $(DEAL_II_SLEPC_DIR)/include
-include-path-slepc-bmake     = $(DEAL_II_SLEPC_DIR)/bmake/$(DEAL_II_SLEPC_ARCH)
+include-path-slepc-conf      = $(DEAL_II_SLEPC_DIR)/$(DEAL_II_SLEPC_ARCH)/conf
 include-path-trilinos        = $(DEAL_II_TRILINOS_INCDIR)
 include-path-metis           = $(DEAL_II_METIS_INCDIR)
 
@@ -263,7 +284,7 @@ ifeq ($(USE_CONTRIB_PETSC),yes)
 endif
 
 ifeq ($(USE_CONTRIB_SLEPC),yes)
-  INCLUDE += -I$(include-path-slepc) -I$(include-path-slepc-bmake)
+  INCLUDE += -I$(include-path-slepc) -I$(include-path-slepc-conf)
 endif
 
 ifeq ($(USE_CONTRIB_TRILINOS),yes)
@@ -290,10 +311,14 @@ ifeq ($(USE_CONTRIB_PETSC),yes)
   # set PETSC_DIR and PETSC_ARCH to be used in variables file
   PETSC_DIR  = $(DEAL_II_PETSC_DIR)
   PETSC_ARCH = $(DEAL_II_PETSC_ARCH)
-  ifeq ($(DEAL_II_PETSC_VERSION_MINOR),2)
-    include $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH)/variables
+  ifeq ($(DEAL_II_PETSC_VERSION_MAJOR),2)
+    ifeq ($(DEAL_II_PETSC_VERSION_MINOR),2)
+      include $(DEAL_II_PETSC_DIR)/bmake/$(DEAL_II_PETSC_ARCH)/variables
+    else
+      include $(DEAL_II_PETSC_DIR)/bmake/common/variables
+    endif
   else
-    include $(DEAL_II_PETSC_DIR)/bmake/common/variables
+    include $(DEAL_II_PETSC_DIR)/conf/variables
   endif
   CXXFLAGS.g += $(GCXX_PETSCFLAGS)
   CXXFLAGS.o += $(OCXX_PETSCFLAGS)
index df758d91085c8eadc8884a280594dd823f027d43..866f63a7e52b8e2a3ead4c4e06bb4d6661d97540 100644 (file)
@@ -158,6 +158,15 @@ inconvenience this causes.
 <h3>General</h3>
 
 <ol>
+  <li>
+  <p>
+  Updated: Configure mechanism and a few PETSc functions in the lac directory 
+  have been upgraded to support migration to PETSc version >=3.0.0 in anaology
+  to the existing interface.
+  <br>
+  (Toby D. Young 2009/03/31)
+  </p>
+
   <li>
   <p>
   New: A new tutorial program  @ref step_34 "step-34" was added to the 
@@ -282,7 +291,7 @@ inconvenience this causes.
   <li>
   <p> 
   New: The deal.II configure script now autodetects SLEPc, an eigenvalue
-  solver.
+  solver. Currently on SLEPc versions >=3.0.0 are supported.
   <br>
   (Toby D. Young 2008/11/27)
   </p>

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.