Skip to content

Installation guide

SLOTH is written in C++17/C++20. It can be built under Linux and MacOS using CMake. The main prerequisite is the MFEM Finite Element library developed in C++ by LLNL1.

MFEM can be installed in several ways but the use of spack on Linux and Homebrewon MacOS is recommended for sake of simplicity.

Installing SLOTH therefore consists of first installing MFEM and compiling SLOTH. The basic procedure is then provided for the Linux platforms using spack, the Linux platforms from source files and the MacOs platforms, but also for supercomputers where SLOTH is intended to be used.

For certain applications, SLOTH utilizes C++ APIs contained within the library libTorch to load PyTorch models. The basic procedure also includes instructions for installing libTorch.


  1. Robert Anderson, Julian Andrej, Andrew Barker, Jamie Bramwell, Jean-Sylvain Camier, Jakub Cerveny, Veselin Dobrev, Yohann Dudouit, Aaron Fisher, Tzanio Kolev, and others. Mfem: a modular finite element methods library. Computers & Mathematics with Applications, 81:42–74, 2021.