Tutorial: Easybuild and [Environment] Modules
As you may have followed, we use Easubuild on the UL HPC platform to build the software proposed to the users on the facility and available as Environment modules.
Below are some short notes explaining these elements, and how I like to install Easubuild
Table of Content
Environment modules
Environment Modules are a standard and well-established technology across HPC sites, to permit developing and using complex software and libraries builds with dependencies, allowing multiple versions of software stacks and combinations thereof to co-exist.
The tool in itself is used to manage environment variables such as PATH
, LD_LIBRARY_PATH
and MANPATH
, enabling the easy loading and unloading of application/library profiles and their dependencies.
Command | Description |
---|---|
module avail |
Lists all the modules which are available to be loaded |
module spider <pattern> |
Search for |
module load <mod1> [mod2...] |
Load a module |
module unload <module> |
Unload a module |
module list |
List loaded modules |
module purge |
Unload all modules (purge) |
module display <module> |
Display what a module does |
module use <path> |
Prepend the directory to the MODULEPATH environment variable |
module unuse <path> |
Remove the directory from the MODULEPATH environment variable |
Note: for more information, see the reference man pages for modules and modulefile, or the official FAQ. You can also see our modules page on the UL HPC website.
At the heart of environment modules interaction resides the following components:
- the
MODULEPATH
environment variable, which defined the list of searched directories for modulefiles modulefile
(see an example) associated to each available software.
Lmod
Lmod is a Lua based module system that easily handles the MODULEPATH
Hierarchical problem.
Lmod is a new implementation of Environment Modules that easily handles the MODULEPATH Hierarchical problem. It is drop-in replacement for TCL/C modules and reads TCL modulefiles directly. In particular, Lmod add many interesting features on top of the traditional implementation focusing on an easier interaction (search, load etc.) for the users. Thus that’s the tool I would advise to deploy.
Installation Notes (Mac OS X)
The best is to use HomeBrew
1 2 3 4 |
|
Note: You can also use --local
option (or the --tree <path>
) to have the LUA packages installed in ~/.luarocks
(or <path>
). If you use --tree <path>
, you need to update the environmental variables LUA_PATH
and LUA_CPATH
as follows:
1 2 3 |
|
Now it should be fine to install LMod:
1
|
|
After this installation:
-
lmod
command is located in$(brew --prefix lmod)/libexec
and you probably wants to make an alias for italias lmod='$(brew --prefix lmod)/libexec/lmod'
-
You may want to load LMOD variables from your favorite shell init script:
source $(brew --prefix lmod)/init/$(basename $SHELL)
Installation Notes (Linux/CentOS 7)
Prerequisites: You need to have the EPEL testing repositories in the sources list. (Do not enable it by default). Then install the Lmod package using this repo.
1 2 3 |
|
- Note: under Debian/Ubuntu, it should be sufficient to run
apt-get install environment-modules lmod
You can now use Lmod in a version compatible with EasyBuild.
Easybuild
- Reference documentation
- Reference Github repositories:
- Easyconfigs – collection of recipes for installing software with EasyBuild
- Easyblocks – collection of basic bricks/templates used for building and installing software with EasyBuild.
Easybuild is a software build and installation framework that allows you to manage (scientific) software on High Performance Computing (HPC) systems in an efficient way. It is motivated by the need for a tool that combines the following features:
- a flexible framework for building/installing (scientific) software
- fully automates software builds
- full support and setup of Environment Modules or Lmod, eventually with a hierarchical layout
- divert from the standard
configure / make / make install
with custom procedures - allows for easily reproducing previous builds
- keep the software build recipes/specifications simple and human-readable
- supports co-existence of versions/builds via dedicated installation prefix and module files
- enables sharing with the HPC community
- automagic dependency resolution
- retain logs for traceability of the build processes
For all these reasons, Easybuild has been selected as the reference middleware to handle the building and the installation of the software provided via the modules environment.
Installation Notes
You can install Easybuild following the official instructions. Here is how I personally like to proceed:
Add the following entries to your ~/.bashrc
(or if you have root rights, in /etc/profile.d/easybuild.sh
):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Then source this file to expose the environment variables:
1 2 3 |
|
Now let’s install Easybuild following the boostrapping procedure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
From now on, you can search for existing recipes / easyconfigs and try to build it.
1 2 3 4 5 6 7 8 9 10 11 |
|
In the above example, Spark easyconfigs can be found from two source directories $CFGS1
and $CFGS2
.
Now you can try to build and install once of these recipes, generally the most recent one:
1 2 3 |
|