The etc/modulespath and etc/initrc configuration files are evaluated during
Modules initialization only if MODULEPATH and LOADEDMODULES environment
variables are found unset or empty.
When a module command is run, the ~/.modulerc file is evaluated. It happens
also for the autoinit command, which is run to initialize Modules.
So in your situation, during the initialization of Modules, MODULEPATH is
defined by ~/.modulerc commands, so the etc/modulespath file is not
processed.
I would recommend not to set MODULEPATH in ~/.modulerc file
(etc/modulespath, etc/initrc or collection files should be preferred to
define the modulepaths). But one way to workaround this issue is to update
~/.modulerc with the following code:
$ cat ~/.modulerc
#%Module
if {![module-info command autoinit]} {
module use --append /a/b/c
append-path MODULEPATH /d/e/f
}
Cheers,
Xavier
Le mar. 5 avr. 2022 à 23:59, Frank Thommen <f.t...@dk...> a
écrit :
> they are defined in etc/modulespath. If I leave ~/.modulerc empty,
> $MODULEPATH is $CENTRALLY_SET_MODULEPATHS
>
> On 05.04.22 17:45, Xav...@CE... wrote:
> > Hi Frank,
> >
> > Could you describe where and how the $CENTRALLY_SET_MODULEPATHS are
> > defined ?
> >
> > Cheers,
> > Xavier
> >
> >
> > On Tue, 2022-04-05 at 17:28 +0200, Frank Thommen wrote:
> >> Hi,
> >>
> >> this is most probably a silly error on my side, but I haven't found
> >> the
> >> solution: When having a custom ~/.modulerc with
> >>
> >> #%Module
> >> module use --append /a/b/c
> >> append-path MODULEPATH /d/e/f
> >>
> >> the resulting $MODULEPATH is "/a/b/c:/d/e/f". I would have
> >> expected it
> >> to be "$CENTRALLY_SET_MODULEPATHS:/a/b/c:/d/e/f". When only using
> >> `append-path` it looks similar:
> >>
> >> #%Module
> >> append-path MODULEPATH /d/e/f
> >>
> >> results in $MODULEPATH being "/d/e/f" instead of
> >> "$CENTRALLY_SET_MODULEPATHS:/d/e/f".
> >>
> >> This is with Modules 5.0.1 on CentOS 7.9 systems. We have not
> >> changed
> >> any of the other configuration files after the installation other
> >> than
> >> populating etc/modulespath with our central modulefile repository
> >> pathes.
> >>
> >> What have I overlooked?
> >>
> >> Cheers, Frank
> >>
> >
> > _______________________________________________
> > Modules-interest mailing list
> > Mod...@li...
> > https://lists.sourceforge.net/lists/listinfo/modules-interest
>
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
|