Skip to content

Commit

Permalink
only set PETSC_DIR if it is not already set
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbybp committed Dec 14, 2023
1 parent 7228be4 commit 5f933ba
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scripts/compile_solvers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ export CC="gcc"
export CXX="g++"

# set PETSc location
if [ ${osname} = "windows" ]
then
export PETSC_DIR=/c/repo/petsc-dist
elif [ ${osname} = "darwin" ]; then
export PETSC_DIR="$HOME/src/petsc-dist"
else
export PETSC_DIR=/repo/petsc-dist
# These petsc environment variables are used by the makefile
# in the $IDAES_EXT/petsc subdirectory.
if [ -z $PETSC_DIR ]; then
# We only set PETSC_DIR if it is not already set. This is useful when
# running this script locally (i.e. not via Docker)
if [ ${osname} = "windows" ]
then
export PETSC_DIR=/c/repo/petsc-dist
elif [ ${osname} = "darwin" ]; then
export PETSC_DIR="$HOME/src/petsc-dist"
else
export PETSC_DIR=/repo/petsc-dist
fi
fi
export PETSC_ARCH=""

Expand Down

0 comments on commit 5f933ba

Please sign in to comment.