From 220b0cbc2eb517c0e3b7b891a91ed396cc494d0a Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 28 Mar 2023 16:30:47 -0400 Subject: [PATCH] Correctly unset PETSc environment variables. --- candi.sh | 5 +++++ deal.II-toolchain/packages/petsc.package | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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" -- 2.39.5