This repository contains utility scripts for building and installing Chaste's software dependencies as environment modules. It also contains Dockerfiles for building GitHub runner Docker images with specified dependency versions.
The Environment Modules system allows users to switch between different software versions installed on the same system by reconfiguring the shell environment.
See the Environment Modules documentation for installation instructions on different systems. On Ubuntu, environment-modules
can be installed from the apt
repository:
apt-get install environment-modules
Important
To activate the Environment Modules system after installation, close the current shell and start a new session. Alternatively, load the activation script directly into the current shell:
source /etc/profile.d/modules.sh
Modulefiles are recipes used to reconfigure the shell environment for alternative software versions. The MODULEPATH
environment variable is a list of locations where modulefiles are stored on the system.
Tip
Directories containing modulefiles can be added to MODULEPATH
using the command module use <path/to/modulefiles>
.
The commands below create a directory for modules and adds it to the MODULEPATH
.
# Create a directory for storing modulefiles
MODULES_DIR=${HOME}/modules
mkdir -p ${MODULES_DIR}/modulefiles
# Add the directory to MODULEPATH
module use ${MODULES_DIR}/modulefiles
# Add the directory to MODULEPATH automatically in future bash sessions
echo "module use ${MODULES_DIR}/modulefiles" >> ${HOME}/.bashrc
Clone this repository and navigate to the build scripts
git clone https://github.com/Chaste/dependency-modules.git
cd dependency-modules/scripts/custom
Note
Running the build scripts will build and install software in this directory structure:
<MODULES_DIR>
|-- modulefiles/
|-- opt/
`-- src/
Software will be downloaded and built in src/
and installed in opt/
.
A modulefile for each software built will be created in modulefiles/
.
Install XSD
./install_xsd.sh --version=4.0.0 --modules-dir=${MODULES_DIR}
Install Xerces-C
./install_xercesc.sh --version=3.2.4 --modules-dir=${MODULES_DIR}
Install SUNDIALS
./install_sundials.sh --version=6.4.0 --modules-dir=${MODULES_DIR}
Install Boost
./install_boost.sh --version=1.83.0 --modules-dir=${MODULES_DIR}
Install VTK
./install_vtk.sh --version=9.3.1 --modules-dir=${MODULES_DIR}
Install PETSc + HDF5
./install_petsc_hdf5.sh --petsc-version=3.19.6 --hdf5-version=1.10.10 --petsc-arch=linux-gnu-opt --modules-dir=${MODULES_DIR}
Tip
After installation empty the src/
directory as the build files are no longer needed.
cd ${MODULES_DIR} && rm -rI src/*
Use module avail
to show available software modules
---------------- /home/<user>/modules/modulefiles ----------------
boost/1.83.0 vtk/9.3.1
petsc_hdf5/3.19.6_1.10.810/linux-gnu-opt xercesc/3.2.4
sundials/6.4.0 xsd/4.0.0
Use module load
to activate software modules
module load xsd/4.0.0
module load xercesc/3.2.4
module load sundials/6.4.0
module load boost/1.83.0
module load vtk/9.3.1
module load petsc_hdf5/3.19.6_1.10.10/linux-gnu-opt
Configure and build Chaste as normal following the instructions in the documentation.
Below is a subset of commonly used module
commands. See the environment modules documentation for a more comprehensive manual.
Command | Description |
---|---|
module use <path/to/modulefiles> |
Make software modules located on the specified path available. |
module avail |
List all available software modules. |
module avail <search_string> |
Search for software modules that match the search string. |
module load <module> |
Load a software module into the environment. |
module list |
List all currently loaded software modules. |
module unload <module> |
Unload a software module from the environment. |
module purge |
Unload all currently loaded software modules. |
module switch <module/ver0> <module/ver1> |
Unload module/ver0 and load module/ver1 . |
module show <module> |
Show the environment settings for a module. |