1MODULEFILE(4)                       Modules                      MODULEFILE(4)
2
3
4

NAME

6       modulefile - files containing Tcl code for the Modules package
7

DESCRIPTION

9       modulefiles  are  written  in the Tool Command Language, Tcl(n) and are
10       interpreted by the modulecmd.tcl program via the module(1) user  inter‐
11       face. modulefiles can be loaded, unloaded, or switched on-the-fly while
12       the user is working; and can be used to implement site policies regard‐
13       ing the access and use of applications.
14
15       A  modulefile  begins with the magic cookie, #%Module. A version number
16       may be placed after this string. The version number is  useful  as  the
17       modulefile  format  may  change thus it reflects the minimum version of
18       modulecmd.tcl required to interpret the modulefile. If a version number
19       doesn't exist, then modulecmd.tcl will assume the modulefile is compat‐
20       ible. Files without the magic cookie or with a version  number  greater
21       than the current version of modulecmd.tcl will not be interpreted.
22
23       Each  modulefile contains the changes to a user's environment needed to
24       access an application. Tcl is a simple programming language which  per‐
25       mits modulefiles to be arbitrarily complex, depending upon the applica‐
26       tion's and the modulefile writer's needs. If support for  extended  tcl
27       (tclX)  has  been configured for your installation of the Modules pack‐
28       age, you may use all the extended commands provided by tclX, too.
29
30       A typical modulefile is a simple bit of code that set or add entries to
31       the  PATH,  MANPATH,  or  other  environment variables. A Modulefile is
32       evaluated against current modulecmd.tcl's mode which leads to  specific
33       evaluation  results.  For instance if the modulefile sets a value to an
34       environment variable, this variable is set when  modulefile  is  loaded
35       and unset when modulefile is unloaded.
36
37       Tcl  has  conditional statements that are evaluated when the modulefile
38       is interpreted. This is very effective for managing path or environment
39       changes  due  to different OS releases or architectures. The user envi‐
40       ronment information is encapsulated into a single modulefile kept in  a
41       central  location.  The  same  modulefile  is used by every user on any
42       machine. So, from the user's perspective, starting  an  application  is
43       exactly the same irrespective of the machine or platform they are on.
44
45       modulefiles also hide the notion of different types of shells. From the
46       user's perspective,  changing  the  environment  for  one  shell  looks
47       exactly the same as changing the environment for another shell. This is
48       useful for new or novice users and eliminates the need  for  statements
49       such  as  "if you're using the C Shell do this ..., otherwise if you're
50       using the Bourne shell do this ...". Announcing and accessing new soft‐
51       ware  is  uniform and independent of the user's shell. From the module‐
52       file writer's perspective, this means one set of information will  take
53       care of every type of shell.
54

MODULES SPECIFIC TCL COMMANDS

56       The  Modules  Package  uses commands which are extensions to the "stan‐
57       dard" Tool Command Language Tcl(n) package. Unless otherwise specified,
58       the  Module commands return the empty string. Some commands behave dif‐
59       ferently when a modulefile is loaded or unloaded. The command  descrip‐
60       tions assume the modulefile is being loaded.
61
62       append-path [-d C|--delim C|--delim=C] [--duplicates] variable value...
63              See prepend-path.
64
65       break  This  is  not  a Modules-specific command, it's actually part of
66              Tcl, which has been overloaded similar to the continue and  exit
67              commands  to  have  the  effect  of causing the module not to be
68              listed as loaded and not affect other modules being loaded  con‐
69              currently.  All  non-environment commands within the module will
70              be performed up to this point and processing will continue on to
71              the next module on the command line. The break command will only
72              have this effect if not used within a Tcl loop though.
73
74              An example: Suppose that a full  selection  of  modulefiles  are
75              needed for various different architectures, but some of the mod‐
76              ulefiles are not needed and the user should be  alerted.  Having
77              the  unnecessary  modulefile be a link to the following notavail
78              modulefile will perform the task as required.
79
80                 #%Module1.0
81                 ## notavail modulefile
82                 ##
83                 proc ModulesHelp { } {
84                     puts stderr "This module does nothing but alert the user"
85                     puts stderr "that the [module-info name] module is not available"
86                 }
87
88                 module-whatis "Notifies user that module is not available."
89                 set curMod [module-info name]
90                 if { [ module-info mode load ] } {
91                     puts stderr "Note: '$curMod' is not available for [uname sysname]."
92                 }
93                 break
94
95       chdir directory
96              Set the current working directory to directory.
97
98       conflict modulefile...
99              prereq and conflict control whether or not the  modulefile  will
100              be  loaded. The prereq command lists modulefiles which must have
101              been previously loaded before the  current  modulefile  will  be
102              loaded.  Similarly, the conflict command lists modulefiles which
103              conflict with the current modulefile. If a  list  contains  more
104              than  one  modulefile,  then  each  member of the list acts as a
105              Boolean OR operation. Multiple prereq and conflict commands  may
106              be  used  to  create  a  Boolean  AND  operation.  If one of the
107              requirements have not been satisfied, an error is  reported  and
108              the  current  modulefile makes no changes to the user's environ‐
109              ment.
110
111              If an argument for prereq is a directory and any modulefile from
112              the directory has been loaded, then the prerequisite is met. For
113              example, specifying X11 as a prereq means that  any  version  of
114              X11, X11/R4 or X11/R5, must be loaded before proceeding.
115
116              If an argument for conflict is a directory and any other module‐
117              file from that directory has been loaded, then a  conflict  will
118              occur.   For  example,  specifying  X11  as a conflict will stop
119              X11/R4 and X11/R5 from being loaded at the same time.
120
121              The parameter modulefile may also be a symbolic modulefile  name
122              or a modulefile alias. It may also leverage a specific syntax to
123              finely select module version (see Advanced module version speci‐
124              fiers section below).
125
126       continue
127              This  is  not  a modules specific command but another overloaded
128              Tcl command and is similar to the break or exit commands  except
129              the  module  will  be listed as loaded as well as performing any
130              environment or Tcl commands up to this point and then continuing
131              on  to the next module on the command line. The continue command
132              will only have this effect if not used within a Tcl loop though.
133
134       exit [N]
135              This is not a modules specific command  but  another  overloaded
136              Tcl  command  and  is similar to the break or continue commands.
137              However, this command will cause the immediate cessation of this
138              module  and any additional ones on the command line. This module
139              and the subsequent modules will not  be  listed  as  loaded.  No
140              environment commands will be performed in the current module.
141
142       getenv variable [value]
143              Returns  value  of  environment  variable.  If  variable  is not
144              defined, value is returned if set, _UNDEFINED_ is returned  oth‐
145              erwise.  The  getenv  command  should  be preferred over the Tcl
146              global variable env to query environment variables.
147
148       is-avail modulefile...
149              The is-avail command returns a true value if any of  the  listed
150              modulefiles  exists  in  enabled  MODULEPATH. If a list contains
151              more than one modulefile, then each member acts as a boolean  OR
152              operation. If an argument for is-avail is a directory and a mod‐
153              ulefile exists in the directory is-avail  would  return  a  true
154              value.
155
156              The  parameter modulefile may also be a symbolic modulefile name
157              or a modulefile alias. It may also leverage a specific syntax to
158              finely select module version (see Advanced module version speci‐
159              fiers section below).
160
161       is-loaded [modulefile...]
162              The is-loaded command returns a true value if any of the  listed
163              modulefiles  has  been  loaded or if any modulefile is loaded in
164              case no argument is provided. If a list contains more  than  one
165              modulefile,  then each member acts as a boolean OR operation. If
166              an argument for is-loaded is a directory and any modulefile from
167              the  directory  has  been  loaded  is-loaded would return a true
168              value.
169
170              The parameter modulefile may also be a symbolic modulefile  name
171              or a modulefile alias. It may also leverage a specific syntax to
172              finely select module version (see Advanced module version speci‐
173              fiers section below).
174
175       is-saved [collection...]
176              The  is-saved  command returns a true value if any of the listed
177              collections exists or if any collection exists in case no  argu‐
178              ment  is  provided. If a list contains more than one collection,
179              then each member acts as a boolean OR operation.
180
181              If MODULES_COLLECTION_TARGET is set, a suffix equivalent to  the
182              value  of  this  variable  is  appended to the passed collection
183              name. In case no collection argument is provided, a  true  value
184              will  only  be  returned  if a collection matching currently set
185              target exists.
186
187       is-used [directory...]
188              The is-used command returns a true value if any  of  the  listed
189              directories  has  been enabled in MODULEPATH or if any directory
190              is enabled in case no argument is provided. If a  list  contains
191              more  than  one directory, then each member acts as a boolean OR
192              operation.
193
194       module [sub-command] [sub-command-args]
195              Contains the same sub-commands as described in the module(1) man
196              page  in the Module Sub-Commands section. This command permits a
197              modulefile to load or unload other modulefiles.  No  checks  are
198              made  to ensure that the modulefile does not try to load itself.
199              Often it is useful to have a single modulefile that  performs  a
200              number  of  module  load commands. For example, if every user on
201              the system requires a basic set of applications loaded,  then  a
202              core  modulefile  would  contain  the necessary module load com‐
203              mands.
204
205              Command line switches --auto, --no-auto and --force are  ignored
206              when passed to a module command set in a modulefile.
207
208       module-alias name modulefile
209              Assigns the modulefile to the alias name. This command should be
210              placed in one of the modulecmd.tcl rc files in order to  provide
211              shorthand invocations of frequently used modulefile names.
212
213              The parameter modulefile may be either
214
215              · a fully qualified modulefile with name and version
216
217              · a symbolic modulefile name
218
219              · another modulefile alias
220
221       module-info option [info-args]
222              Provide  information  about  the  modulecmd.tcl program's state.
223              Some of the information is specific to  the  internals  of  mod‐
224              ulecmd.tcl.   option  is the type of information to be provided,
225              and info-args are any arguments needed.
226
227              module-info alias name
228                 Returns the full modulefile  name  to  which  the  modulefile
229                 alias name is assigned
230
231              module-info command [commandname]
232                 Returns  the  currently  running modulecmd.tcl's command as a
233                 string if no commandname is given.
234
235                 Returns 1 if modulecmd.tcl's command  is  commandname.   com‐
236                 mandname  can  be: load, unload, reload, source, switch, dis‐
237                 play, avail, aliases, list, whatis, search,  purge,  restore,
238                 help or test.
239
240              module-info loaded modulefile
241                 Returns the names of currently loaded modules matching passed
242                 modulefile.  The parameter modulefile might either be a fully
243                 qualified  modulefile  with name and version or just a direc‐
244                 tory which in case all loaded modulefiles from the  directory
245                 will be returned. The parameter modulefile may also be a sym‐
246                 bolic modulefile name or a modulefile alias.
247
248              module-info mode [modetype]
249                 Returns the current modulecmd.tcl's mode as a  string  if  no
250                 modetype is given.
251
252                 Returns  1  if modulecmd.tcl's mode is modetype. modetype can
253                 be: load, unload, remove,  switch,  display,  help,  test  or
254                 whatis.
255
256              module-info name
257                 Return the name of the modulefile. This is not the full path‐
258                 name for modulefile. See the Modules  Variables  section  for
259                 information on the full pathname.
260
261              module-info shell [shellname]
262                 Return  the  current  shell  under  which  modulecmd.tcl  was
263                 invoked if no shellname is given. The current  shell  is  the
264                 first parameter of modulecmd.tcl, which is normally hidden by
265                 the module alias.
266
267                 If a shellname is given, returns 1 if modulecmd.tcl's current
268                 shell  is  shellname,  returns 0 otherwise. shellname can be:
269                 sh, bash, ksh, zsh, csh, tcsh, fish, tcl, perl, python, ruby,
270                 lisp, cmake, r.
271
272              module-info shelltype [shelltypename]
273                 Return  the  family  of  the shell under which modulefile was
274                 invoked if no shelltypename is given. As of module-info shell
275                 this  depends  on  the  first parameter of modulecmd.tcl. The
276                 output reflects a shell type determining the shell syntax  of
277                 the commands produced by modulecmd.tcl.
278
279                 If  a  shelltypename  is  given, returns 1 if modulecmd.tcl's
280                 current shell type is  shelltypename,  returns  0  otherwise.
281                 shelltypename can be: sh, csh, fish, tcl, perl, python, ruby,
282                 lisp, cmake, r.
283
284              module-info specified
285                 Return the name of the modulefile specified  on  the  command
286                 line.
287
288              module-info symbols modulefile
289                 Returns  a  list  of  all  symbolic  versions assigned to the
290                 passed modulefile.  The parameter modulefile might either  be
291                 a  full  qualified  modulefile with name and version, another
292                 symbolic modulefile name or a modulefile alias.
293
294              module-info type
295                 Returns either C or Tcl to indicate which module  command  is
296                 being   executed,  either  the C version or the Tcl-only ver‐
297                 sion, to allow the modulefile writer to  handle  any  differ‐
298                 ences between the two.
299
300              module-info version modulefile
301                 Returns  the  physical  module name and version of the passed
302                 symbolic version modulefile.  The parameter modulefile  might
303                 either  be a full qualified modulefile with name and version,
304                 another symbolic modulefile name or a modulefile alias.
305
306       module-version modulefile version-name...
307              Assigns the symbolic version-name to the modulefile.  This  com‐
308              mand  should  be  placed in one of the modulecmd.tcl rc files in
309              order to provide shorthand invocations of frequently  used  mod‐
310              ulefile names.
311
312              The  special  version-name default specifies the default version
313              to be used for module commands, if no specific version is given.
314              This  replaces the definitions made in the .version file in for‐
315              mer modulecmd.tcl releases.
316
317              The parameter modulefile may be either
318
319              · a fully or partially qualified modulefile with name / version.
320                If  name is . (dot) then the current directory name is assumed
321                to be the module name. (Use this for deep modulefile  directo‐
322                ries.)
323
324              · a symbolic modulefile name
325
326              · another modulefile alias
327
328       module-virtual name modulefile
329              Assigns  the modulefile to the virtual module name. This command
330              should be placed in rc files in order to define virtual modules.
331
332              A virtual module stands for a module name associated to  a  mod‐
333              ulefile.  The  modulefile is the script interpreted when loading
334              or unloading the virtual module which appears or  can  be  found
335              with its virtual name.
336
337              The parameter modulefile corresponds to the relative or absolute
338              file location of a modulefile.
339
340       module-whatis string
341              Defines a string which is displayed in case of the invocation of
342              the   module   whatis  command.  There  may  be  more  than  one
343              module-whatis line  in  a  modulefile.  This  command  takes  no
344              actions  in  case  of  load,  display,  etc. invocations of mod‐
345              ulecmd.tcl.
346
347              The string parameter has to  be  enclosed  in  double-quotes  if
348              there's  more  than  one word specified. Words are defined to be
349              separated by whitespace characters (space, tab, cr).
350
351       prepend-path  [-d  C|--delim   C|--delim=C]   [--duplicates]   variable
352       value...
353              Append or prepend value to environment variable. The variable is
354              a colon,  or  delimiter,  separated  list  such  as  PATH=direc‐
355              tory:directory:directory.  The  default  delimiter is a colon :,
356              but an arbitrary one can be given by  the  --delim  option.  For
357              example  a space can be used instead (which will need to be han‐
358              dled in the Tcl specially by enclosing it in "  "  or  {  }).  A
359              space, however, can not be specified by the --delim=C form.
360
361              A reference counter environment variable is also set to increase
362              the number of times value has been added  to  environment  vari‐
363              able.  This  reference  counter environment variable is named by
364              suffixing variable by _modshare.
365
366              When value is already defined in environement  variable,  it  is
367              not added again except if --duplicates option is set.
368
369              If  the variable is not set, it is created. When a modulefile is
370              unloaded, append-path and prepend-path become remove-path.
371
372              If value corresponds to the concatenation of  multiple  elements
373              separated  by  colon,  or  delimiter, character, each element is
374              treated separately.
375
376       prereq modulefile...
377              See conflict.
378
379       remove-path [-d C|--delim C|--delim=C] [--index] variable value...
380              Remove value from the colon, or  delimiter,  separated  list  in
381              variable.  See  prepend-path or append-path for further explana‐
382              tion of using  an  arbitrary  delimiter.  Every  string  between
383              colons,  or delimiters, in variable is compared to value. If the
384              two match, value is  removed  from  variable  if  its  reference
385              counter is equal to 1 or unknown.
386
387              When --index option is set, value refers to an index in variable
388              list. The string element  pointed  by  this  index  is  set  for
389              removal.
390
391              Reference  counter  of  value  in variable denotes the number of
392              times value has been added  to  variable.  This  information  is
393              stored  in  environment  variable_modshare.  When  attempting to
394              remove  value  from  variable,  relative  reference  counter  is
395              checked  and  value  is removed only if counter is equal to 1 or
396              not defined. Otherwise value is kept in variable  and  reference
397              counter is decreased by 1.
398
399              If  value  corresponds to the concatenation of multiple elements
400              separated by colon, or delimiter,  character,  each  element  is
401              treated separately.
402
403       set-alias alias-name alias-string
404              Sets an alias or function with the name alias-name in the user's
405              environment to the string alias-string. For some shells, aliases
406              are  not  possible and the command has no effect. When a module‐
407              file is unloaded, set-alias becomes unset-alias.
408
409       set-function function-name function-string
410              Creates a function with the name  function-name  in  the  user's
411              environment  with  the  function  body function-string. For some
412              shells, functions are  not  possible  and  the  command  has  no
413              effect.  When  a  modulefile  is  unloaded, set-function becomes
414              unset-function.
415
416       setenv variable value
417              Set environment variable to value. The setenv command will  also
418              change  the  process'  environment.  A reference using Tcl's env
419              associative array will reference changes made  with  the  setenv
420              command. Changes made using Tcl's env associative array will NOT
421              change the user's environment variable like the setenv  command.
422              An  environment change made this way will only affect the module
423              parsing process. The setenv command is also useful for  changing
424              the environment prior to the exec or system command. When a mod‐
425              ulefile is unloaded, setenv becomes unsetenv. If the environment
426              variable  had  been defined it will be overwritten while loading
427              the modulefile. A subsequent unload will unset  the  environment
428              variable  -  the  previous value cannot be restored! (Unless you
429              handle it explicitly ... see below.)
430
431       system string
432              Run string command through shell. On Unix, command is passed  to
433              the  /bin/sh  shell  whereas on Windows it is passed to cmd.exe.
434              modulecmd.tcl redirects stdout to stderr since stdout  would  be
435              parsed  by the evaluating shell. The exit status of the executed
436              command is returned.
437
438       uname field
439              Provide lookup of system information. Most field information are
440              retrieved  from  the  tcl_platform array (see the tclvars(n) man
441              page).  Uname will return the string unknown if  information  is
442              unavailable for the field.
443
444              uname will invoke the uname(1) command in order to get the oper‐
445              ating system version and domainname(1) to figure out the name of
446              the domain.
447
448              field values are:
449
450              · sysname: the operating system name
451
452              · nodename: the hostname
453
454              · domain: the name of the domain
455
456              · release: the operating system release
457
458              · version: the operating system version
459
460              · machine: a standard name that identifies the system's hardware
461
462       unset-alias alias-name
463              Unsets  an alias with the name alias-name in the user's environ‐
464              ment.
465
466       unset-function function-name
467              Removes a function with the name function-name from  the  user's
468              environment.
469
470       unsetenv variable [value]
471              Unsets  environment  variable.  However, if there is an optional
472              value, then when unloading a module, it  will  set  variable  to
473              value.  The  unsetenv  command  changes the process' environment
474              like setenv.
475
476       x-resource [resource-string|filename]
477              Merge resources into the X11 resource  database.  The  resources
478              are  used  to control look and behavior of X11 applications. The
479              command will attempt to read resources  from  filename.  If  the
480              argument  isn't  a  valid  file name, then string will be inter‐
481              preted as a resource. Either filename or resource-string is then
482              passed down to be xrdb(1) command.
483
484              modulefiles  that use this command, should in most cases contain
485              one or more x-resource lines, each defining  one  X11  resource.
486              The  DISPLAY environment variable should be properly set and the
487              X11 server should be accessible. If x-resource can't  manipulate
488              the  X11  resource  database,  the  modulefile will exit with an
489              error message.
490
491              Examples:
492
493              x-resource /u2/staff/leif/.xres/Ileaf
494                 The content of the Ileaf file is merged into the X11 resource
495                 database.
496
497              x-resource [glob ~/.xres/ileaf]
498                 The  Tcl  glob  function  is used to have the modulefile read
499                 different resource files for different users.
500
501              x-resource {Ileaf.popup.saveUnder: True}
502                 Merge the Ileaf resource into the X11 resource database.
503

MODULES VARIABLES

505       The ModulesCurrentModulefile variable contains the full pathname of the
506       modulefile being interpreted.
507

LOCATING MODULEFILES

509       Every  directory  in  MODULEPATH  is searched to find the modulefile. A
510       directory in MODULEPATH can have an arbitrary  number  of  sub-directo‐
511       ries.  If  the user names a modulefile to be loaded which is actually a
512       directory, the directory is opened and a search begins  for  an  actual
513       modulefile.  First,  modulecmd.tcl looks for a file with the name .mod‐
514       ulerc in the directory. If this file exists, its contents will be eval‐
515       uated  as  if  it  was  a  modulefile  to  be  loaded.  You  may  place
516       module-version, module-alias and module-virtual  commands  inside  this
517       file.
518
519       Additionally,  before  seeking for .modulerc files in the module direc‐
520       tory, the global modulerc file and the .modulerc file found at the root
521       of  the  modulepath  directory  are  sourced,  too.  If a named version
522       default now exists for the modulefile to be loaded, the  assigned  mod‐
523       ulefile  now  will be sourced. Otherwise the file .version is looked up
524       in the module directory.
525
526       If the .version file exists, it is opened and interpreted as  Tcl  code
527       and  takes  precedence  over a .modulerc file in the same directory. If
528       the Tcl variable ModulesVersion is  set  by  the  .version  file,  mod‐
529       ulecmd.tcl  will  use  the name as if it specifies a modulefile in this
530       directory. This will become the default modulefile in this case.   Mod‐
531       ulesVersion  cannot refer to a modulefile located in a different direc‐
532       tory.
533
534       If ModulesVersion is a directory, the  search  begins  anew  down  that
535       directory.  If the name does not match any files located in the current
536       directory, the search continues through the  remaining  directories  in
537       MODULEPATH.
538
539       Every .version and .modulerc file found is interpreted as Tcl code. The
540       difference is that .version only applies to the current directory,  and
541       the  .modulerc applies to the current directory and all subdirectories.
542       Changes made in these files will affect  the  subsequently  interpreted
543       modulefile.
544
545       If  no  default  version  may  be  figured  out, an implicit default is
546       selected when this behavior is enabled (see MODULES_IMPLICIT_DEFAULT in
547       module(1)). If disabled, module names should be fully qualified when no
548       explicit default is defined for them, otherwise no default  version  is
549       found  and  an  error is returned. If enabled, then the highest numeri‐
550       cally sorted modulefile, virtual  module  or  module  alias  under  the
551       directory  will  be  used.   The  dictionary  comparison  method of the
552       lsort(n) Tcl command is used to achieve this sort. If  highest  numeri‐
553       cally  sorted  element  is an alias, search continues on its modulefile
554       target.
555
556       For example, it is possible for a user to have a  directory  named  X11
557       which  simply  contains a .version file specifying which version of X11
558       is to be loaded. Such a file would look like:
559
560          #%Module1.0
561          ##
562          ##  The desired version of X11
563          ##
564          set ModulesVersion "R4"
565
566       The equivalent .modulerc would look like:
567
568          #%Module1.0
569          ##
570          ##  The desired version of X11
571          ##
572          module-version "./R4" default
573
574       If   the   extended   default   mechanism   is   enabled   (see    MOD‐
575       ULES_EXTENDED_DEFAULT  in  module(1))  the  module version specified is
576       matched against starting portion of  existing  module  versions,  where
577       portion is a substring separated from the rest of version string by a .
578       character.
579
580       When the implicit default mechanism and  the  Advanced  module  version
581       specifiers are both enabled, a default and latest symbolic versions are
582       automatically defined for each module  name  (also  at  each  directory
583       level in case of deep modulefile). Unless a symbolic version, alias, or
584       regular module version already exists for these version names.
585
586       If user names a modulefile that cannot be found in the first modulepath
587       directory, modulefile will be searched in next modulepath directory and
588       so on until a matching modulefile is found. If search  goes  through  a
589       module alias or a symbolic version, this alias or symbol is resolved by
590       first looking at the modulefiles in the modulepath where this alias  or
591       symbol  is  defined.  If  not found, resolution looks at the other mod‐
592       ulepaths in their definition order.
593
594       When locating modulefiles, if a .modulerc, a .version, a directory or a
595       modulefile  cannot  be read during the search it is simply ignored with
596       no error message  produced.  Visibility  of  modulefiles  can  thus  be
597       adapted to the rights the user has been granted. Exception is made when
598       trying to directly access a directory or a modulefile.  In  this  case,
599       the access issue is returned as an error message.
600
601       A  modulefile,  virtual  module, module alias or symbolic version whose
602       name or element in their name starts with a . (dot) are considered hid‐
603       den.  Hidden  modulefile, virtual module, module alias or symbolic ver‐
604       sion are not displayed or taken into account except if they are explic‐
605       itly  named. By inheritance, a symbolic version-name assigned to a hid‐
606       den modulefile, virtual module or module alias is  displayed  or  taken
607       into  account only if explicitly named. Non-hidden module alias target‐
608       ing a hidden modulefile appears like any other non-hidden module alias.
609       Finally,  a  hidden symbolic version targeting a non-hidden module will
610       be displayed along its non-hidden target.
611

ADVANCED MODULE VERSION SPECIFIERS

613       When the advanced module version specifiers mechanism is  enabled  (see
614       MODULES_ADVANCED_VERSION_SPEC  in module(1)), the specification of mod‐
615       ulefile passed on Modules specific Tcl  commands  changes.   After  the
616       module  name  a  version  constraint prefixed by the @ character may be
617       added. It could be directly appended to the module  name  or  separated
618       from it with a space character.
619
620       Constraints  can be expressed to refine the selection of module version
621       to:
622
623       · a single version with the @version  syntax,  for  instance  foo@1.2.3
624         syntax will select module foo/1.2.3
625
626       · a  list  of  versions  with  the  @version1,version2,...  syntax, for
627         instance foo@1.2.3,1.10 will match modules foo/1.2.3 and foo/1.10
628
629       · a range  of  versions  with  the  @version1:,  @:version2  and  @ver‐
630         sion1:version2  syntaxes,  for instance foo@1.2: will select all ver‐
631         sions of module foo greater than  or  equal  to  1.2,  foo@:1.3  will
632         select all versions less than or equal to 1.3 and foo@1.2:1.3 matches
633         all versions between 1.2 and 1.3 including 1.2 and 1.3 versions
634
635       Advanced specification of single version or list of versions may  bene‐
636       fit  from  the  activation  of the extended default mechanism (see MOD‐
637       ULES_EXTENDED_DEFAULT in module(1)) to use an abbreviated notation like
638       @1  to refer to more precise version numbers like 1.2.3.  Range of ver‐
639       sions on its side natively handles abbreviated versions.
640
641       In order to be specified in a range of versions or compared to a  range
642       of  versions, the version major element should corresponds to a number.
643       For instance 10a, 1.2.3, 1.foo are versions valid for range  comparison
644       whereas default or foo.2 versions are invalid for range comparison.
645
646       If   the   implicit   default  mechanism  is  also  enabled  (see  MOD‐
647       ULES_IMPLICIT_DEFAULT in module(1)), a default and latest symbolic ver‐
648       sions  are  automatically  defined  for  each module name (also at each
649       directory level for deep modulefiles). These automatic version  symbols
650       are defined unless a symbolic version, alias, or regular module version
651       already exists for these default or latest version  names.   Using  the
652       mod@latest  (or  mod/latest)  syntax  ensures highest available version
653       will be selected.
654

MODULEFILE SPECIFIC HELP

656       Users can request help about a specific  modulefile  through  the  mod‐
657       ule(1)  command.  The modulefile can print helpful information or start
658       help oriented programs by defining a ModulesHelp subroutine.  The  sub‐
659       routine will be called when the module help modulefile command is used.
660

MODULEFILE SPECIFIC TEST

662       Users  can  request test of a specific modulefile through the module(1)
663       command. The modulefile can perform some sanity checks on  its  defini‐
664       tion  or  on  its underlying programs by defining a ModulesTest subrou‐
665       tine. The subroutine will be called when  the  module  test  modulefile
666       command  is used. The subroutine should return 1 in case of success. If
667       no or any other value is returned, test is considered failed.
668

MODULEFILE DISPLAY

670       The module display modulefile command will detail all changes that will
671       be  made  to  the  environment. After displaying all of the environment
672       changes modulecmd.tcl will call the ModulesDisplay subroutine. The Mod‐
673       ulesDisplay  subroutine  is  a good place to put additional descriptive
674       information about the modulefile.
675

ENVIRONMENT

677       MODULEPATH
678              Path of directories containing modulefiles.
679

SEE ALSO

681       module(1), ml(1), Tcl(n), TclX(n), xrdb(1), exec(n), uname(1),  domain‐
682       name(1), tclvars(n), lsort(n)
683

NOTES

685       Tcl was developed by John Ousterhout at the University of California at
686       Berkeley.
687
688       TclX was developed by Karl Lehenbauer and Mark Diekhans.
689
691       1996-1999  John  L.  Furlani  &  Peter  W.  Osel,  1998-2017  R.K.Owen,
692       2002-2004 Mark Lakata, 2004-2017 Kent Mein, 2016-2020 Xavier Delaruelle
693
694
695
696
6974.5.3                             2020-08-31                     MODULEFILE(4)
Impressum