Files
spack-psi/templates/user_hierachical_paths.lua
svcusr-spack (Resp. Germann Elsa Sylvia) 5aafd5e07a FIX: hardcode user path in lua module extension
2025-03-20 15:54:23 +01:00

21 lines
649 B
Lua

{% extends "modules/modulefile.lua" %}
{% block footer %}
local user_module_root= pathJoin("/afs/psi.ch/sys/spack/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 %}