I have been a while in Fedora and other Linuxes, and I got used to loading "environment modules".
For example, in Fedora, I could install both mpich
and openmpi
(two implementations of the same library, MPI), and I can switch between the two by doing load module mpich
or load module openmpi
.
In Ubuntu, instead, the two libraries coexist, for example, with different executables, mpirun.mpich
or mpirun.openmpi
.
Both approaches have their pros and cons, but can I configure Ubuntu to do modules instead?
Moreover, I just installed NVHPC (Nvidia compiler, etc.), and after manual installation (from a tar file), I saw the message:
...
generating environment modules for NV HPC SDK 23.7 ... done.
Installation complete.
HPC SDK successfully installed into /opt/nvidia/hpc_sdk
If you use the Environment Modules package, that is, the module load
command, the NVIDIA HPC SDK includes a script to set up the
appropriate module files.
% module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.7
% module load nvhpc/23.7
Alternatively, the shell environment may be initialized to use the HPC SDK. ...
In this case, it would be very handy to be able to use modules instead of setting a lot of environment variables or polluting .bashrc
.
How can I configure Ubuntu to use these modules that were apparently just generated by the installation script?
Of course, the command module
doesn't work at the moment.
$ module load nvhpc/23.7
module: command not found
environment-modules
package? It's in theuniverse
repository - see How do I enable the "Universe" repository? if you're unsure. – steeldriver Oct 29 '23 at 11:49family("mpi")
to the different modules means that only one can be loaded. – Victor Eijkhout Oct 29 '23 at 12:54$ sudo apt install environment-modules
) I get an error with$ module load nvhpc/23.7
->module: command not found
– alfC Oct 29 '23 at 16:48Lmod
in Ubuntu? – alfC Oct 29 '23 at 16:49. /etc/profile
to start using themodule
command. – alfC Oct 30 '23 at 02:46