Building riot
riot builds on Linux with CMake. Windows users should build it in Windows
Subsystem for Linux (WSL); after WSL is installed, the Linux build steps are
the same as on Ubuntu.
Prerequisites
riot requires CMake 3.26 or newer, a C++17-capable compiler, MPI, and a
parallel HDF5 installation. For Ubuntu, install the base dependencies with:
sudo apt update
sudo apt install -y build-essential libhdf5-mpich-dev git cmake curl \
python3 python3-dev python3-venv
Clone riot and all required submodules:
git clone --recursive git@github.com:lanl/riot.git
cd riot
If the repository was cloned without submodules, initialize them before configuring:
git submodule update --init --recursive
Python environment
riot’s Python interface requires Python development files and NumPy. A virtual
environment keeps Python packages isolated from the system installation:
python3 -m venv riot_venv
. riot_venv/bin/activate
python -m pip install --upgrade pip
python -m pip install numpy
python -m pip install "pybind11[global]"
Additional Python packages, such as scipy and h5py, may be installed
in this virtual environment when needed by an input deck. Do not install them
into a Conda or Micromamba environment that CMake will use to locate parallel
HDF5 unless that environment provides a compatible MPI-enabled HDF5 package.
Configure, build, and install
Create a separate build directory. The following configuration uses the active
virtual environment for Python and installs riot’s runtime files into it:
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DPython_ROOT_DIR="$VIRTUAL_ENV" \
-DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV"
cmake --build build --parallel 6
cmake --install build
The executable is built at build/src/riot. To run a Cartesian example:
cd build/src
cp ../../inputs/triple/triple.py .
./riot -i "$(python triple.py)"
mpirun -np 4 ./riot -i "$(python triple.py)"
The final command runs the example with four MPI ranks.
Optional plugin physics
The optional CMake parameter PLUGINS_DIR enables additional plugin physics
from a downstream source directory. Add it to the configuration command above:
cmake -S . -B build -DPLUGINS_DIR=/absolute/path/to/plugins
cmake --build build --parallel 6
The directory must contain a CMakeLists.txt.
Plugins are compiled into riot. When PLUGINS_DIR is empty (the default),
the build uses the no-op implementations in src/plugin_stubs. Set
-DPLUGINS_DIR= to restore that behavior in an existing build directory.
See Implementing the plugin interface in the programmer’s guide for the required interface functions and plugin CMake setup.
Building in WSL
Install WSL and Ubuntu from an elevated Windows PowerShell prompt:
wsl --list --online
wsl --install Ubuntu-24.04
Restart Windows if prompted, launch Ubuntu, and create a Linux username and
password. Then follow the Ubuntu instructions above inside the Ubuntu terminal.
Windows drives are available under /mnt; for example, the C: drive is
mounted at /mnt/c.
Micromamba alternative
Micromamba can be used instead of a Python virtual environment. After creating
and activating an environment with MPI-enabled HDF5, configure riot with its
prefix:
"${SHELL}" <(curl -L micro.mamba.pm/install.sh)
source ~/.bashrc
micromamba create -n riot python=3.12 numpy matplotlib scipy h5py \
'hdf5=*=mpi*' zlib cmake cxx-compiler c-compiler pkg-config
micromamba activate riot
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \
-DHDF5_ROOT="$CONDA_PREFIX" \
-DHDF5_IS_PARALLEL=ON \
-DHDF5_PREFER_PARALLEL=ON \
-DPython_ROOT_DIR="$CONDA_PREFIX" \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX"
Build options
Pass options to CMake as -DOPTION=VALUE. The options below are defined by
riot; additional Parthenon and Kokkos options are available from their
documentation.
Option |
Default |
Description |
|---|---|---|
|
|
Build configuration. Common alternatives are |
|
empty |
Optional source directory containing a |
|
|
Build |
|
|
Build |
|
|
Version of the regression-gold GitHub Release asset to use. |
|
SHA-512 for the default gold archive |
Expected SHA-512 of the selected regression-gold archive. Set this with
|
|
|
Download and extract the selected regression-gold archive during CMake configuration when regression tests are enabled. |
|
unset |
Path to a pre-downloaded regression-gold archive. When set, CMake uses
this file instead of downloading from GitHub, after verifying it against
|
|
|
Enable CUDA support in |
|
|
Enable HDF5 support. MPI builds require a parallel HDF5 installation. |
|
|
Enable MPI support. |
|
|
Enable OpenMP support in |
|
|
Enable compiler warnings. |
|
|
Enable the address sanitizer. |
|
|
Enable NDI support for the |
|
|
Build the bundled NDI dependency. This option is available only when
|
|
|
Build the bundled Catch2. Set to |
|
|
Build the bundled Parthenon. Set to |
|
|
Build the bundled singularity-eos. Set to |
|
|
Build |
|
|
Enable CAD-file support through OpenCASCADE. |
|
|
Maximum number of materials stored per mesh block. |
|
|
Maximum number of strong materials. |
|
|
Maximum number of advected quantities. |
|
|
Maximum number of radiation energy groups. |
|
|
Coordinate system: |
|
unset |
Path to a Parthenon machine-configuration file for compiler and platform defaults. |