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

MODULES VARIABLES

487       The ModulesCurrentModulefile variable contains the full pathname of the
488       modulefile being interpreted.
489

LOCATING MODULEFILES

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

ADVANCED MODULE VERSION SPECIFIERS

584       When the advanced module version specifiers mechanism is  enabled  (see
585       MODULES_ADVANCED_VERSION_SPEC  in module(1)), the specification of mod‐
586       ulefile passed on Modules specific Tcl commands changes. After the mod‐
587       ule name a version constraint prefixed by the @ character may be added.
588       It could be directly appended to the module name or separated  from  it
589       with a space character.
590
591       Constraints  can be expressed to refine the selection of module version
592       to:
593
594       · a single version with the @version  syntax,  for  instance  foo@1.2.3
595         syntax will select module foo/1.2.3
596
597       · a  list  of  versions  with  the  @version1,version2,...  syntax, for
598         instance foo@1.2.3,1.10 will match modules foo/1.2.3 and foo/1.10
599
600       · a range  of  versions  with  the  @version1:,  @:version2  and  @ver‐
601         sion1:version2  syntaxes,  for instance foo@1.2: will select all ver‐
602         sions of module foo greater than  or  equal  to  1.2,  foo@:1.3  will
603         select all versions less than or equal to 1.3 and foo@1.2:1.3 matches
604         all versions between 1.2 and 1.3 including 1.2 and 1.3 versions
605
606       Advanced specification of single version or list of versions may  bene‐
607       fit  from  the  activation  of the extended default mechanism (see MOD‐
608       ULES_EXTENDED_DEFAULT in module(1)) to use an abbreviated notation like
609       @1  to refer to more precise version numbers like 1.2.3.  Range of ver‐
610       sions on its side natively handles abbreviated versions.
611
612       In order to be specified in a range of versions or compared to a  range
613       of  versions, the version major element should corresponds to a number.
614       For instance 10a, 1.2.3, 1.foo are versions valid for range  comparison
615       whereas default or foo.2 versions are invalid for range comparison.
616

MODULEFILE SPECIFIC HELP

618       Users  can  request  help  about a specific modulefile through the mod‐
619       ule(1) command. The modulefile can print helpful information  or  start
620       help  oriented  programs by defining a ModulesHelp subroutine. The sub‐
621       routine will be called when the module help modulefile command is used.
622

MODULEFILE SPECIFIC TEST

624       Users can request test of a specific modulefile through  the  module(1)
625       command.  The  modulefile can perform some sanity checks on its defini‐
626       tion or on its underlying programs by defining  a  ModulesTest  subrou‐
627       tine.  The  subroutine  will  be called when the module test modulefile
628       command is used. The subroutine should return 1 in case of success.  If
629       no or any other value is returned, test is considered failed.
630

MODULEFILE DISPLAY

632       The module display modulefile command will detail all changes that will
633       be made to the environment. After displaying  all  of  the  environment
634       changes modulecmd.tcl will call the ModulesDisplay subroutine. The Mod‐
635       ulesDisplay subroutine is a good place to  put  additional  descriptive
636       information about the modulefile.
637

ENVIRONMENT

639       MODULEPATH
640          Path of directories containing modulefiles.
641

SEE ALSO

643       module(1),  Tcl(n), TclX(n), xrdb(1), exec(n), uname(1), domainname(1),
644       tclvars(n), lsort(n)
645

NOTES

647       Tcl was developed by John Ousterhout at the University of California at
648       Berkeley.
649
650       TclX was developed by Karl Lehenbauer and Mark Diekhans.
651
653       1996-1999  John  L.  Furlani  &  Peter  W.  Osel,  1998-2017  R.K.Owen,
654       2002-2004 Mark Lakata, 2004-2017 Kent Mein, 2016-2020 Xavier Delaruelle
655
656
657
658
6594.4.1                             2020-01-03                     MODULEFILE(4)
Impressum