1MODULE(1) Modules package MODULE(1)
2
3
4
6 module - command interface to the Modules package
7
9 module [ switches ] [ sub-command ] [ sub-command-args ]
10
12 module is a user interface to the Modules package. The Modules package
13 provides for the dynamic modification of the user's environment via
14 modulefiles.
15
16 Each modulefile contains the information needed to configure the shell
17 for an application. Once the Modules package is initialized, the
18 environment can be modified on a per-module basis using the module
19 command which interprets modulefiles. Typically modulefiles instruct
20 the module command to alter or set shell environment variables such as
21 PATH, MANPATH, etc. modulefiles may be shared by many users on a
22 system and users may have their own collection to supplement or replace
23 the shared modulefiles.
24
25 The modulefiles are added to and removed from the current environment
26 by the user. The environment changes contained in a modulefile can be
27 summarized through the module command as well. If no arguments are
28 given, a summary of the module usage and sub-commands are shown.
29
30 The action for the module command to take is described by the sub-
31 command and its associated arguments.
32
33 Package Initialization
34 The Modules package and the module command are initialized when a
35 shell-specific initialization script is sourced into the shell. The
36 script creates the module command, either as an alias or shell
37 function, creates Modules environment variables, and if enabled to do
38 so, a snapshot of the environment is saved as either (if BEGINENV=1)
39 $HOME/.modulesbeginenv or (if BEGINENV=99) whatever $MODULESBEGINENV
40 points to.
41
42 The module alias or function executes the modulecmd program and has the
43 shell evaluate the command's output. The first argument to modulecmd
44 specifies the type of shell.
45
46 The initialization scripts are kept in $MODULESHOME/init/<shell> where
47 <shell> is the name of the sourcing shell. The sh, csh, tcsh, bash,
48 ksh, and zsh shells are supported by modulecmd. In addition, python,
49 perl, and cmake "shells" are supported, which writes the environment
50 changes to stdout as python, perl, or cmake code.
51
52 The perl module command is set up with:
53
54 use lib $ENV{'MODULESHOME'}."/init";
55 use perl;
56
57 And the python module command is defined with:
58
59 import os, sys;
60 sys.path.insert(0, '@INITPATH@')
61
62 from python import module;
63
64
65 Modulecmd startup
66 Upon invocation modulecmd sources rc files which contain global, user
67 and modulefile specific setups. These files are interpreted as
68 modulefiles. See modulefile(4) for detailed information.
69
70 Upon invocation of modulecmd module RC files are sourced in the
71 following order:
72
73 Global RC file as specified by ${MODULERCFILE} or ${MODULESHOME}/etc/rc
74
75 User specific module RC file ${HOME}/.modulerc
76
77 All .modulerc and .version files found during modulefile seeking.
78
79
80 Command line switches
81 The module command accepts command line switches as its first
82 parameter. These may be used to control output format of all
83 information displayed and the module behavior in case of locating and
84 interpreting module files.
85
86 All switches may be entered either in short or long notation. The
87 following switches are accepted:
88
89 --help, -H
90 Give some helpful usage information, and terminates the command.
91
92 --version, -V
93 Lists the current version of the module command, and some
94 configured option values. The command then terminates without
95 further processing.
96
97 --force, -f
98 Force active dependency resolution. This will result in modules
99 found on a prereq command inside a module file being load
100 automatically. Unloading module files using this switch will
101 result in all required modules which have been loaded
102 automatically using the -f switch being unload. This switch is
103 experimental at the moment.
104
105 --terse, -t
106 Display avail and list output in short format.
107
108 --long, -l
109 Display avail and list output in long format.
110
111 --human, -h
112 Display short output of the avail and list commands in human
113 readable format.
114
115 --verbose, -v
116 Enable verbose messages during module command execution.
117
118 --silent, -s
119 Disable verbose messages. Redirect stderr to /dev/null if stderr
120 is found not to be a tty. This is a useful option for module
121 commands being written into .cshrc, .login or .profile files,
122 because some remote shells (as rsh(1)) and remote execution
123 commands (like rdist) get confused if there is output on stderr.
124
125 --create, -c
126 Create caches for module avail and module apropos. You must be
127 granted write access to the ${MODULEHOME}/modulefiles/ directory
128 if you try to invoke module with the -c option.
129
130 --icase, -i
131 Case insensitive module parameter evaluation. Currently only
132 implemented for the module apropos command.
133
134 --userlvl <lvl>, -u <lvl>
135 Set the user level to the specified value. The argument of this
136 option may be one of:
137
138 novice, nov Novice
139
140 expert, exp Experienced module user
141
142 advanced, adv Advanced module user
143
144 Module Sub-Commands
145 help [modulefile...]
146 Print the usage of each sub-command. If an
147 argument is given, print the Module-specific help
148 information for the modulefile(s).
149
150 add modulefile...
151 load modulefile...
152 Load modulefile(s) into the shell environment.
153
154 rm modulefile...
155 unload modulefile...
156 Remove modulefile(s) from the shell environment.
157
158 swap [modulefile1] modulefile2
159 switch [modulefile1] modulefile2
160 Switch loaded modulefile1 with modulefile2. If
161 modulefile1 is not specified, then it is assumed
162 to be the currently loaded module with the same
163 root name as modulefile2.
164
165 show modulefile...
166 display modulefile...
167 Display information about one or more
168 modulefiles. The display sub-command will list
169 the full path of the modulefile(s) and all (or
170 most) of the environment changes the
171 modulefile(s) will make if loaded. (It will not
172 display any environment changes found within
173 conditional statements.)
174
175 list List loaded modules.
176
177 avail [path...]
178 List all available modulefiles in the current
179 MODULEPATH, where the sorting order is given by
180 the LC_COLLATE locale environment variable.
181
182 All directories in the MODULEPATH are recursively
183 searched for files containing the modulefile
184 magic cookie.
185
186 If an argument is given, then each directory in
187 the MODULEPATH is searched for modulefiles whose
188 pathname match the argument.
189
190 Multiple versions of an application can be
191 supported by creating a subdirectory for the
192 application containing modulefiles for each
193 version.
194
195 use [-a|--append] directory...
196 Prepend one or more directories to the MODULEPATH
197 environment variable. The --append flag will
198 append the directory to MODULEPATH.
199
200 unuse directory...
201 Remove one or more directories from the
202 MODULEPATH environment variable.
203
204 update Attempt to reload all loaded modulefiles. The
205 environment will be reconfigured to match the
206 environment saved in ${HOME}/.modulesbeginenv (if
207 BEGINENV=1) or the file pointed at by
208 $MODULESBEGINEV (if BEGINENV=99) and the
209 modulefiles will be reloaded. This is only valid
210 if modules was configured with --enable-beginenv
211 (which defines BEGINENV), otherwise this will
212 cause a warning. update will only change the
213 environment variables that the modulefiles set.
214
215 clear Force the Modules package to believe that no
216 modules are currently loaded.
217
218 purge Unload all loaded modulefiles.
219
220 refresh Force a refresh of all non-persistent components
221 of currently loaded modules. This should be used
222 on derived shells where aliases need to be
223 reinitialized but the environment variables have
224 already been set by the currently loaded modules.
225
226 whatis [modulefile...]
227 Display the information set up by the module-
228 whatis commands inside the specified
229 modulefile(s). If no modulefile is specified, all
230 'whatis' lines will be shown.
231
232 apropos string
233 keyword string Seeks through the 'whatis' informations of all
234 modulefiles for the specified string. All
235 module-whatis informations matching the string
236 will be displayed.
237
238 initadd modulefile...
239 Add modulefile(s) to the shell's initialization
240 file in the user's home directory. The startup
241 files checked (in order) are:
242 csh - .modules, .cshrc(.ext), .csh_variables, and
243 .login(.ext)
244 tcsh - .modules, .tcshrc, .cshrc(.ext),
245 .csh_variables, and .login(.ext)
246 sh and ksh - .modules, .profile(.ext), and
247 .kshenv(.ext)
248 bash - .modules, .bash_profile, .bash_login,
249 .profile(.ext), and .bashrc(.ext)
250 zsh - .modules, .zcshrc(.ext), .zshenv(.ext), and
251 .zlogin(.ext)
252
253 If a 'module load' line is found in any of these
254 files, the modulefile(s) is(are) appended to any
255 existing list of modulefiles. The 'module load'
256 line must be located in at least one of the files
257 listed above for any of the 'init' sub-commands
258 to work properly. If the 'module load' line is
259 found in multiple shell initialization files, all
260 of the lines are changed.
261
262 initprepend modulefile [modulefile...]
263 Does the same as initadd but prepends the given
264 modules to the beginning of the list.
265
266 initrm modulefile...
267 Remove modulefile(s) from the shell's
268 initialization files.
269
270 initswitch modulefile1 modulefile2
271 Switch modulefile1 with modulefile2 in the
272 shell's initialization files.
273
274 initlist List all of the modulefiles loaded from the
275 shell's initialization file.
276
277 initclear Clear all of the modulefiles from the shell's
278 initialization files.
279
280 Modulefiles
281 modulefiles are written in the Tool Command Language (Tcl) and are
282 interpreted by modulecmd. modulefiles can use conditional statements.
283 Thus the effect a modulefile will have on the environment may change
284 depending upon the current state of the environment.
285
286 Environment variables are unset when unloading a modulefile. Thus, it
287 is possible to load a modulefile and then unload it without having the
288 environment variables return to their prior state.
289
291 MODULESHOME
292 The location of the master Modules package file directory
293 containing module command initialization scripts, the executable
294 program modulecmd, and a directory containing a collection of
295 master modulefiles.
296
297 MODULEPATH
298 The path that the module command searches when looking for
299 modulefiles. Typically, it is set to a default value by the
300 bootstrap procedure. MODULEPATH can be set using 'module use'
301 or by the module initialization script to search group or
302 personal modulefile directories before or after the master
303 modulefile directory.
304
305 LOADEDMODULES
306 A colon separated list of all loaded modulefiles.
307
308 _LMFILES_
309 A colon separated list of the full pathname for all loaded
310 modulefiles.
311
312 MODULESBEGINENV
313 If modules has been configured (BEGINENV=99) to test for this
314 environment variable, then if it exists, it is the name of the
315 file to store the the initial shell environment. This
316 environment variable will have embedded environment variables
317 unrolled to one level. The contents of this variable is only
318 used the first time modules is invoked.
319
320 _MODULESBEGINENV_
321 The filename of the file containing the initialization
322 environment snapshot.
323
324
326 /usr/share/Modules/Modules
327 The MODULESHOME directory.
328
329 ${MODULESHOME}/etc/rc
330 The system-wide modules rc file. The location of this file can
331 be changed using the MODULERCFILE environment variable as
332 described above.
333
334 ${HOME}/.modulerc
335 The user specific modules rc file.
336
337 ${MODULESHOME}/modulefiles
338 The directory for system-wide modulefiles. The location of the
339 directory can be changed using the MODULEPATH environment
340 variable as described above.
341
342 ${MODULESHOME}/bin/modulecmd
343 The modulefile interpreter that gets executed upon each
344 invocation of module.
345
346 ${MODULESHOME}/init/<shell>
347 The Modules package initialization file sourced into the user's
348 environment.
349
350 ${MODULEPATH}/.moduleavailcache
351 File containing the cached list of all modulefiles for each
352 directory in the MODULEPATH (only when the avail cache is
353 enabled via the configure option --enable-cache which sets
354 CACHE_AVAIL).
355
356 ${MODULEPATH}/.moduleavailcachedir
357 File containing the names and modification times for all sub-
358 directories with an avail cache (see above).
359
360 ${HOME}/.modulesbeginenv
361 A snapshot of the user's environment taken at Module
362 initialization. This information is used by the module update
363 sub-command (if BEGINENV=1), else
364
365 $MODULESBEGINENV
366 If this defines a valid filename, it serves the same purpose as
367 above (if BEGINENV=99).
368
370 3.2.13
371
373 modulefile(4)
374
375
376
377Modules version 3.2.13 2020-04-07 MODULE(1)