ADD: templating to fix hierarchical module for users
This commit is contained in:

parent
8b657a6026
commit
24cbe4db11
20
templates/user_hierachical_paths.lua
Normal file
20
templates/user_hierachical_paths.lua
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends "modules/modulefile.lua" %}
|
||||
{% block footer %}
|
||||
|
||||
local user_module_root= pathJoin(os.getenv("SPACK_ROOT"), "../user", os.getenv("USER"), "spack-install/modulefiles")
|
||||
|
||||
{% if 'mpi' in provides %}
|
||||
local user_projection= "{{ spec.architecture }}/{{ spec.name }}/{{ version_part }}/{{ spec.compiler.name }}/{{ spec.compiler.version }}"
|
||||
{% elif 'compiler' in provides %}
|
||||
local user_projection= "{{ spec.architecture }}/{{ spec.name }}/{{ spec.version }}"
|
||||
{% endif %}
|
||||
|
||||
|
||||
if user_projection then
|
||||
local user_path= pathJoin(user_module_root, user_projection)
|
||||
if isDir(user_path) then
|
||||
prepend_path("MODULEPATH", user_path, ":")
|
||||
end
|
||||
end
|
||||
|
||||
{% endblock %}
|
Reference in New Issue
Block a user