diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2018-01-17 14:14:45 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-01-17 14:14:45 -0800 |
commit | c2a10a2aa23f3905ee22bb4b7c79ab963d966a9d (patch) | |
tree | 18d502edbbc09b8f9cf255697bd135e9718fb584 /templates/modules/modulefile.tcl | |
parent | 52a9e5d2a31b4a66ce51d0ff03ab709417dee6dc (diff) | |
parent | ba6c39310b537bbeafd4eb00836623ac2bb19d99 (diff) | |
download | spack-0.11.0.tar.gz spack-0.11.0.tar.bz2 spack-0.11.0.tar.xz spack-0.11.0.zip |
Merge branch 'releases/v0.11.0'v0.11.0
Diffstat (limited to 'templates/modules/modulefile.tcl')
-rw-r--r-- | templates/modules/modulefile.tcl | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/templates/modules/modulefile.tcl b/templates/modules/modulefile.tcl new file mode 100644 index 0000000000..833d8bf6c2 --- /dev/null +++ b/templates/modules/modulefile.tcl @@ -0,0 +1,82 @@ +#%Module1.0 +## Module file created by spack (https://github.com/spack/spack) on {{ timestamp }} +## +## {{ spec.short_spec }} +## +{% if configure_options %} +## Configure options: {{ configure_options }} +## +{% endif %} + + +{% block header %} +{% if short_description %} +module-whatis "{{ short_description }}" +{% endif %} + +{% if long_description %} +proc ModulesHelp { } { +{{ long_description| textwrap(72)| quote()| prepend_to_line('puts stderr ')| join() }} +} +{% endif %} +{% endblock %} + +{% block autoloads %} +{% for module in autoload %} +if ![ is-loaded {{ module }} ] {{ '{' }} +{% if verbose %} + puts stderr "Autoloading {{ module }}" +{% endif %} + module load {{ module }} +{{ '}' }} +{% endfor %} +{% endblock %} +{# #} +{% block prerequisite %} +{% for module in prerequisites %} +prereq {{ module }} +{% endfor %} +{% endblock %} +{# #} +{% block conflict %} +{% for name in conflicts %} +conflict {{ name }} +{% endfor %} +{% endblock %} + +{% block environment %} +{% for command_name, cmd in environment_modifications %} +{% if cmd.separator != ':' %} +{# A non-standard separator is required #} +{% if command_name == 'PrependPath' %} +prepend-path --delim "{{ cmd.separator }}" {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'AppendPath' %} +append-path --delim "{{ cmd.separator }}" {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'RemovePath' %} +remove-path --delim "{{ cmd.separator }}" {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'SetEnv' %} +setenv --delim "{{ cmd.separator }}" {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'UnsetEnv' %} +unsetenv {{ cmd.name }} +{% endif %} +{% else %} +{# We are using the usual separator #} +{% if command_name == 'PrependPath' %} +prepend-path {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'AppendPath' %} +append-path {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'RemovePath' %} +remove-path {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'SetEnv' %} +setenv {{ cmd.name }} "{{ cmd.value }}" +{% elif command_name == 'UnsetEnv' %} +unsetenv {{ cmd.name }} +{% endif %} +{# #} +{% endif %} +{% endfor %} +{% endblock %} + +{% block footer %} +{# In case he module needs to be extended with custom TCL code #} +{% endblock %} |