## Contributed by Fotis Georgatos <fotis@cern.ch>, as means to help others wishing to ride on Lmod
#
# This script helps to implement policy: https://hpcbios.readthedocs.org/en/latest/HPCBIOS_06-17.html
#
# prereq: Lmod/5.9.5-GCC-4.8.4
# prereq: Lua/5.1.4-8-GCC-4.8.4
#
# build prereqs, take a note: GCC/4.8.4 & ncurses/5.9

## Remember to change the following, as per individual case
EASYBUILD_PREFIX=${EASYBUILD_PREFIX:-"$HOME/.local/easybuild"}

TOOLCHAIN="GCC-4.8.4"
VERSIONLUA="5.1.4-8"
VERSIONLMOD="5.9"

PREFIXLUA=$EASYBUILD_PREFIX/software/Lua/$VERSIONLUA-$TOOLCHAIN
PREFIXLMOD=$EASYBUILD_PREFIX/software/Lmod/$VERSIONLMOD-$TOOLCHAIN/lmod/$VERSIONLMOD

export PATH=$PREFIXLUA/bin:$PREFIXLUA/libexec:$PATH
export LMOD_MPATH_AVAIL=yes     # `module avail` now also searches the pathnames of modulefiles
source $PREFIXLMOD/init/profile

export PAGER=cat                # Keep it simple, for a start
unset LMOD_IGNORE_CACHE         # Lmod cache should be working now
export LMOD_COLORIZE=YES        # YMMV

echo 'Now, try fi. `module avail -d compiler` or `ml av` and observe output'
