spack/lib/spack
Xavier Delaruelle 41d7fe0a50
modules tcl: fix autoload mechanism in template (#36237)
Adapt tcl modulefile template to call "module load" on autoload
dependency without testing if this dependency is already loaded or not.

The is-loaded test is not necessary, as module commands know how to cope
with an already loaded module. With environment-modules 4.2+ (released
in 2018) it is also important to have this "module load" command even if
dependency is already loaded in order to record that the modulefile
declares such dependency. This is important if you want to keep a
consistent environment when a dependent module is unloaded.

The "Autoloading" verbose message is also removed as recent module
commands will report such information to the user (depending on the
verbosity configured for the module command).

Such change has been test successfully with Modules 3.2 (EL7), 4.5 (EL8)
and 5.2 (latest) and also with Lmod 7 and 8 (as it is mentionned in
Spack docs that Lmod can be used along with tcl modules). Dependencies
are correctly loaded or unloaded, whether they are loaded/unloaded or
not.

This change fixes Tcl quoting issue introduced in #32853.

Fixes #19155.
2023-03-20 09:23:40 +01:00
..
docs Fix case spelling for Lmod and Tcl (#36215) 2023-03-19 01:42:50 +00:00
env compiler wrapper: parse Wl and Xlinker properly (#35912) 2023-03-08 09:03:31 +01:00
external license year bump (#34921) 2023-01-18 14:30:17 -08:00
llnl Windows: properly handle symlink failures (#36003) 2023-03-17 10:19:32 -07:00
spack modules tcl: fix autoload mechanism in template (#36237) 2023-03-20 09:23:40 +01:00
spack_installable license year bump (#34921) 2023-01-18 14:30:17 -08:00