Environment modules
In order to provide multiple versions of software compiled with different and varying libraries, we use modules. Modules allow us to add and remove software from our $PATH using a simple
modulecommand.
Common usage
module avail [name]View all the modules on the HPC system filtered byname.module listView currently loaded modulesmodule load moduleNameLoad the module denoted bymoduleNamemodule purgeUnload all loaded modulefiles
Loading the R module
First we want to take a look at what R modules are available. To do that issue:
module avail R
[john@discovery ~]$ module avail R
--------------------------- /dartfs-hpc/admin/opt/modules/el8 ----------------------------
R/4.3 R/4.3.3 R/4.4 R/4.4.0(default)
As you can see from this output there are multiple versions of R available. The one with (default) next to it is the default module and will be picked unless you specify the full path. For example, if I wanted R/4.4 I would issue:
module load R/4.4
If I did not care about what version I recieved then I can just issue module load R.
module load R
Once you have loaded the module you would like you can issue module list to see what you have currently loaded.
module list
[john@discovery ~]$ module load R
[john@discovery ~]$ module list
Currently Loaded Modulefiles:
1) R/4.0.4
Since I did not specify a version, the module command pulled in the (default) version of R, which happens to be R/4.4.0