Controlling Lmod behavior through Environment Variables

Sites can control the behavior of Lmod via how lmod is configured. To see all the configuration options you can execute:

$ ./configure --help

in the Lmod source directory. All of the configuration options can also be overridden by environment variables as well as a few behavior options that do not have a configuration option.

There two kinds of variables: (1) An explicit values; (2) a yes/no variable. An example of first kind is LMOD_SITE_NAME. This variable controls the site name (e.g. TACC). This value of variable is used directly. There is no change of case or any other changes.

The second kind of variable is an yes/no variable. One example of this is LMOD_IGNORE_CACHE. When this variable is “yes”, Lmod ignores any cache files and walks MODULEPATH instead.

The following settings are considered “no”. Note that the string value is lowercased first, so NO, No, and nO are the same as no. ALL OTHER VALUES are treated as “yes”.

  1. export LMOD_IGNORE_CACHE=”“
  2. export LMOD_IGNORE_CACHE=0
  3. export LMOD_IGNORE_CACHE=no
  4. export LMOD_IGNORE_CACHE=off

Environment variables only

The following variables set actions that can only be controlled by environment variables. The actions can not be controlled through the configuration step.

[path] If set this will be a file to specify the nag message.
[yes/no] If set to yes then Lmod will bypass all cachefile and walk the directories in MODULEPATH instead.
[string] Lmod uses a pager when not using redirect. It defaults to less. Site/Users can turn off the pager if it is set to “None”.
[any value] If this variable has any value it means that Lmod does nothing. This is useful when testing a personal copy of Lmod and your site has the SHELL_STARTUP_DEBUG package installed so that the invoking of the module command in the system startup will a no-op.
[string] This variable is used to where a site is using shared home files systems. See Lmod on Shared Home File Systems for more details.
[yes/no] If set to yes then Lmod will trace the loads/unloads while the module command is running.

Configuration time setting that can be overridden by env. vars.

The following settings are defined by configure but can be overridden by environment variables. The brackets show the following values [kind, default: value, configuration option] where kind is either yes/no, string, path, etc, value is what the default will be. Finally the configuration option which will set the action.

[yes/no, default: yes, –with-tcl]. Allow tcl modulefiles. Note that .version and .modulerc files still use the tcl interpreter. So setting this to no.
[number, default:86400, –with-ancient]. The number of seconds that the user’s personal cache is considered valid.
[yes/no, default: yes, –with-autoSwap] Allows Lmod to swap any modules that use the family function such as compilers and mpi stacks.
[yes/no, default:no, –with-cachedLoads] If true then Lmod will use the spider cache instead of walking MODULEPATH as long as LMOD_IGNORE_CACHE is not set.
[yes/no, default: no, –with-caseIndependentSorting] Make avail and spider use case independent sorting.
[yes/no, default: yes, –with-colorize] Let lmod write colorize message to the terminal.
[yes/no, default: no, –with-disableNameAutoSwap] Setting this to “yes” disables the one name rule autoswapping. In other words, “module load gcc/4.7 gcc/5.2 will fail when this is set.
[yes/no, default: no, –with-duplicatePaths] Allow duplicates directories in path-like variables, PATH, LD_LIBRARY_PATH, ...
[yes/no, default: no, –with-exactMatch] Requires Lmod to use fullNames for modules. This disables defaults.
[yes/no, default: no, –with-hiddenItalic] Use italics for hidden modules instead of faint.
[yes/no, default: no, –with-mpathSearch] If this is set then module avail <string> will search modulepath names.
[string, default: en, –with-lang] Override $LANG for Lmod error/messages/warnings.
[yes/no, default: no, –with-pinVersions] If yes then when restoring load the same version that was chosen with the save, instead of the current default version.
[normal/reverse, default: normal, –with-prependBlock] Treat multiple directories passed to prepend in normal order and not reversed.
[yes/no, default: no, –with-redirect]. Normal messages generated by “module avail”, “module list”,etc write the output to stderr. Turning redirect to “yes” will cause these message to be written to stdout. Note this only works for bash and zsh. This will not work with csh or tcsh as there is a problem with these shells and not Lmod.
[number, default: 2, –with-shortTime]. If the time to build the spider cache takes longer than this number then write the spider cache out into the user’s account. If you want to prevent the spider cache file being written to the user’s account then set this number to be large, like 86400.
[full path, default: <nil> –with-siteMsgFile] The Site message file. This overrides the messageDir/en.lua file so that sites can replace some or all Lmod messages.
[string, default: <nil>, –with-siteName]. This is the site name, for example TACC, and not the name of the cluster. This is used with the family function.
[string, default: <nil>, –with-syshost]. This variable can be used to help with module tracking. See contrib/tracking_modules_usage/* for details.
[yes/no, default: no, –with-tmodFindFirst]. Normally Lmod uses the FIND BEST rule to search for defaults when searching C/N/V or N/V module layouts. A site can force FIND_FIRST for C/N/V or N/V module layouts to match the FIND_FIRST rule for N/V/V module layout. See NVV: Picking modules when there are multiple directories in MODULEPATH for more details.
[yes/no, default: no, –with-tmodPathRule]. Normally Lmod prepend/appends a directory in the beginning/end of the path like variable. If this is true then if path entry is already there then do not prepend/append.
[yes/no, default: yes, –with-useDotFiles] If yes then use ~/.lmod.d/.cache, if no then use ~/.lmod.d/__cache__