summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/spack/templates/modules/modulefile.tcl10
1 files changed, 9 insertions, 1 deletions
diff --git a/share/spack/templates/modules/modulefile.tcl b/share/spack/templates/modules/modulefile.tcl
index 577c40e47c..52d987da61 100644
--- a/share/spack/templates/modules/modulefile.tcl
+++ b/share/spack/templates/modules/modulefile.tcl
@@ -26,9 +26,17 @@ proc ModulesHelp { } {
{% endblock %}
{% block autoloads %}
+{% if autoload|length > 0 %}
+if {![info exists ::env(LMOD_VERSION_MAJOR)]} {
{% for module in autoload %}
-module load {{ module }}
+ module load {{ module }}
{% endfor %}
+} else {
+{% for module in autoload %}
+ depends-on {{ module }}
+{% endfor %}
+}
+{% endif %}
{% endblock %}
{# #}
{% block prerequisite %}