diff options
author | Jim Galarowicz <jeg@krellinst.org> | 2016-04-04 17:07:53 -0700 |
---|---|---|
committer | Jim Galarowicz <jeg@krellinst.org> | 2016-04-04 17:07:53 -0700 |
commit | 9d2ef9f4533dbeb38f226f7820469aca35831651 (patch) | |
tree | 1befb0a1bd92e322e59b8a192e239ad910c66831 /lib | |
parent | 6ebed7a2a6488a857fc6878c2d39d26ce9bc72f5 (diff) | |
parent | 0296f96c7b5279b2dd9cf585a493f21e3344fe2b (diff) | |
download | spack-9d2ef9f4533dbeb38f226f7820469aca35831651.tar.gz spack-9d2ef9f4533dbeb38f226f7820469aca35831651.tar.bz2 spack-9d2ef9f4533dbeb38f226f7820469aca35831651.tar.xz spack-9d2ef9f4533dbeb38f226f7820469aca35831651.zip |
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/docs/basic_usage.rst | 28 | ||||
-rw-r--r-- | lib/spack/spack/build_environment.py | 3 |
2 files changed, 30 insertions, 1 deletions
diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 72a02802fb..68f3d07b29 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -794,6 +794,34 @@ Environment modules Spack provides some limited integration with environment module systems to make it easier to use the packages it provides. + +Installing Environment Modules +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In order to use Spack's generated environment modules, you must have +installed the *Environment Modules* package. On many Linux +distributions, this can be installed from the vendor's repository. +For example: ```yum install environment-modules`` +(Fedora/RHEL/CentOS). If your Linux distribution does not have +Environment Modules, you can get it with Spack: + +1. Install with:: + + spack install environment-modules + +2. Activate with:: + + MODULES_HOME=`spack location -i environment-modules` + MODULES_VERSION=`ls -1 $MODULES_HOME/Modules | head -1` + ${MODULES_HOME}/Modules/${MODULES_VERSION}/bin/add.modules + +This adds to your ``.bashrc`` (or similar) files, enabling Environment +Modules when you log in. It will ask your permission before changing +any files. + +Spack and Environment Modules +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + You can enable shell support by sourcing some files in the ``/share/spack`` directory. diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index f4f8037ac0..eb72f2a6b4 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -304,7 +304,7 @@ def setup_package(pkg): # traverse in postorder so package can use vars from its dependencies spec = pkg.spec - for dspec in pkg.spec.traverse(order='post'): + for dspec in pkg.spec.traverse(order='post', root=False): # If a user makes their own package repo, e.g. # spack.repos.mystuff.libelf.Libelf, and they inherit from # an existing class like spack.repos.original.libelf.Libelf, @@ -321,6 +321,7 @@ def setup_package(pkg): dpkg.setup_dependent_package(pkg.module, spec) dpkg.setup_dependent_environment(spack_env, run_env, spec) + set_module_variables_for_package(pkg, pkg.module) pkg.setup_environment(spack_env, run_env) # Make sure nothing's strange about the Spack environment. |