diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2017-01-07 19:38:53 -0600 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-01-07 17:38:53 -0800 |
commit | a0195371e886e93110816209b118e994a497805c (patch) | |
tree | 5135a9d352310869699abfaf4ddb54eb3f43d045 | |
parent | b7fdc03bd5e1c79d250de2a874f14a8864beb90d (diff) | |
download | spack-a0195371e886e93110816209b118e994a497805c.tar.gz spack-a0195371e886e93110816209b118e994a497805c.tar.bz2 spack-a0195371e886e93110816209b118e994a497805c.tar.xz spack-a0195371e886e93110816209b118e994a497805c.zip |
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
-rw-r--r-- | var/spack/repos/builtin/packages/petsc/package.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 578349cbc4..7d51bbad48 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -218,6 +218,16 @@ class Petsc(Package): '-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') |