Installation and setup
Configure the dependencies, install the library, and verify an application.
Installation starts by configuring Rodin with the dependencies for the desired features, continues with building and installing the library, and finishes by compiling a small application against the installed package. Begin with a local installation before enabling additional solver or parallel backends.
System requirements
Required dependencies
The following dependencies are required:
- CMake 3.16.0+ - Build system generator
- C++20 compatible compiler - GCC 12+, Clang 14+, or AppleClang
- Boost 1.74+ - C++ libraries collection
- Eigen3 - Linear algebra library
- HDF5 with C support - Mesh and field storage
- Git LFS - Required when building or installing resources
Optional dependencies
Optional modules use the following dependencies:
- OpenMP (
libomp) - For parallel execution - SuiteSparse (
libsuitesparse) - For additional linear solvers - METIS (
libmetis) - For graph partitioning - MPI - For distributed computing
- PETSc - For PETSc algebra and solvers (enabled by default)
- MMG - For mesh optimization (included as submodule)
Installing dependencies
Ubuntu/Debian
On Ubuntu or Debian-based systems, install the required dependencies with the following command.
sudo apt-get update sudo apt-get install cmake libboost-all-dev libeigen3-dev libhdf5-dev libomp-dev sudo apt-get install git-lfs # needed for resources
Install the optional dependencies with the following command.
sudo apt-get install libsuitesparse-dev libmetis-dev libopenmpi-dev
macOS
On macOS, use Homebrew to install dependencies.
brew install cmake boost eigen hdf5 libomp brew install git-lfs # needed for resources
Install the optional dependencies with the following command.
brew install suite-sparse metis open-mpi
Installing Rodin
Clone the repository
First, clone the Rodin repository with all submodules.
git clone --recursive https://github.com/cbritopacheco/rodin.git cd rodin
The --recursive flag clones the third-party submodules. An existing checkout can be initialized with the following command. git submodule update --init --recursive
Files under resources/ are stored with Git LFS. Resource-dependent examples use the files hydrated after cloning.
git lfs install git lfs pull
Library-only builds, CI-style checks, and installation tests that do not need the full resource tree can skip LFS hydration by configuring with -DRODIN_INSTALL_RESOURCES=OFF.
Build and install
Rodin uses CMake as its build system. There are two common installation methods.
User-local installation (recommended)
For a user-local installation, set the install prefix to the home directory.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="$HOME/.local" \ -DRODIN_USE_PETSC=OFF -DRODIN_INSTALL_RESOURCES=OFF cmake --build build --parallel 4 cmake --install build
This starting configuration disables PETSc and resource installation. PETSc is enabled by default; omit the RODIN_USE_PETSC=OFF option only when PETSc is available. Resource-dependent examples still require hydrated resources. The configuration reference lists the feature switches.
To let applications find this installation, add the prefix to the CMake search path in the shell profile (~/.bashrc or ~/.zshrc).
export CMAKE_PREFIX_PATH="$HOME/.local${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}"
System-wide installation
Install Rodin system-wide (requires sudo).
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DRODIN_USE_PETSC=OFF -DRODIN_INSTALL_RESOURCES=OFF cmake --build build --parallel 4 sudo cmake --install build
Verify an installed application
Use the complete program and CMake project in First steps with Rodin. Configure it in a separate application directory after installation. It creates a mesh and a finite element space and reports 64 vertices, 98 triangles, and 64 scalar P1 degrees of freedom.
This checks package discovery, compilation, linkage, and a small runtime operation. The numerical test suite provides the separate verification of library algorithms.
Troubleshooting
CMake can't find Rodin
If CMake reports that it cannot find the Rodin package, ensure that CMAKE_PREFIX_PATH includes the Rodin installation directory.
cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/rodin/installation
Linker errors
Link applications through the imported Rodin:: CMake targets. Include targets for every module used, such as Rodin::IO for XDMF export. Check that the installed library and the application use compatible compilers and dependency installations.
Git LFS resources
If a mesh file begins with a Git LFS pointer instead of mesh data, hydrate the resources from the repository directory.
git lfs pull
For a library-only installation, configure with -DRODIN_INSTALL_RESOURCES=OFF.
Compiler errors
Verify that you're using a C++20 compatible compiler.
g++ --version # Should be 12.0 or higher clang++ --version # Should be 14.0 or higher
What's next?
Continue with First steps with Rodin to build the verification application, then A first problem for a complete solve.