Manage software with “modules”

In the good old days shared servers or HPC clusters gave the possibility to have a software shelf using “modules”. This can be still a valid alternative in shared machines.

Andrea Telatin
#!/ngs/sh
2 min readJun 12, 2020

--

Miniconda became the most popular package manager among bioinformaticians, with the dedicaded “BioConda” channel serving 8.000 packages. Its popularity relies on the ease of installation of the manager itself, that does not require administration privileges.

Conda, however, is essentialy a per user solution, and it’s not easy to make shared conda installations (and sometimes it’s not even convenient to try to do so).

What is a module?

In simple words, it’s a path that you add to your own $PATH. But it’s easy to add and remove that path and it will have a nice nickname.

How to use modules

The commands to use modules are quite straightforward:

  • module avail will list the available modules
  • module load modulename will activate a package
  • module unload modulename will deactivate it

How to install module

This old software is widely available, for example in Ubuntu can be installed with sudo apt-get install -y environment-modules . To enable it a user has to add the following to its .bashrc (automatically done typing add.modules but would still require customization):

How to make a module

A module is essentially a text file placed in your $MODULEPATH directory(ies):

A common practice is to save it as modulename-0.1 so that it’s easy to have multiple versions of the same software.

To activate it just type module load modulename-0.1 .

The optional parts are triggered with the following commands:

  • module help modulename-0.1 (will print the help message)
  • module whatis modulename-0.1 (will print the descriptions)

The autocompletion support is fantastic, and tabbing will help loading and unloading your modules with ease.

--

--