From 0a36b5f67cf9d10f2d72f98dcb94eee3110aab3a Mon Sep 17 00:00:00 2001 From: schnetter Date: Sat, 1 Apr 2006 18:24:49 +0000 Subject: 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 --- PETSc.sh | 20 ++++++++++++++++++-- 1 file 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" -- cgit v1.2.3