Lmod

https://github.com/TACC/Lmod

Install

By package manager

Install tcl and lua first:

$ sudo dnf install tcl lua

Then install Lmod:

$ sudo dnf install Lmod

Note

The package name Lmod is case-sensitive.

The traditional Tcl-based module system may be already installed, check the version:

$ module --version
Modules Release 4.5.2 (2020-07-30)

Switch to new installed Lmod module system:

$ sudo alternatives --config modules.sh

This is effective in login profile. After re-login, check the version again:

$ module --version

Modules based on Lua: Version 8.7.53 2024-10-12 19:57 -05:00
    by Robert McLay mclay@tacc.utexas.edu
$ sudo apt install lmod

The installation will create login script file /etc/profile.d/lmod.sh. After re-login, check the version:

$ ml --version

Modules based on Lua: Version 6.6  2016-10-13 13:28 -05:00
    by Robert McLay mclay@tacc.utexas.edu

Build from source

Download the sources:

$ curl -L https://github.com/TACC/Lmod/archive/refs/tags/8.7.60.tar.gz -o Lmod-8.7.60.tar.gz

Toolchains for building:

  • gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

  • GNU Make 4.3

  • debuild version 2.22.1ubuntu1

Preinstall these packages:

$ sudo apt install bc lua5.3 lua-posix liblua5.3-dev tcl-dev

Extract the sources and build:

$ tar -C ~/workspace/devel/ -xzf Lmod-8.7.60.tar.gz
$ cd ~/workspace/devel/Lmod-8.7.60
$ ./configure --with-lua_include=/usr/include/lua5.3/
$ sudo make install

Create/replace the profile script:

$ sudo ln -snf /usr/local/lmod/lmod/init/profile /etc/profile.d/z00_lmod.sh

After re-login, check the version:

$ ml --version

Modules based on Lua: Version 8.7.60 2025-04-30 12:50 -05:00
    by Robert McLay mclay@tacc.utexas.edu

Usage

List available modules:

$ ml avail

------------------------------------------------------ /usr/local/lmod/lmod/modulefiles/Core -------------------------------------------------------
   lmod    settarg

If the avail list is too long consider trying:

"module --default avail" or "ml -d av" to just list the default modules.
"module overview" or "ml ov" to display the number of modules for each name.

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

Or for a more consice list:

$ ml ov

------------------------------------------------------ /usr/local/lmod/lmod/modulefiles/Core -------------------------------------------------------
lmod (1)   settarg (1)

List loaded modules:

$ ml list
No modules loaded

Load a module:

$ ml lmod
$ ml list

Currently Loaded Modules:
  1) lmod

Unload a module:

$ ml unload lmod
$ ml list
No modules loaded