From: wolf Date: Tue, 7 Jun 2005 20:21:18 +0000 (+0000) Subject: Support PETSc 2.3.0 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e3dd3057f83d44232c4852d674bca4671dd1393;p=dealii-svn.git Support PETSc 2.3.0 git-svn-id: https://svn.dealii.org/trunk@10849 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index f98bf9ce4a..439eadf38e 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -4446,8 +4446,8 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC, dnl dnl If we have found PETSc, determine additional pieces of data if test "$USE_CONTRIB_PETSC" = "yes" ; then - DEAL_II_CONFIGURE_PETSC_ARCH DEAL_II_CONFIGURE_PETSC_VERSION + DEAL_II_CONFIGURE_PETSC_ARCH dnl Finally set with_petsc if this hasn't happened yet if test "x$with_petsc" = "x" ; then @@ -4492,20 +4492,38 @@ AC_DEFUN(DEAL_II_CONFIGURE_PETSC_ARCH, dnl if test "x$PETSC_ARCH" != "x" ; then - 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 - dnl Check whether PETSc is installed but someone has simply - dnl forgotten to also compile for C++ - if test -d $DEAL_II_PETSC_DIR/lib/libg/$DEAL_II_PETSC_ARCH \ - ; then - AC_MSG_ERROR([PETSc has not been compiled for C++, but - deal.II needs this]) - else - AC_MSG_ERROR([PETSc has not been compiled for the architecture - specified with --with-petsc-arch]) - fi - fi + dnl Make sure that what was specified is actually correct. to be sure, + dnl petsc changed the locations where they store their libraries + dnl sometime in the middle... + case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in + 2.2*) + if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \ + ; then + dnl Check whether PETSc is installed but someone has simply + dnl forgotten to also compile for C++ + if test -d $DEAL_II_PETSC_DIR/lib/libg/$DEAL_II_PETSC_ARCH \ + ; then + AC_MSG_ERROR([PETSc has not been compiled for C++, but + deal.II needs this]) + else + AC_MSG_ERROR([PETSc has not been compiled for the architecture + specified with --with-petsc-arch]) + fi + fi + ;; + + 2.3*) + if test ! -d $DEAL_II_PETSC_DIR/lib/$DEAL_II_PETSC_ARCH \ + ; then + AC_MSG_ERROR([PETSc has not been compiled for the architecture + specified with --with-petsc-arch]) + fi + ;; + + *) + AC_MSG_ERROR([Unknown PETSc version]) + ;; + esac fi ]) diff --git a/deal.II/configure b/deal.II/configure index 4b8b5e365b..b0931bbc6b 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -9083,6 +9083,23 @@ _ACEOF if test "$USE_CONTRIB_PETSC" = "yes" ; then + 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 + + echo "$as_me:$LINENO: checking for PETSc library architecture" >&5 echo $ECHO_N "checking for PETSc library architecture... $ECHO_C" >&6 @@ -9095,48 +9112,12 @@ if test "${with_petsc_arch+set}" = set; then 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 - if test -d $DEAL_II_PETSC_DIR/lib/libg/$DEAL_II_PETSC_ARCH \ - ; then - { { echo "$as_me:$LINENO: error: PETSc has not been compiled for C++, but - deal.II needs this" >&5 -echo "$as_me: error: PETSc has not been compiled for C++, but - deal.II needs this" >&2;} - { (exit 1); exit 1; }; } - else - { { 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;} - { (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 echo "${ECHO_T}$DEAL_II_PETSC_ARCH" >&6 - - if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \ - ; then - if test -d $DEAL_II_PETSC_DIR/lib/libg/$DEAL_II_PETSC_ARCH \ - ; then - { { echo "$as_me:$LINENO: error: PETSc has not been compiled for C++, but - deal.II needs this" >&5 -echo "$as_me: error: PETSc has not been compiled for C++, but - deal.II needs this" >&2;} - { (exit 1); exit 1; }; } - else - { { 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;} - { (exit 1); exit 1; }; } - fi - fi else { { echo "$as_me:$LINENO: error: If PETSc is used, you must specify the architecture either through the PETSC_ARCH environment variable, @@ -9150,21 +9131,46 @@ echo "$as_me: error: If PETSc is used, you must specify the architecture fi; - echo "$as_me:$LINENO: checking for PETSc version" >&5 -echo $ECHO_N "checking for PETSc version... $ECHO_C" >&6 + if test "x$PETSC_ARCH" != "x" ; then + case "${DEAL_II_PETSC_VERSION_MAJOR}.${DEAL_II_PETSC_VERSION_MINOR}.${DEAL_II_PETSC_VERSION_SUBMINOR}" in + 2.2*) + if test ! -d $DEAL_II_PETSC_DIR/lib/libg_c++/$DEAL_II_PETSC_ARCH \ + ; then + if test -d $DEAL_II_PETSC_DIR/lib/libg/$DEAL_II_PETSC_ARCH \ + ; then + { { echo "$as_me:$LINENO: error: PETSc has not been compiled for C++, but + deal.II needs this" >&5 +echo "$as_me: error: PETSc has not been compiled for C++, but + deal.II needs this" >&2;} + { (exit 1); exit 1; }; } + else + { { 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;} + { (exit 1); exit 1; }; } + fi + fi + ;; - 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 + 2.3*) + if test ! -d $DEAL_II_PETSC_DIR/lib/$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;} + { (exit 1); exit 1; }; } + fi + ;; + + *) + { { echo "$as_me:$LINENO: error: Unknown PETSc version" >&5 +echo "$as_me: error: Unknown PETSc version" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + fi if test "x$with_petsc" = "x" ; then @@ -9196,9 +9202,6 @@ if test "x$with_lapack" != "x" ; then fi -echo $with_petsc -echo $enableshared - if test "x$with_petsc" != "x" ; then if test "x$enableshared" = "xno" ; then with_blas="yes"