Hello Antoine,
Selection commands (like load, load-any, etc) take glob characters
(like *) verbatim. Changing them to resolve glob characters may have
some global impact. At the moment I am not sure whether this a good or
bad idea.
To provide an immediate solution, you may use the following shell
syntax to get what you want:
module load-any $(module avail -o "" -t netcdf/*/gnu)
You may also organize your modulefiles differently, for instance by
relying on external modules that when loaded implies a given version
of the module you want to load. In your example, you may have a "gnu"
module with versions "11.4.1", "13.2.0". When loaded, if you load the
"netcdf" module, you will automatically select the version
corresponding to the compiler module loaded. You end up with a single
"netcdf/4.9.3" modulefile expressing its dependencies this way:
prereq gnu/11.4.1 gnu/13.2.0 llvm/19.1.7 nvhpc/24.5 nvhpc/25.1
prereq openmpi/5.0.6
prereq hdf5/1.14.3
To achieve what you want, you then execute the following command (to
direct the load toward the gnu compiler)
module load gnu netcdf
Best regards,
Xavier
Le jeu. 27 févr. 2025 à 14:44, ANTOINE MORVAN via Modules-interest
<mod...@li...> a écrit :
>
> Hello,
>
>
>
> I am using module files to test various versions of compilers and libraries. I name my modules <lib name>/<lib version>/<compiler name>/<compiler version>/<other deps>. For instance, I play with NetCDF 4.9.3 built with various compilers :
>
>
>
> netcdf/4.9.3/gnu/11.4.1/openmpi/5.0.6/hdf5/1.14.3 netcdf/4.9.3/nvhpc/24.5/openmpi/5.0.6/hdf5/1.14.3
>
> netcdf/4.9.3/gnu/13.2.0/openmpi/5.0.6/hdf5/1.14.3 netcdf/4.9.3/nvhpc/25.1/openmpi/5.0.6/hdf5/1.14.3
>
> netcdf/4.9.3/llvm/19.1.7/openmpi/5.0.6/hdf5/1.14.3
>
>
>
> My need is to load any of these NetCDF that has been built with GCC (any version), or other constraints. I found a way to search using wildcards (module search netcdf/*/gnu), but the load-any command does not accept such patterns. According to the stable documentation, only 4 commands (avail list save-list what-is) accept a pattern. Would it be possible to add support for pattern in the load command, or to the load-any (I believe it makes more sense to add the support in the later), in order for “module load-any netcdf/*/gnu” to load something ?
>
>
>
> Best regards,
>
> Antoine Morvan.
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
|