One solution would be to duplicate the module files for each arch, then a
presetup determines the path of modules to be enabled and you won't have to
make specific checks in module files. Of course this will duplicate module
files, but it will also allow easier debugging and changing global
variables per arch. I find this more convenient.
On Sat, 19 Mar 2022, 08:44 Michael Klemm, <mi...@do...> wrote:
> Folks,
>
> I have the following setup:
>
> /net/software/{x86_64,aarch64,armv7l,riscv} contains all software on
> shared storage. /net/software/modules/modulefiles contains the
> corresponding module files for these software packages, e.g.,
> clang/13.0.0, gcc/9.2.0, etc. The module files use the $ARCH
> environment variable to setup the environment for the software.
>
> Since I do not have all software packages compiled for all systems, I
> was wondering what would be the best way to avoid loading (or even
> better hide) modules that do not have the software package for a
> particular architecture?
>
> I have come up with either checking in the module file, if the software
> exists and if not throw some sort of error. I could also have
> $ARCH-specific module locations and use "module use" on these locations,
> depending on the machine I'm on. But is there a better way to automate
> all this w/o too much duplication of module files or code in the module
> files?
>
> I'm using Modules Release 4.4.1 (2020-01-03), all systems are Ubuntu
> systems.
>
> Kind regards,
> -michael
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
|