aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@fc86f234-e40e-4302-a95b-5e02f8c343c9>2006-04-01 18:24:49 +0000
committerschnetter <schnetter@fc86f234-e40e-4302-a95b-5e02f8c343c9>2006-04-01 18:24:49 +0000
commit0a36b5f67cf9d10f2d72f98dcb94eee3110aab3a (patch)
treea8b032f8bc8888b9d67bd0ac88b89325481a6736
parent57728aa4a31603a561cc3fdf5b510565d96a8d3b (diff)
Add some tests to make it work with PETSc 2.2.x and 2.3.x as well.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/PETSc/trunk@21 fc86f234-e40e-4302-a95b-5e02f8c343c9
-rwxr-xr-xPETSc.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/PETSc.sh b/PETSc.sh
index af1953e..231654a 100755
--- a/PETSc.sh
+++ b/PETSc.sh
@@ -96,10 +96,26 @@ if [ -z "$PETSC_ARCH_LIBS" ]; then
esac
fi
+# Set version-specific library directory
+# (version 2.3.0 and newer use different library directories)
+if [ -e "$PETSC_DIR/lib/$PETSC_ARCH" ]; then
+ PETSC_LIB_INFIX=''
+else
+ PETSC_LIB_INFIX='/libO'
+fi
+
+# Set version-specific libraries
+# (version 2.2.0 and newer do not have libpetscsles.a any more)
+if [ -e "$PETSC_DIR/lib$PETSC_LIB_INFIX/$PETSC_ARCH/libpetscksp.a" ]; then
+ PETSC_SLES_LIBS="petscksp"
+else
+ PETSC_SLES_LIBS="petscsles"
+fi
+
# Set the PETSc libs, libdirs and includedirs
PETSC_INC_DIRS='$(PETSC_DIR)/include $(PETSC_DIR)/bmake/$(PETSC_ARCH)'
-PETSC_LIB_DIRS='$(PETSC_DIR)/lib/libO/$(PETSC_ARCH)'
-PETSC_LIBS="petscts petscsnes petscsles petscdm petscmat petscvec petsc $PETSC_ARCH_LIBS"
+PETSC_LIB_DIRS='$(PETSC_DIR)/lib'$PETSC_LIB_INFIX'/$(PETSC_ARCH)'
+PETSC_LIBS="petscts petscsnes $PETSC_SLES_LIBS petscdm petscmat petscvec petsc $PETSC_ARCH_LIBS"
echo 'BEGIN MAKE_DEFINITION'
echo "PETSC_DIR = $PETSC_DIR"