mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
496 lines
13 KiB
Groff
496 lines
13 KiB
Groff
.TH MODULE 1 "10 October 2005
|
|
.nh
|
|
.SH NAME
|
|
module \- command interface to the Modules package
|
|
.SH SYNOPSIS
|
|
.B module
|
|
[
|
|
.I switches
|
|
]
|
|
[
|
|
.I sub-command
|
|
]
|
|
.I [ sub-command-args ]
|
|
.SH DESCRIPTION
|
|
.LP
|
|
.B module
|
|
is a user interface to the Modules package.
|
|
The Modules package provides for the dynamic modification of the user's
|
|
environment via
|
|
.I modulefiles.
|
|
.LP
|
|
Each
|
|
.I modulefile
|
|
contains the information needed to configure the shell for an application.
|
|
Once the Modules package is initialized, the environment can be modified
|
|
on a per-module basis using the
|
|
.B module
|
|
command which interprets
|
|
.I modulefiles.
|
|
Typically
|
|
.I modulefiles
|
|
instruct the
|
|
.B module
|
|
command to alter or set shell environment variables such as PATH, MANPATH,
|
|
etc.
|
|
.I modulefiles
|
|
may be shared by many users on a system and users may have their own
|
|
collection to supplement or replace the shared
|
|
.I modulefiles.
|
|
.LP
|
|
The
|
|
.I modulefiles
|
|
are added to and removed from the current
|
|
environment by the user.
|
|
The environment changes contained in a
|
|
.I modulefile
|
|
can be summarized through the
|
|
.B module
|
|
command as well.
|
|
If no arguments are given, a summary of the
|
|
.B module
|
|
usage and
|
|
.I sub-commands
|
|
are shown.
|
|
.LP
|
|
The action for the
|
|
.B module
|
|
command to take is described by the
|
|
.I sub-command
|
|
and its associated arguments.
|
|
.SS Package Initialization
|
|
.LP
|
|
The Modules package and the
|
|
.B module
|
|
command are initialized when a shell-specific initialization script is
|
|
sourced into the shell.
|
|
The script creates the
|
|
.B module
|
|
command, either as an alias or shell function,
|
|
creates Modules environment variables,
|
|
and if enabled to do so, a snapshow of the environment is saved as either
|
|
(if BEGINENV=1)
|
|
.I $HOME/.modulesbeginenv
|
|
or (if BEGINENV=99) whatever
|
|
.I $MODULESBEGINENV
|
|
points to.
|
|
|
|
The
|
|
.B module
|
|
alias or function executes the
|
|
.B modulecmd
|
|
program and has the shell evaluate
|
|
the command's output. The first argument to
|
|
.B modulecmd
|
|
specifies the type of shell.
|
|
.LP
|
|
The initialization scripts are kept in
|
|
.I $MODULESHOME/init/<shell>
|
|
where
|
|
.I <shell>
|
|
is the name of the sourcing shell.
|
|
The sh, csh, tcsh, bash, ksh, and zsh shells are supported by
|
|
.B modulecmd.
|
|
In addition, python and perl "shells" are supported, which writes
|
|
the environment changes to stdout as python or perl code.
|
|
|
|
.SS Modulecmd startup
|
|
.LP
|
|
Upon invocation \fImodulecmd\fP sources rc files which contain global, user
|
|
and modulefile specific setups. These files are interpreted as modulefiles.
|
|
See \fBmodulefile(4)\fP for detailed information.
|
|
.LP
|
|
Upon invocation of modulecmd module RC files are sourced in the following
|
|
order:
|
|
.nf
|
|
|
|
Global RC file as specified by ${\s-1MODULERCFILE\s0} or
|
|
${\s-1MODULESHOME\s0}/etc/rc
|
|
|
|
User specific module RC file ${\s-1HOME\s0}/.modulerc
|
|
|
|
All .modulerc and .version files found during modulefile
|
|
seeking.
|
|
|
|
.fi
|
|
.SS Command line switches
|
|
.LP
|
|
The module command accepts command line switches as its first parameter. These
|
|
may be used to control output format of all information displayed and the
|
|
\fImodule\fP behavior in case of locating and interpreting module files.
|
|
.LP
|
|
All switches may be entered either in short or long notation. The following
|
|
switches are accepted:
|
|
.PP
|
|
.TP
|
|
.I --help, -H
|
|
Give some helpful usage information, and terminates the command.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --version, -V
|
|
Lists the current version of the module command, and some configured
|
|
option values. The command then terminates without further processing.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --force, -f
|
|
Force active dependency resolution. This will result in modules found on a
|
|
\fIprereq\fP command inside a module file being load automatically.
|
|
Unloading module files using this switch will result in all required modules
|
|
which have been loaded automatically using the \fI-f\fP switch being unload.
|
|
This switch is experimental at the moment.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --terse, -t
|
|
Display \fIavail\fP and \fIlist\fP output in short format.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --long, -l
|
|
Display \fIavail\fP and \fIlist\fP output in long format.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --human, -h
|
|
Display short output of the \fIavail\fP and \fIlist\fP commands in human
|
|
readable format.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --verbose, -v
|
|
Enable verbose messages during module command execution.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --silent, -s
|
|
Disable verbose messages. Redirect \fIstderr\fP to \fI/dev/null\fP if
|
|
\fIstderr\fP is found not to be a tty. This is a useful option for module
|
|
commands being written into \fI.cshrc\fP, \fI.login\fP or \fI.profile\fP
|
|
files, because some remote shells (as \fIrsh\fP(1)) and remote execution
|
|
commands (like \fIrdist\fP) get confused if there is output on stderr.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --create, -c
|
|
Create caches for \fImodule avail\fP and \fImodule apropos\fP. You must
|
|
be granted write access to the ${\s-1MODULEHOME\s0}/modulefiles/ directory
|
|
if you try to invoke \fImodule\fP with the \fI-c\fP option.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --icase, -i
|
|
Case insensitive module parameter evaluation. Currently only implemented for
|
|
the \fImodule apropos\fP command.
|
|
.RS
|
|
.RE
|
|
.TP
|
|
.I --userlvl <lvl>, -u <lvl>
|
|
Set the user level to the specified value. The argument of this option may
|
|
be one of:
|
|
.LP
|
|
.I novice, nov
|
|
Novice
|
|
.LP
|
|
.I expert, exp
|
|
Experienced module user
|
|
.LP
|
|
.I advanced, adv
|
|
Advanced module user
|
|
.SS Module Sub-Commands
|
|
.RS
|
|
.TP 15
|
|
.B help [modulefile...]
|
|
Print the usage of each sub-command.
|
|
If an argument is given, print the Module specific help information for the
|
|
.I modulefile.
|
|
.TP 15
|
|
.B load modulefile [modulefile...]
|
|
.PD 0
|
|
.TP 15
|
|
.B add modulefile [modulefile...]
|
|
.PD
|
|
Load
|
|
.I modulefile
|
|
into the shell environment.
|
|
.TP 15
|
|
.B unload modulefile [modulefile...]
|
|
.PD 0
|
|
.TP 15
|
|
.B rm modulefile [modulefile...]
|
|
.PD
|
|
Remove
|
|
.I modulefile
|
|
from the shell environment.
|
|
.TP 15
|
|
.B switch [ modulefile1 ] modulefile2
|
|
.PD 0
|
|
.TP 15
|
|
.B swap [ modulefile1 ] modulefile2
|
|
.PD
|
|
Switch loaded
|
|
.I modulefile1
|
|
with
|
|
.I modulefile2.
|
|
If
|
|
.I modulefile1
|
|
is not specified, then it is assumed to be the currently loaded module
|
|
with the same root name as modulefile2.
|
|
.TP 15
|
|
.B display modulefile [modulefile...]
|
|
.PD 0
|
|
.TP 15
|
|
.B show modulefile [modulefile...]
|
|
.PD
|
|
Display information about a
|
|
.I modulefile.
|
|
The display sub-command will list the full path of the
|
|
.I modulefile
|
|
and all (or most) of the environment changes the
|
|
.I modulefile
|
|
will make if loaded. (It will not display any
|
|
environment changes found within conditional statements.)
|
|
.TP 15
|
|
.B list
|
|
List loaded modules.
|
|
.TP 15
|
|
.B avail [path...]
|
|
List all available
|
|
.I modulefiles
|
|
.hy 0
|
|
in the current \s-1MODULEPATH\s0.
|
|
All directories in the \s-1MODULEPATH\s0 are recursively searched for
|
|
files containing the
|
|
.I modulefile
|
|
magic cookie.
|
|
If an argument is given, then each directory in the \s-1MODULEPATH\s0 is
|
|
searched for
|
|
.I modulefiles
|
|
whose pathname match the argument.
|
|
Multiple versions of an application can be supported by creating a
|
|
subdirectory for the application containing
|
|
.I modulefiles
|
|
for each version.
|
|
.TP 15
|
|
.B use directory [directory...]
|
|
.PD 0
|
|
.TP 15
|
|
.B use [-a|--append] directory [directory...]
|
|
.PD
|
|
Prepend directory to the \s-1MODULEPATH\s0 environment variable.
|
|
The --append flag will append the directory to \s-1MODULEPATH\s0.
|
|
.TP 15
|
|
.B unuse directory [directory...]
|
|
Remove directory from the \s-1MODULEPATH\s0 environment variable.
|
|
.TP 15
|
|
.B update
|
|
Attempt to reload all loaded
|
|
.I modulefiles.
|
|
The environment will be reconfigured to match the environment saved in
|
|
.I ${\s-1HOME\s0}/.modulesbeginenv
|
|
(if BEGINENV=1)
|
|
or the file pointed at by
|
|
.I $MODULESBEGINEV
|
|
(if BEGINENV=99)
|
|
and the modulefiles will be reloaded.
|
|
|
|
This is only valid if modules was configured with --enable-beginenv
|
|
(which defines BEGINENV)
|
|
else this will cause a warning.
|
|
.B update
|
|
will only change the environment variables that the
|
|
.I modulefiles
|
|
set.
|
|
.TP 15
|
|
.B clear
|
|
Force the Modules Package to believe that no modules are currently loaded.
|
|
.TP 15
|
|
.B purge
|
|
Unload all loaded
|
|
.I modulefiles.
|
|
.TP 15
|
|
.B whatis [modulefile [modulefile...]]
|
|
Display the modulefile information set up by the \fImodule-whatis\fP commands
|
|
inside the specified modulefiles. If no modulefiles are specified all whatis
|
|
information lines will be shown.
|
|
.TP 15
|
|
.B apropos string
|
|
.PD 0
|
|
.TP 15
|
|
.B keyword string
|
|
Seeks thru the whatis informations of all modulefiles for the specified string.
|
|
All module whatis informations matching the string search will be displayed.
|
|
.TP 15
|
|
.B initadd modulefile [modulefile...]
|
|
Add
|
|
.I modulefile
|
|
to the shell's initialization file in the user's home directory.
|
|
The startup files checked (in order) are:
|
|
.br
|
|
csh - .modules, .cshrc(.ext), .csh_variables, and .login(.ext)
|
|
.br
|
|
tcsh - .modules, .tcshrc, .cshrc(.ext), .csh_variables, and .login(.ext)
|
|
.br
|
|
sh and ksh - .modules, .profile(.ext), and .kshenv(.ext)
|
|
.br
|
|
bash - .modules, .bash_profile, .bash_login, .profile(.ext), and .bashrc(.ext)
|
|
.br
|
|
zsh - .modules, .zcshrc(.ext), .zshenv(.ext), and .zlogin(.ext)
|
|
|
|
If a 'module load' line is found in any of these files, the
|
|
.I modulefile(s)
|
|
is(are) appended to any existing list of
|
|
.I modulefiles.
|
|
The 'module load' line must be located in at least one of the
|
|
files listed above for any of the 'init' sub-commands to work properly.
|
|
If the 'module load' line is found in multiple shell initialization files,
|
|
all of the lines are changed.
|
|
.TP 15
|
|
.B initprepend modulefile [modulefile...]
|
|
Does the same as
|
|
.B initadd
|
|
but prepends the given modules to the beginning of the list.
|
|
.TP 15
|
|
.B initrm modulefile [modulefile...]
|
|
Remove
|
|
.I modulefile
|
|
from the shell's initialization files.
|
|
.TP 15
|
|
.B initswitch modulefile1 modulefile2
|
|
Switch
|
|
.I modulefile1
|
|
with
|
|
.I modulefile2
|
|
in the shell's initialization files.
|
|
.TP 15
|
|
.B initlist
|
|
List all of the
|
|
.I modulefiles
|
|
loaded from the shell's initialization file.
|
|
.TP 15
|
|
.B initclear
|
|
Clear all of the
|
|
.I modulefiles
|
|
from the shell's initialization files.
|
|
.RE
|
|
.SS Modulefiles
|
|
.LP
|
|
.I modulefiles
|
|
are written in the Tool Command Language (Tcl) and are interpreted by
|
|
.B modulecmd.
|
|
.I modulefiles
|
|
can use conditional statements.
|
|
Thus the effect a
|
|
.I modulefile
|
|
will have on the environment may change depending upon the current state of
|
|
the environment.
|
|
.LP
|
|
Environment variables are unset when unloading a
|
|
.I modulefile.
|
|
Thus, it is possible to
|
|
.B load
|
|
a
|
|
.I modulefile
|
|
and then
|
|
.B unload
|
|
it without having the environment variables return to their
|
|
prior state.
|
|
.LP
|
|
.SH ENVIRONMENT
|
|
.TP
|
|
.SB \s-1MODULESHOME\s0
|
|
The location of the master Modules package file directory containing
|
|
.B module
|
|
command initialization scripts, the executable program
|
|
.B modulecmd,
|
|
and a directory containing a collection of master
|
|
.I modulefiles.
|
|
.TP
|
|
.SB \s-1MODULEPATH\s0
|
|
The path that the
|
|
.B module
|
|
command searches when looking for
|
|
.I modulefiles.
|
|
Typically, it is set to a default value by the bootstrap procedure.
|
|
\s-1MODULEPATH\s0 can be set using 'module use' or by the module
|
|
initialization script to search group or personal
|
|
.I modulefile
|
|
directories before or after the master
|
|
.I modulefile
|
|
directory.
|
|
.TP
|
|
.SB \s-1LOADEDMODULES\s0
|
|
A colon separated list of all loaded
|
|
.I modulefiles.
|
|
.TP
|
|
.SB \s-1_LMFILES_\s0
|
|
A colon separated list of the full pathname for all loaded
|
|
.I modulefiles.
|
|
.TP
|
|
.SB \s-1MODULESBEGINENV\s0
|
|
If modules has been configured (BEGINENV=99) to test for this environment
|
|
variable, then if it exists, it is the name of the file to store the
|
|
the initial shell environment. This environment variable will have
|
|
embedded environment variables unrolled to one level. The contents of
|
|
this variable is only used the first time
|
|
.I modules
|
|
is invoked.
|
|
.TP
|
|
.SB \s-1_MODULESBEGINENV_\s0
|
|
The filename of the file containing the initialization environment snapshot.
|
|
|
|
.SH FILES
|
|
.TP
|
|
.B @prefix@
|
|
The \s-1MODULESHOME\s0 directory.
|
|
.TP
|
|
.B ${\s-1MODULESHOME\s0}/etc/rc
|
|
The system-wide
|
|
.I modules rc file.
|
|
The location of this file can be changed using
|
|
the \s-1MODULERCFILE\s0 environment variable as described above.
|
|
.TP
|
|
.B ${\s-1HOME\s0}/.modulerc
|
|
The user specific
|
|
.I modules rc file.
|
|
.TP
|
|
.B ${\s-1MODULESHOME\s0}/modulefiles
|
|
The directory for system-wide
|
|
.I modulefiles.
|
|
The location of the directory can be changed using
|
|
the \s-1MODULEPATH\s0 environment variable as described above.
|
|
.TP
|
|
.B ${\s-1MODULESHOME\s0}/bin/modulecmd
|
|
The
|
|
.I modulefile
|
|
interpreter that gets executed upon each invocation of
|
|
.B module.
|
|
.TP
|
|
.B ${\s-1MODULESHOME\s0}/init/\fI<shell>\fP
|
|
The Modules package initialization file sourced into the user's
|
|
environment.
|
|
.TP
|
|
.B ${\s-1MODULEPATH\s0}/.moduleavailcache
|
|
File containing the cached list of all
|
|
.I modulefiles
|
|
for each directory in the \s-1MODULEPATH\s0
|
|
(only when the avail cache is enabled via the configure option --enable-cache
|
|
which sets CACHE_AVAIL).
|
|
.TP
|
|
.B ${\s-1MODULEPATH\s0}/.moduleavailcachedir
|
|
File containing the names and modification times for all sub-directories with
|
|
an avail cache (see above).
|
|
.TP
|
|
.B ${\s-1HOME\s0}/.modulesbeginenv
|
|
A snapshot of the user's environment taken at Module initialization.
|
|
This information is used by the
|
|
.B module update
|
|
sub-command (if BEGINENV=1), else
|
|
.TP
|
|
.B $MODULESBEGINENV
|
|
If this defines a valid filename, this serves the same purpose as above
|
|
(if BEGINENV=99).
|
|
.SH SEE ALSO
|
|
.BR modulefile(4)
|