User Environment

An introduction to the user environment on the Linux hosts at the department as well as the module framework for software offered.

Home Directories, Shells and Modules

Home directories ($HOME) are accessible from any of the computers belonging to the department of Mathematics, except on HPC. An environment variable called $HOME is defined and contains the absolute path of a user home directory: use this environment variable whenever possible.

The default shell at the Department of Mathematics is bash.


Using Modules to Manage Access to Software

On europa and other machines running Red Hat Enterprise Linux 7, users should not have to modify their path directly.  Instead, the module utility is used to set environment variables for software and libraries, including a lot of software that is loaded by default.  Simply ``load'' and ``unload'' modules to control your environment. 

Modules environment management package provides support for dynamic modification of the user environment via modulefiles. Each modulefile contains all the information needed to configure the shell for a particular application. Typically, a modulefile modifies environment variables like PATH, MANPATH, LD_LIBRARY_PATH and XXXX_HOME (where XXX is the name of a software/library in capital letter) to give access to an application or library. 

Command Description
module list Lists modules currently loaded in a user’s environment
module avail Lists all available modules on a system in condensed format
module avail -l Lists all available modules on a system in long format
module display Shows environment changes that will be made by loading a given module
module load Loads a module
module unload Unloads a module
module help Shows help for a module
module swap Swaps a currently loaded module for an unloaded module

What is loaded now?

[europa ~]$  module list

Currently Loaded Modulefiles:
  1) matinst   2) use.own


What is available?

To see which modulefiles are available on your system, enter this command:


[europa ~]$  module avail [string]


The module avail command produces an alphabetical listing of every modulefile in your module use path and has no option for "grepping." Therefore, it is usually more useful to use the command with an string argument:


[europa ~]$  module avail python

----------------------------------------------------------------- /opt/uio/modules/software ------------------------------------------------------------------
python/anaconda(default) python/canopy


Loading and Unloading Modules

If a modulefile is not already loaded, use the module load command to load:


[europa ~]$  module load netcdf


This command loads the currently defined default version of the module, unless you specify otherwise:


[europa ~]$  module load netcdf/4.2.0_intel


This will load the netcdf library compiled with intel compilers.


If you want to remove a software/library from your user environment you may unload it:


europa ~]$  module unload netcdf/4.2.0_intel


You need to unload the same version you previously loaded.


Module Swapping

Alternatively, you can use the module swap or module switch command to unload one module and load the comparable module:

europa ~]$  module load netcdf
europa ~]$  module list

Currently Loaded Modulefiles:
  1) matinst        2) use.own            3) netcdf/4.2.0_gnu
europa ~]$  module switch netcdf netcdf/4.2.0_intel
europa ~]$  module list

Currently Loaded Modulefiles:
  1) matinst        2) use.own            3) netcdf/4.2.0_intel


Adding your our modulefile

Create a directory called privatemodules in your home directory. Then type the command:

module load use.own

and any personal module files in this directory will become available for you to list, load or unload. As previously explained, you can add it to ~/.modulerc to load it automatically at login.

For more information see Modules Software Environment.


Cannot find the module command

If you get the message

module: command not found

contact drift[at] with the name of the machine on which it happens.

Missing software

If you have a need for software not available in the current module installation, let us know and we'll see what we can do.  An email to drift[at] is the easiest way to let us know.


The vast majority of this work, and indeed this document, would not be possible without the gracious assistance from the department of Geophysics and Anne Claire Fouilloux in particular.  

Published Sep. 1, 2014 6:45 PM - Last modified June 12, 2020 3:17 PM