Modules Documentation

What are they?

Modules are a set of commands that are written in TCL that when run apply various configuration changes to your current working shell in Solaris/Linux.

One of the most common changes that is made is to adjust your PATH variable so that you are able to run a new command. They are written in a way that allows you to run the same module on any OS and use any shell (bash, tcsh, csh, sh, ksh, etc..) that you prefer.

The idea behind modules is to redirect the user to the correct "State" with ease so they do not have to manually adjust their shell or modify their startup "Profile". Virtually any adjustment that can be done manually can be done with a module script.

Who Should use them?

Everyone!

Modules is the only way to use some software, every time a new version of software is installed on the ECE system the paths and certain varibles need to be adjusted. This is accomplished dynamically with the Modules commands. You do not have to adjust they way you run the software it is done for you.

For example if a new version of cadence is installed, your shell will automatically be adjusted for the new path to the executable. Or if the license server is moved to a different host that will also be automatically changed. Another benefit from modules is that common admin paths and man paths are setup as well. You will especially notice this if you log onto a Linux machine or a Solaris machine.

Linux Machine:

rmyers@linux02 (~) % module list
Currently Loaded Modulefiles:
1) modules 2) system 3) local 4) openwin 5) aliases 6) admin

rmyers@linux02 (~) % echo $PATH
/usr/sbin:/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

Solaris Machine:

rmyers@sunapp3 (~) % module list
Currently Loaded Modulefiles:
1) modules 2) system 3) local 4) openwin 5) aliases 6) admin

rmyers@sunapp3 (~) % echo $PATH
/usr/sadm/bin:/usr/sbin:/sbin:/usr/bin:/usr/games:/usr/ccs/bin:/usr/ucb:
/opt/sfw/bin:/usr/local/bin:/usr/openwin/bin:/opt/SUNWppro/bin

Note

I have the same modules loaded but I have a different set of paths on each machine.

How do I use them?

Setup your Environment

Use the resetenv command which will load a default set of "dot files" that use modules. From any linux or sun machine run the command:

/usr/local/bin/resetenv

You will be prompted to reset your environment back to the ECE defaults, type '1' to accept. If you run it a second time you will notice you will be prompted to either reset to defaults or to pick a state to restore back to if you do not like the default files. You can also run "resetenv --purge" to delete all you old restore points. Help is included with the command "resetenv --help".

Setup your Environment the hard way

If you like doing things the hard way edit your startup files depending on which shell you use:

CSH, TCSH shells:

Edit your $HOME/.cshrc remove all path and manpath variables and add lines:

unsetenv PATH MANPATH
source /home/projects/Modules/init/csh
module load modules system local openwin aliases admin

SH, BASH shells:

Edit your $HOME/.profile remove all path and manpath variables and add lines:

unset PATH MANPATH
. /home/projects/Modules/init/csh
module load modules system local openwin aliases admin

Loading an application

In a command window type the follow command to 'load' an application:

module load <module name>

Unloading an application

In a command window type the follow command to 'unload' an application:

module unload <module name>

Adding a default Application

If you want to load a certain module everytime you log in use the following command:

module initadd <module name>

Removing a default Application

To remove the application you loaded as a defult use the initrm command:

module initrm <module name>

Note

The init commands just alter your environment settings file they do not 'load' the application for your current session. You must either log out and log back in or use the load command to use the application.

What modules are currently available?

This is a constantly changing so at anytime you want to refer to the authority on this, the module command itself run:

module avail

Here is the output of module avail at the time this page was written:

% module avail
------------ /home/projects/Modules/projects ------------
EE338L
------------ /home/projects/Modules/tools ------------
acrobat/acrobat5(default)     matlab/14sp2(default)
ads/ads2004a(default)         matlab/14sp3
ads/ads2003c                  mentor/C.4(default)
cadence/2004(default)         calibre/2004(default)
cadence/2005                  modelsim/5.6(default)
firefox/1.0(default)          synopsys/2004.06-SP2
hspice/2003.03-SP1            synopsys/synopsys(default)
hspice/2003.09(default)       synopsys/pathmill/2003.12-SP3(default)
dft/2004-6.10(default)        synopsys/primetime/2004.12(default)
matlab/14sp1                  synopsys/nanosim/2004.06(default)
------------ /home/projects/Modules/base ------------
local dot admin openwin modules system use.own aliases

In the above list you will see that there are 2 cadence modules available "cadence/2004" and "cadence/2005" if you do module load cadence you will get the default of 2004, to load the 2005 module you will need to do "module load cadence/2005". This allows you to run software which is not the default if the licensing allows it.

For most people you will want to use the default which will get loaded automatically and the default will change when new versions are installed and tested. You only want to load a specific version if you know what you are doing.

Quick Command Reference

  • module load <module name>: Loads a module into your environment.
  • module unload <module name>: Unloads a module from your environment.
  • module show <module name>: Shows what changes module will preform. no changes are made, just displayed.
  • module help <module name>: Lists the help file for the module.
  • module list: Lists your currently loaded modules.
  • module avail: Lists the available modules.

I still need more help?

Try the man page:

% man module
% man modulefile

Or consult the web: http://modules.sourceforge.net