Skip to content

How to find and load software modules

General search using module spider

To search for a particular software module (say ABC), you would run

1
module spider ABC # can also be abc, ABc... since the name is case-insensitive

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. You don't need to know the full name of the software. See below (note the third case about PCRE).

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
$ module spider sam

--------------------------
  SAMtools:
--------------------------
    Description:
      SAM Tools provide various utilities for manipulating alignments in
      the SAM format, including sorting, merging, indexing and generating
      alignments in a per-position format.

     Versions:
        SAMtools/0.1.19
        SAMtools/1.5
        SAMtools/1.7
        SAMtools/1.8
        SAMtools/1.9

--------------------------
  For detailed information about a specific "SAMtools" module (including how to load the modules) use the module's full name.
  For example:

     $ module spider SAMtools/1.7
--------------------------



$ module spider amtool

--------------------------
  BamTools:
--------------------------

    Description:
      BamTools provides both a programmer's API and an end-user's toolkit
      for handling BAM files.

     Versions:
        BamTools/2.4.1
        BamTools/2.5.1


--------------------------
  SAMtools:
--------------------------

    Description:
      SAM Tools provide various utilities for manipulating alignments in
      the SAM format, including sorting, merging, indexing and generating
      alignments in a per-position format.

     Versions:
        SAMtools/0.1.19
        SAMtools/1.5
        SAMtools/1.7
        SAMtools/1.8
        SAMtools/1.9


$ module spider PCRE

--------------------------
  PCRE:
--------------------------
    Description:
      The PCRE library is a set of functions that implement regular
      expression pattern matching using the same syntax and semantics as
      Perl 5.

     Versions:
        PCRE/8.38
        PCRE/8.39
        PCRE/8.40
        PCRE/8.41
     Other possible modules matches:
        PCRE2

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

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

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

Example of loading R

In this example, we are looking for available versions of R.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
$ ssh dev-intel18
$ module spider R
-----------
  R:
-----------
    Description:
      R is a free software environment for statistical computing and graphics.

     Versions:
        R/3.3.1
        ...
        ...
        R/4.0.2
        R/4.0.3
        R/4.1.0
        R/4.1.2

Suppose we want to load R/4.1.2, and in order to know how, we run

1
2
3
4
5
6
7
8
9
$ module spider R/4.1.2

    Description:
      R is a free software environment for statistical computing and graphics.


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

      GCC/11.2.0  OpenMPI/4.1.1

Above output tells us to load two prerequisites (GCC/11.2.0 and OpenMPI/4.1.1) before loading R. Therefore, we'll run

1
2
3
module purge # a MUST-HAVE
module load GCC/11.2.0  OpenMPI/4.1.1
module load R/4.1.2

You are all set. Note that "module purge" is always needed before you start loading a different software module.

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 $MODULEPATHto see the paths), you can run module avail. module avail is different from module spider above (which lists all possible modules, not just the modules that can be seen in the current MODULEPATH). To check availability of a particular module, use module avail keyword. If the keyword (such as "openmpi") is long and distinct, the search result would normally be clean. However, for "R" for example, 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