From: David Wells Date: Tue, 28 Mar 2023 20:30:47 +0000 (-0400) Subject: Correctly unset PETSc environment variables. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F337%2Fhead;p=candi.git Correctly unset PETSc environment variables. --- diff --git a/candi.sh b/candi.sh index 749a3a8..b798c4e 100755 --- a/candi.sh +++ b/candi.sh @@ -160,6 +160,11 @@ WARN="\033[1;35m" INFO="\033[1;34m" BOLD="\033[1m" +################################################################################ +# Ensure that no PETSc environment variables are set. +unset PETSC_DIR +unset PETSC_ARCH + ################################################################################ # Define candi helper functions diff --git a/deal.II-toolchain/packages/petsc.package b/deal.II-toolchain/packages/petsc.package index 310ae0b..56191ec 100644 --- a/deal.II-toolchain/packages/petsc.package +++ b/deal.II-toolchain/packages/petsc.package @@ -120,9 +120,13 @@ package_specific_setup () { cd ${BUILDDIR} cp -rf ${UNPACK_PATH}/${EXTRACTSTO}/* . - # make sure no other invalid PETSC_DIR is set: + # Make sure we don't pick up any environment copies of PETSc variables. This + # duplicates the same unset commands in candi.sh to ensure that, should this + # function run as a shell script (i.e., not with the source command), they + # are not reset by .bash_profile or some other shell initialization script. unset PETSC_DIR - + unset PETSC_ARCH + ${PYTHON_INTERPRETER} ./configure --prefix=${INSTALL_PATH} ${CONFOPTS} COPTFLAGS="${OPTFLAGS}" CXXOPTFLAGS="${OPTFLAGS}" FOPTFLAGS="${OPTFLAGS}" quit_if_fail "petsc ./configure failed"