Hi Martin,
When trying to load "localized-sofware", module evaluates:
* modulepath/.modulerc
* everything under modulepath/localized-sofware
So in your example, it cannot find any localized-software modules as they
are defined under modulepath/software/vendor.
One way to solve this, may be to source in modulepath/.modulerc any code
snippet found under the modulepath/software/vendor directories to execute
the module-virtual commands from the global .modulerc file of the
modulepath.
Best regards,
Xavier
Le lun. 4 avr. 2022 à 15:11, Bloecker, Martin <
Mar...@am...> a écrit :
> Hi Xavier and Mailing List Members,
>
>
>
> Following your advice I’m now trying to set up virtual modules for the two
> namespaces ‘vendor/software’ and ‘localized-software’. As mentioned earlier
> we want modules to be maintained in self-contained software-specific
> directories and thus would want to define these virtual modules in the same
> .modulerc file (e.g. $MODULEPATH/vendor/software/.modulerc). The example
> below demonstrates the current behavior. It references a copy of the ‘null’
> module file that comes with the modules installation:
>
>
>
> #%Module4.7
>
> # vim: set tabstop=4 expandtab shiftwidth=4 textwidth=80 wrapmargin=5 :
>
>
>
> # $MODULEPATH/vendor/software/.modulerc
>
> # module module
>
> # avail? loadable?
> comment
>
>
>
> module-virtual 1.0 null # no no no
> error message
>
> module-virtual /2.0 null # yes yes
> loads vendor/software/2.0
>
> module-virtual software/3.0 null # no no no
> error message
>
> module-virtual vendor/software/4.0 null # yes yes no
> error message
>
>
>
> module-virtual localized-software/5.0 null # yes no no
> error message
>
>
>
> # command below defines module 'localized-software/6.0'
>
> set ref_module [file join [ file dirname [ file normalize [ info script ]
> ] ] null]
>
> module-virtual localized-software/6.0 $ref_module
>
> null # yes no no
> error message
>
>
>
> The problem we encounter is that the virtual ‘localized-software’ modules
> are defined (i.e. are displayed by module avail) but cannot be loaded. In
> either case (relative or absolute module path definition) both
>
> module load localized-software/5.0
>
> and
>
> module load localized-software/6.0
>
> result in the error
>
> ERROR: Unable to locate a modulefile for 'localized-software'
>
>
>
> I know that this can be made to work when defining the virtual modules in
> the root .modulerc file but as mentioned above I’m looking for a
> ‘self-contained’ solution where all required module related code is under
> the same subdirectory. Is this possible somehow? If not: Shouldn’t parsing
> the .modulerc file issue a WARNING that virtual modules are being defined
> that later on will not/cannot be found?
>
>
>
> Best Regards,
>
>
>
> Martin
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
|