Refactor environment setup.

- Gave setup_environment and setup_dependent_environment more similar
  signatures. They now allows editing the Spack env and the runtime
  env for *this* package and dependents, respectively.

- modify_module renamed to setup_dependent_python_module for symmetry
  with setup_dependent_environment and to avoid confusion with
  environment modules.

- removed need for patching Package objects at runtime.

- adjust packages to reflect these changes.
This commit is contained in:
Todd Gamblin
2016-03-21 01:48:18 -07:00
parent e88df95b42
commit 439d47b4e4
9 changed files with 150 additions and 96 deletions

View File

@@ -41,17 +41,13 @@ class Openmpi(Package):
def url_for_version(self, version):
return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version)
def setup_environment(self, env):
env.set_env('OMPI_CC', self.compiler.cc)
env.set_env('OMPI_CXX', self.compiler.cxx)
env.set_env('OMPI_FC', self.compiler.fc)
env.set_env('OMPI_F77', self.compiler.f77)
def setup_dependent_environment(self, env, dependent_spec):
env.set_env('OMPI_CC', spack_cc)
env.set_env('OMPI_CXX', spack_cxx)
env.set_env('OMPI_FC', spack_fc)
env.set_env('OMPI_F77', spack_f77)
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
spack_env.set_env('OMPI_CC', spack_cc)
spack_env.set_env('OMPI_CXX', spack_cxx)
spack_env.set_env('OMPI_FC', spack_fc)
spack_env.set_env('OMPI_F77', spack_f77)
def install(self, spec, prefix):
config_args = ["--prefix=%s" % prefix,