What are Modules?
Taken from the Modulefile manual page, "A typical modulefile is a simple bit of code that sets or adds entries to the PATH, MANPATH, or other environment variables." A Module is simply a way to easily organize and handle different pieces of software and different versions of the same software. This allows multiple versions of a popular package like Python to be available on the same system.
Looking to create your own modules? See User Created Modules for instructions.
While using CRC systems, software which is not included within a standard install of Red Hat Enterprise Linux must be loaded through a module. Matlab for example, cannot be ran on a front end or compute node within the CRC without first loading the matlab module.
$ matlab matlab: Command not found.
To use matlab, you must use the "module" command first. Running the module command alone will give a list of available options.
The above command on a CRC front end will print the following
Modules Release 4.1.0 (2018-01-15) Usage: module [options] [command] [args ...]
Loading / Unloading commands: add | load modulefile [...] Load modulefile(s) rm | unload modulefile [...] Remove modulefile(s) purge Unload all loaded modulefiles reload | refresh Unload then load all loaded modulefiles switch | swap [mod1] mod2 Unload mod1 and load mod2 ...
If it does not, you may need to make the necessary changes to the file "~/.cshrc" as shown in Configuring Your Environment
To see all available modules, type
$ module avail
To see if a specific module is available, type
$ module avail XYZ
where XYZ is the name of the software you are searching for.
There are different categories in which the Modules are organized: system_modules, deprecated_software, restricted_software, general_software, and development_tools_and_libraries.
- Modules within the restricted_software category cannot be used without first receiving permission to access those pieces of software.
- The deprecated category contains modules which are out of date or no longer being supported after the next biannual outage. The date of the next biannual outage can be found on the Main Page. These modules can still be used, however it is recommended to move your application to a newer version of the deprecated module.
Changing your environment with Modules
After using "module avail", there will be a list of programs from which you can use. Let's say we need to use matlab, the "load" option to the module command can be used to bring matlab into our environment. Simply type
$ module load matlab
Now you have the default matlab loaded and ready to use by just typing
If you need a specific version of a program and see it listed then you'd enter
$ module load program_name/x.x
where x.x is the version number.
You can see which modules currently have loaded with
$ module list
You can also remove modules from your environment that you don't need anymore with
$ module unload program_name
Note that upon logging in, by default, you will not have any modules loaded with the exception of the CRC_default module.
Getting information about a module
To see a short description of the software within a module, use the whatis sub-command
$ module whatis matlab
Some modules may also have a short informational help screen. View it with:
$ module help matlab