Add all compatible system types directory to module paths
fixes #12915 closes #12916 Since Spack has support for specific targets it might happen that software is built for targets that are not exactly the host because it was either an explicit user request or the compiler being used is too old to support the host. Modules for different targets are written into different directories and by default Spack was adding to MODULEPATH only the directory corresponding to the current host. This PR modifies this behavior to add all the directories that are **compatible** with the current host.
This commit is contained in:

committed by
Todd Gamblin

parent
d20e3517c2
commit
1b18ec90ab
@@ -26,8 +26,11 @@ if ($?SPACK_ROOT) then
|
||||
|
||||
# Set up modules and dotkit search paths in the user environment
|
||||
set tcl_roots = `echo $_sp_tcl_roots:q | sed 's/:/ /g'`
|
||||
set compatible_sys_types = `echo $_sp_compatible_sys_types:q | sed 's/:/ /g'`
|
||||
foreach tcl_root ($tcl_roots:q)
|
||||
_spack_pathadd MODULEPATH "$tcl_root/$_sp_sys_type"
|
||||
foreach systype ($compatible_sys_types:q)
|
||||
_spack_pathadd MODULEPATH "$tcl_root/$systype"
|
||||
end
|
||||
end
|
||||
|
||||
set dotkit_roots = `echo $_sp_dotkit_roots:q | sed 's/:/ /g'`
|
||||
|
@@ -350,7 +350,9 @@ _sp_multi_pathadd() {
|
||||
setopt sh_word_split
|
||||
fi
|
||||
for pth in $2; do
|
||||
_spack_pathadd "$1" "${pth}/${_sp_sys_type}"
|
||||
for systype in ${_sp_compatible_sys_types}; do
|
||||
_spack_pathadd "$1" "${pth}/${systype}"
|
||||
done
|
||||
done
|
||||
}
|
||||
_sp_multi_pathadd MODULEPATH "$_sp_tcl_roots"
|
||||
|
Reference in New Issue
Block a user