summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-04-04 10:41:54 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-04-04 10:41:54 -0700
commit5084130e71e15b576748170ae56d56c6005aa1e8 (patch)
tree638346a7f95fa8fac47b8eeb9cdea53739052838
parenta8b856432a9a13737fdb2e77332e16602ef6d611 (diff)
parent79836520d989a19bc49b912698b22fdc8a65ca59 (diff)
downloadspack-5084130e71e15b576748170ae56d56c6005aa1e8.tar.gz
spack-5084130e71e15b576748170ae56d56c6005aa1e8.tar.bz2
spack-5084130e71e15b576748170ae56d56c6005aa1e8.tar.xz
spack-5084130e71e15b576748170ae56d56c6005aa1e8.zip
Merge pull request #715 from citibeth/efischer/160401-EnvironmentModules
Added Environment Modules
-rw-r--r--lib/spack/docs/basic_usage.rst28
-rw-r--r--var/spack/repos/builtin/packages/environment-modules/package.py38
-rw-r--r--var/spack/repos/builtin/packages/modules/package.py25
3 files changed, 66 insertions, 25 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/var/spack/repos/builtin/packages/environment-modules/package.py b/var/spack/repos/builtin/packages/environment-modules/package.py
new file mode 100644
index 0000000000..45181da41b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/environment-modules/package.py
@@ -0,0 +1,38 @@
+from spack import *
+
+
+class EnvironmentModules(Package):
+ """The Environment Modules package provides for the dynamic
+ modification of a user's environment via modulefiles."""
+
+ homepage = "https://sourceforge.net/p/modules/wiki/Home/"
+ url = "http://prdownloads.sourceforge.net/modules/modules-3.2.10.tar.gz"
+
+ version('3.2.10', '8b097fdcb90c514d7540bb55a3cb90fb')
+
+ # Dependencies:
+ depends_on('tcl')
+
+ def install(self, spec, prefix):
+ tcl_spec = spec['tcl']
+
+ # See: https://sourceforge.net/p/modules/bugs/62/
+ CPPFLAGS = ['-DUSE_INTERP_ERRORLINE']
+ config_args = [
+ "--without-tclx",
+ "--with-tclx-ver=0.0",
+ "--prefix=%s" % prefix,
+ "--with-tcl=%s" % join_path(tcl_spec.prefix, 'lib'), # It looks for tclConfig.sh
+ "--with-tcl-ver=%d.%d" % (tcl_spec.version.version[0], tcl_spec.version.version[1]),
+ '--disable-debug',
+ '--disable-dependency-tracking',
+ '--disable-silent-rules',
+ '--disable-versioning',
+ '--datarootdir=%s' % prefix.share,
+ 'CPPFLAGS=%s' % ' '.join(CPPFLAGS)
+ ]
+
+
+ configure(*config_args)
+ make()
+ make('install')
diff --git a/var/spack/repos/builtin/packages/modules/package.py b/var/spack/repos/builtin/packages/modules/package.py
deleted file mode 100644
index b014ee460c..0000000000
--- a/var/spack/repos/builtin/packages/modules/package.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from spack import *
-
-class Modules(Package):
- """ The Environment Modules package provides for the dynamic modification of a user's environment via modulefiles. """
-
- homepage = "http://modules.sf.net"
- url = "http://downloads.sourceforge.net/project/modules/Modules/modules-3.2.10/modules-3.2.10.tar.gz"
-
- version('3.2.10', '8b097fdcb90c514d7540bb55a3cb90fb')
-
- depends_on("tcl")
-
- def install(self, spec, prefix):
-
- options = ['--prefix=%s' % prefix,
- '--disable-debug',
- '--disable-dependency-tracking',
- '--disable-silent-rules',
- '--disable-versioning',
- '--datarootdir=%s' % prefix.share,
- 'CPPFLAGS=-DUSE_INTERP_ERRORLINE']
-
- configure(*options)
- make()
- make("install")