Dear Achim,
Thanks for your message. I can reproduce the issue you describe on my
side. Even when defining the module-addpath procedure within the
modulefile.
>From a first quick analysis, it does not feel that this is the
indented behavior. I will need to investigate further down to find
what is going on.
Best regards,
Xavier
Le mer. 10 sept. 2025 à 10:57, Gsell, Achim <ach...@ps...> a écrit :
>
> Dear All,
>
> I'm currently playing with a hierarchical module structure, which is now supported in version 5.6. If I add a new directory to MODULEPATH in a modulefile itself, everything works fine. But as soon as I move the statement
>
> prepend-path MODULEPATH $something
>
> to a procedure inside my siteconfig.tcl file I run into two issues.
>
> First: The path $something is not removed from MODULEPATH while unloading the module.
>
> Second: module spider —indepth doesn’t show the modules in $something.
>
> Example:
>
> I have the following (simplified) modulefile for gcc/15.2.0:
>
> $ cat /afs/psi.ch/group/HPCE/Modules/Programming/modulefiles/gcc/15.2.0
> #%Module
>
> module-help "GCC compiler collection"
> module-addpath {/afs/psi.ch/group/HPCE/Modules/Compiler/modulefiles/gcc/15.2.0}
>
> In my siteconfig.tcl the procedure module-addpath is defined as:
>
> proc module-addpath { path } {
> prepend-path MODULEPATH $path
> }
>
> I have the following modulefiles:
>
> [gsell@merlin-c-002 ~]$ find /afs/psi.ch/group/HPCE/Modules/*/modulefiles -type f
> /afs/psi.ch/group/HPCE/Modules/Compiler/modulefiles/gcc/15.2.0/OpenBLAS/0.3.30
> /afs/psi.ch/group/HPCE/Modules/Programming/modulefiles/gcc/15.2.0
>
> and MODULEPATH is set to:
>
> [gsell@merlin-c-002 ~]$ echo $MODULEPATH
> /afs/psi.ch/group/HPCE/Modules/Programming/modulefiles
>
> The spider command should show the OpenBLAS module, but it doesn’t:
>
> [gsell@merlin-c-002 ~]$ module spider --indepth
> ------------ /afs/psi.ch/group/HPCE/Modules/Programming/modulefiles -------------
> gcc/15.2.0
>
> Key:
> modulepath
>
> After loading the gcc module, the OpenBLAS module is available, this is correct:
>
> [gsell@merlin-c-002 ~]$ module load gcc/15.2.0
> [gsell@merlin-c-002 ~]$ module avail
> -------- /afs/psi.ch/group/HPCE/Modules/Compiler/modulefiles/gcc/15.2.0 ---------
> OpenBLAS/0.3.30
>
> ------------ /afs/psi.ch/group/HPCE/Modules/Programming/modulefiles -------------
> gcc/15.2.0
> Key:
> loaded modulepath
> But after unloading the gcc module, the OpenBLAS module is still available:
>
> [gsell@merlin-c-002 ~]$ module unload gcc/15.2.0
> [gsell@merlin-c-002 ~]$ module avail
> -------- /afs/psi.ch/group/HPCE/Modules/Compiler/modulefiles/gcc/15.2.0 ---------
> OpenBLAS/0.3.30
>
> ------------ /afs/psi.ch/group/HPCE/Modules/Programming/modulefiles -------------
> gcc/15.2.0
>
> Key:
> modulepath
> and the added directory is still in MODULEPATH:
>
> [gsell@merlin-c-002 ~]$ echo $MODULEPATH
> /afs/psi.ch/group/HPCE/Modules/Compiler/modulefiles/gcc/15.2.0:/afs/psi.ch/group/HPCE/Modules/Programming/modulefiles
>
>
> If I replace in the gcc/15.2.0 modulefile
>
> module-addpath {/afs/psi.ch/group/HPCE/Modules/Compiler/modulefiles/gcc/15.2.0}
>
> with
>
> prepend-path MODULEPATH {/afs/psi.ch/group/HPCE/Modules/Compiler/modulefiles/gcc/15.2.0}
>
> everything works as expected.
>
> I’m not sure whether this behaviour is intended or a bug. If it is intended, how can I add something to MODULEPATH in a procedure?
>
> Best regards,
>
> Achim
>
>
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
|