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 among available modules **(Lmod only)**
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
$> brew install lua
# Homebrew does not provide special Lua dependencies
$> luarocks-5.2 install luafilesystem
$> luarocks-5.2 install luaposi

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
export LUA_PREFIX="$HOME/.local/share/luarocks"
export LUA_PATH="$LUA_PREFIX/share/lua/5.2/?.lua;$LUA_PATH"
export LUA_CPATH="$LUA_PREFIX/lib/lua/5.2/?.so;$LUA_CPATH"

Now it should be fine to install LMod:

1
$> brew install lmod

After this installation:

  • lmod command is located in $(brew --prefix lmod)/libexec and you probably wants to make an alias for it

        alias 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
$> yum install environment-modules
$> yum install epel-release -y
$> yum install --enable-repo=epel-testing Lmod
  • 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
export EASYBUILD_PREFIX=$HOME/.local/easybuild
export EASYBUILD_MODULES_TOOL=Lmod
export EASYBUILD_MODULE_NAMING_SCHEME=CategorizedModuleNamingScheme
# Use the below variable to run:
#    module use $LOCAL_MODULES
#    module load tools/EasyBuild
export LOCAL_MODULES=${EASYBUILD_PREFIX}/modules/all

alias ma="module avail"
alias ml="module list"
function mu(){
    module use $LOCAL_MODULES
    module load tools/EasyBuild
}

Then source this file to expose the environment variables:

1
2
3
$> source ~/.bashrc
$> echo $EASYBUILD_PREFIX
/home/svarrette/.local/easybuild

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
# download installation script
$> curl -o /tmp/bootstrap_eb.py  https://raw.githubusercontent.com/easybuilders/easybuild-framework/develop/easybuild/scripts/bootstrap_eb.py

# install Easybuild
$> python /tmp/bootstrap_eb.py $EASYBUILD_PREFIX

# Load it
$> echo $MODULEPATH
$> module use $LOCAL_MODULES
$> echo $MODULEPATH
$> module spider Easybuild
$> module load tools/EasyBuild

# Alternatively, just use the 'mu' alias to load your local modules and easybuild
$> mu
$> eb --version

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
$> eb -S Spark
CFGS1=/opt/apps/resif/data/easyconfigs/ulhpc/default/easybuild/easyconfigs/s/Spark
CFGS2=/home/svarrette/.local/easybuild/software/tools/EasyBuild/3.2.1/lib/python2.7/site-packages/easybuild_easyconfigs-3.2.1-py2.7.egg/easybuild/easyconfigs/s/Spark
 * $CFGS1/Spark-2.1.1.eb
 * $CFGS2/Spark-1.3.0.eb
 * $CFGS2/Spark-1.4.1.eb
 * $CFGS2/Spark-1.5.0.eb
 * $CFGS2/Spark-1.6.0.eb
 * $CFGS2/Spark-1.6.1.eb
 * $CFGS2/Spark-2.0.0.eb
 * $CFGS2/Spark-2.0.2.eb

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
$> cd <CFGS1>  # go to the directory holding the easyconfigs you wish to install
$> eb Spark-2.1.1.eb -Dr    # Dry-run
$> eb Spark-2.1.1.eb -r