Unset PETSC_DIR during installation (#2768)

* Set PETSC_DIR during installation

* Move env var unsets to setup_environment

* Fix unset var name and number of args
This commit is contained in:
Adam J. Stewart 2017-01-07 19:38:53 -06:00 committed by Todd Gamblin
parent b7fdc03bd5
commit a0195371e8

View File

@ -218,6 +218,16 @@ def install(self, spec, prefix):
'-pc_type', 'hypre',
'-pc_hypre_type', 'boomeramg')
def setup_environment(self, spack_env, run_env):
# configure fails if these env vars are set outside of Spack
spack_env.unset('PETSC_DIR')
spack_env.unset('PETSC_ARCH')
# Set PETSC_DIR in the module file
run_env.set('PETSC_DIR', self.prefix)
run_env.unset('PETSC_ARCH')
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# set up PETSC_DIR for everyone using PETSc package
# Set up PETSC_DIR for everyone using PETSc package
spack_env.set('PETSC_DIR', self.prefix)
spack_env.unset('PETSC_ARCH')