Autoload Environment Modules on Login

Assuming that you are using the default bash shell on our systems, create/edit a file called .bashrc. If you are using another shell create/edit the file called .profile. Include the following:

. /usr/modules/init/bash
module load module1 module2

The first line sources the module initialization file for bash. If you use a different shell make sure that you replace bash with the required file. The module system supports initialization for the bash,csh,ksh,sh,tcsh, and zsh interactive shells.

The second line actually loads the module that you need (replace module1…etc with the name of the module you wish to load). You can list as many modules as you would like by using a space as a delimiter. Some modules will affect others, especially the gcc modules.