Skip to content

Searching software modules

This page contains a basic overview of common interactions with the module system. For a guided tutorial, please see our Introduction to the Module System.

General search using module spider

To search for a particular software module (e.g. "ABC"), you would run

1
module spider ABC # can also be abc, ABc...

Once you find it, and want to load a specific version (say 1.1.1), run

1
module spider ABC/1.1.1 # should only be ABC

The resulting output information will tell you what prerequisites modules are needed before loading your ABC/1.1.1.

Searching with a partial name

You don't need to know the full name of the software. For example, let's search for all modules related to VCF:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$ module spider vcf

------------------------
  VCFtools:
------------------------
    Description:
      The aim of VCFtools...

     Versions:
        VCFtools/0.1.15-Perl-5.26.0
        VCFtools/0.1.15-Perl-5.26.1
        VCFtools/0.1.15-Perl-5.28.0

------------------------
  For detailed information...

     $ module spider VCFtools/0.1.15-Perl-5.28.0
------------------------

------------------------
  vcflib: vcflib/1.0.2
------------------------
    Description:
      vcflib provides...


    You will need to load all module(s) on any one of the lines below before the "vcflib/1.0.2" module is available to load.

      GCC/10.2.0

    Help:
      ...

The output of module spider may also suggest other ways to search for modules.

See the example for PCRE below, which suggests both "other possible module matches" and "other possible module matches."

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
$ module spider PCRE

--------------------------
  PCRE:
--------------------------
    Description:
      The PCRE library...

     Versions:
        PCRE/8.38
        ...
        PCRE/8.41
     Other possible modules matches:
        PCRE2

--------------------------
  To find other possible module matches execute:

      $ module -r spider '.*PCRE.*'

--------------------------

Loading a specific version

In this example, we want to load HDF5 version 1.10.7. To learn how to load this module, run:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
$ module spider HDF5/1.10.7

--------------------------
  HDF5: HDF5/1.10.7
--------------------------
    Description:
      HDF5 is...


    You will need to load all module(s) on any one of the lines below before the "HDF5/1.10.7" module is available to load.

      GCC/10.2.0  CUDA/11.1.1  OpenMPI/4.0.5
      GCC/10.2.0  OpenMPI/4.0.5
      GCC/10.3.0  OpenMPI/4.1.1
      iccifort/2020.1.217  impi/2019.7.217
      iccifort/2020.4.304  impi/2019.9.304

Each line of the above about gives a different set of dependencies. Let's pick the third line, which requires GCC version 10.3.0 and OpenMPI version 4.1.1.

To load HDF5 1.10.7, run

1
2
3
module purge # a MUST-HAVE
module load GCC/10.3.0 OpenMPI/4.1.1
module load HDF5/1.10.7

Note that module purge is always needed before you start loading your own modules. This command will clear the default modules and prevent version conflicts.

Saving and restoring module sets

Your currently loaded modules can be saved for easy access at a later time.

To save your modules, run

1
module save <collection_name>
where <collection_name> is replaced with your desired name.

You can then re-load this collection of modules with

1
module restore <collection_name>

To see all saved collections, use

1
module savelist

To see the contents of a collection, use

1
module describe <collection_name>

A saved collection can be removed with

1
module disable <collection_name>

Advanced skill: Searching for modules in module file hierarchy using "module avail"

If you start with a minimum set of loaded modules (most commonly a compiler-MPI pair, or a compiler alone), and want to know what software packages are available to load in the current MODULEPATH (run echo $MODULEPATH to see the paths), you can run module avail.

module avail is different from module spider described above. The module spider command searches all possible modules, while module avail only shows those modules which can be seen in the current MODULEPATH.

To check the availability of a particular module, use module avail <keyword>. If the keyword (such as "openmpi") is long and distinct, the search output will normally be clean. However, for modules like "R" whose name is a single letter that can appear in almost any module names, we need to use regular expression to fully specify the pattern when running module avail. See below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
$ module purge
$ module load GCC/8.3.0 OpenMPI/3.1.4
$ module avail # a large amount of output will be printed on your screen and they are omitted here.

# Now we search for available R versions under the current GCC-OpenMPI pair.
$ module -r avail '^R$'
--------------------------------------- /opt/modules/MPI/GCC/8.3.0/OpenMPI/3.1.4 ----------------------------
   R/3.6.2    R/3.6.3    R/4.0.2.bak    R/4.0.2.test    R/4.0.2    R/4.1.0 (D)

  Where:
   D:  Default Module

Troubleshooting

Sometimes, module spider doesn't work because your personal module cache is out of date. To clear it, do rm -r ~/.lmod.d/.cache