Modules

In order to handle the many different software packages that are available here at ICS, we use a system called Modules. The Modules package is a system that will allow you to easily set your shell environment by selecting from different software packages.

If you require any software packages not available via this command, please see our software library page on how to request it to be added.

Ubuntu Availability

In cases where Ubuntu has been deployed for research computing at ICS, it is because it has a faster release cycle and a larger software package library (via apt install) than CentOS7. Since reasonably modern versions of most software packages are available on Ubuntu packages found in the ICS software library are more almost exclusively compiled on CentOS7 hosts for CentOS7 hosts and these packages may behave unpredictably on Ubuntu systems.

Persistently Adding A Module

This is probably the piece of information you came here for. In order to add a module to your environment such that it persists across logins, use the command :

module initadd <module_name>

The initadd sub command updates your shell rc file. For instance, if you want to automatically load the sge, cuda and lates gcc module everytime you login, run:

Load the default version of SGE:

module initadd sge

Load the default version of cuda:

module initadd cuda

Load version 7 of gcc:

module initadd gcc/7.3.0

Introduction

Modules is a system for configuring and maintaining the shell and environment variables needed to use various software packages. The Modules system is easy to use, has a built-in help facility, and runs on many platforms under many operating system versions.

More importantly, Modules insulates you from the petty details of a package's installation. To use a software package, you usually have to add to your PATH and MANPATH variables, and you often have to set other application-specific or system variables as well. The Modules system frees you from having to know the precise pathnames to the various pieces of the package; from knowing what variables need to be set for the package to work; and from having to spend time tracking changes to all of this information.

The Basics of the Modules System

If you are using the bash shell, the following line contains the minimum code required in your shell configuration files:

source /opt/Modules/init/bash

You can see the different shell configuration files in our changing your shell page. Note that these lines should be the very first statements executed in the configuration files. This assures a well-configured environment for commands run later in your shell configuration files, as well as for later interactive sessions. Complete examples of a shell configuration files can be found on any ICS Linux server in:

/pkg/ics/etc/skel

Modules commands come first, to guarantee a well-configured environment for other commands. Every time you login, these commands are automatically executed and your environment is set up.

Useful Module Commands

Lists all of the modules available at ICS (Note: Some of these may not be available on your particular system):

module avail

Prints out a short description of modulename, including the changes to your environment:

module display modulename

Add a module to your environment so that it is persistently loaded on logins:

module initadd gcc/7.3.0

Add a module to your environment so that it is persistently loaded on logins:

module initadd <module_name>

Remove a module that persistently loads at login:

module initrm  <module_name>

Shows information about modulename. It is similar to the module display command:

module show modulename

Shows you where you can get help and report bugs with the software in the module:

module help modulename

Displays the list of modules that you have currently loaded:

module list

Loads the current default version for the software package modulename. If you need to use a different version, then run module load modulename/version:

module load modulename

Removes the specified module package from your shell environment.

module unload modulename

More Information about Modules

The ics-default module loads several commonly-used modules. You can add software packages to your environment by using the module load command, either interactively at the shell prompt or by adding the command to your shell configuration files. If you run the command interactively, it will affect your environment in that window for the current session only. If you wish the change to be permanent, you will need to add it to your shell configuration files. Following a few simple rules will let you personalize your environment safely: Modules commands should come before any direct setting of shell or environment variables. If you must assign a value to a variable that a module modifies (e.g. PATH and MANPATH), make sure you include the current value of that variable.

Using Modules Well

It is possible to make every command you will ever want to run available all the time, by loading all of the modules. This may seem desirable at first, but it has some drawbacks. Your environment will be needlessly bloated with packages you will rarely use. The negative effects of this are particularly noticeable when the man command has to search a long MANPATH. The time that it takes to login is increased since the system has to configure everything for each module you load. Some packages may be mutually incompatible or have undesireable interactions. Every shell you start (or window you open), executes your shell configuration files in order to load the PATH, MANPATH, and other variables needed. Running the module load command in a shell window only affects that shell.

Additional Information

Running the command:

module help

lists the options of the Modules system. There are UNIX man pages for Modules (man module) and for modulerun. There is also a man page (man modulefile) with information on writing your own module file. The author of Modules is John L. Furlani of SunSoft. He presented a paper, “Modules: Providing a Flexible User Environment,” at the USENIX LISA V conference held in San Diego, October 1991. The paper is available in the proceedings from that conference.

Specific Package Information

gcc

Please run the following command to see which versions of gcc are available:

module avail gcc

You may load, for example, 8.3.0 by running

module load gcc/8.3.0`

You may permanently load  gcc in your environment by running

 `module initadd gcc/8.3.0` 

Note: Not all versions work on all operating systems. For specific info please run

`module info gcc/8.3.0`

openjdk

At the time of writing, the latest version of OpenJDK is installed in /pkg/openjdk/17.02. Please use the following command to add it to your enviornment:

module load openjdk
commands/modules.txt · Last modified: 2022/02/23 08:43 by hans
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0