Environment Modules — RCG Handbook

Environment Modules

Quick Start

$ module avail
  ^-- run this first to see a list of all available software

$ module load LANG/PYTHON/2.7.13-SYSTEM
  ^-- use modules to place a newer Python in your $PATH

$ which python
  ^-- now if you run `python`, you'll get a v2.7.13

Advanced Commands

$ module list
  ^-- show what's currently loaded

$ module purge
  ^-- unload all environment modules

$ module unload LANG/PYTHON/2.7.13-SYSTEM
  ^-- unload a single environment module

$ module switch LANG/PYTHON/3.6.2-SYSTEM
  ^-- switch to a different version

I don’t see the software I want

E-mail research-support@sfu.ca if you have requests for additional software. Be sure to include a download URL and the hostname of your workstation.

How to I compile software against LIB/X?

Each module appends your INCLUDE_PATH and LD_LIBRARY_PATH where appropriate. Most clean, well-architected build scripts will pick these up automatically.

If you’re dealing with a stubborn configure or compile process, you can find the paths you’ll need to link or include by running module show:

$ module show LANG/PYTHON/3.6.2-SYSTEM
prepend-path     LD_LIBRARY_PATH /rcg/software/Linux/Ubuntu/16.04/amd64/LANG/PYTHON/3.6.2-SYSTEM/lib64
prepend-path     INCLUDE /rcg/software/Linux/Ubuntu/16.04/amd64/LANG/PYTHON/3.6.2-SYSTEM/include

Automatically loading modules at login

~/privatemodules/login is loaded automatically when spawning a new shell. To ensure the latest Python and emacs are available in all new shells:

cat > ~/privatemodules/login
module load TOOLS/EMACS/26.1
module load LANG/PYTHON/3.6.2-SYSTEM

It is not a good idea to add module load commands to your ~/.bashrc or ~/.bash_profile as this may break SFTP.

Why this crazy module stuff?

“Can’t you just install X on my workstation?”

Whenever possible, we make software available as environment modules to:

  1. Make it accessible to everyone.
  2. Free up time & avoid customizing workstations.
  3. Make it easy to switch between multiple versions of something.
  4. Mimic what supercomputing facilities do so it’s easier to start running your code on e.g., Cedar.