|
|
Environment Modules provide a convenient way to dynamically change the users’ environment through modulefiles. This includes easily adding or removing directories to the PATH environment variable.
|
|
|
The software Lmod, a Lua based environment module system, is used in the ELT Development environment and replace the former VLT pecs.
|
|
|
|
|
|
**TOC**
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
------------------------
|
|
|
|
|
|
# Introduction to ELT Environmental Modules System
|
|
|
|
|
|
An introduction to the Lmod usage in the ELT Development Environment can be found in section 3.2 of [ESO-288431 - Guide to Developing Software for the EELT](https://pdm.eso.org/kronodoc/HQ/ESO-288431)
|
|
|
|
|
|
# What is Lmod ?
|
|
|
Lmod is a Lua based module system that easily handles the MODULEPATH Hierarchical problem. Environment Modules provide a convenient way to dynamically change the users’ environment through modulefiles. This includes easily adding or removing directories to the PATH environment variable. Modulefiles for Library packages provide environment variables that specify where the library and header files can be found.
|
|
|
- https://lmod.readthedocs.io/en/latest/index.html
|
|
|
|
|
|
# What is the lua programming language?
|
|
|
|
|
|
You can find information about the lua programming language at this link:
|
|
|
- https://www.lua.org/pil/contents.html
|
|
|
|
|
|
# What are the basic lua Modulefile (lmod) functions?
|
|
|
|
|
|
This page provides a compact but clear introduction to the usage of lua and to the main available functions for the usage in lmod:
|
|
|
|
|
|
- https://lmod.readthedocs.io/en/latest/050_lua_modulefiles.html
|
|
|
|
|
|
# Where are the ELT DevEnv lua files?
|
|
|
|
|
|
The standard ELT development environment provides some lua files to set default variables (`PATH`, `LD_LIBRARY_PATH` …). There are located under:
|
|
|
|
|
|
- `/elt/System/modulefiles`
|
|
|
|
|
|
The `eltdev.lua` file is loaded by default at login and contains all the default setting (including the load of package python and jdk)
|
|
|
|
|
|
In addition, the user can define private lua files under the directory:
|
|
|
|
|
|
```
|
|
|
$HOME/modulefiles
|
|
|
```
|
|
|
|
|
|
From this directory, Lmod will make available all the lua file and load by default, the files `private.lua` and `private-<hostname>.lua` if exist.
|
|
|
|
|
|
# What are the Lmod basic commands?
|
|
|
|
|
|
```
|
|
|
$ module help # display Lmod help message
|
|
|
$ module list # list of modules loaded
|
|
|
$ module show package # Display what is executed by the module
|
|
|
$ module avail # list of modules available to be loaded
|
|
|
```
|
|
|
Lmod uses the directories listed in `$MODULEPATH` to find the modulefiles to load, `/elt/System/modulefiles` and `$HOME/modulefiles` are added by default. With the sub-command `avail` Lmod reports only the modules that are in the current `MODULEPATH`. Those are the only modules that the user can load.
|
|
|
|
|
|
User can add/remove a directory to the MODULEPATH with;
|
|
|
|
|
|
```
|
|
|
$ module use /path/to/modulefiles # Add the directory to $MODULEPATH search path
|
|
|
$ module unuse /path/to/modulefiles # Remove directory from $MODULEPATH
|
|
|
```
|
|
|
A user logs in with the standard modules loaded. Then the user modifies the default setup through the standard module commands:
|
|
|
```
|
|
|
$ module load package1 package2 … # load modules
|
|
|
$ module unload package1 package2 … # unload modules
|
|
|
```
|
|
|
Once users have the desired modules load then they can issue:
|
|
|
|
|
|
This creates a file called `~/.lmod.d/default` which has the list of desired modules (collection). This default collection will be the user’s initial set of modules (loaded at login).
|
|
|
Users can have as many collections as they like. They can save to a named collection with:
|
|
|
|
|
|
```
|
|
|
$ module save <collection_name>
|
|
|
```
|
|
|
And, at any time, it is possible to restore the set of modules saved in that named collection with:
|
|
|
```
|
|
|
$ module restore <collection_name>
|
|
|
$ module save
|
|
|
``` |
|
|
\ No newline at end of file |