This guide provides instructions for building and installing the Rodin finite element library.
- Requirements
- Building from Source
- Installation
- Using Rodin in Your Project
- CMake Configuration Options
- CMake 3.16.0+ - Build system generator
- C++20 compatible compiler - GCC 10+, Clang 10+, or MSVC 2019+
- Boost 1.74+ - Required components:
filesystem,serialization - Eigen3 3.4+ - Linear algebra library
- OpenMP - For parallel computations (recommended)
- MPI - For distributed computing
- PETSc - For advanced solvers
- Scotch - For graph partitioning
- SuiteSparse - For direct solvers (UMFPACK, CHOLMOD, SPQR, KLU)
- VTK - For visualization
git clone --recursive https://github.com/cbritopacheco/rodin.git
cd rodinImportant: Use --recursive to initialize git submodules (eigen, googletest, etc.).
If you've already cloned without --recursive, run:
git submodule update --init --recursivemkdir build
cd buildBasic configuration:
cmake ..Configuration with options:
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DRODIN_BUILD_EXAMPLES=ON \
-DRODIN_MULTITHREADED=ONmake -j$(nproc)Or specify the number of parallel jobs:
make -j4sudo make installThis will install:
- Libraries to
${CMAKE_INSTALL_PREFIX}/lib - Headers to
${CMAKE_INSTALL_PREFIX}/include/Rodin - CMake config files to
${CMAKE_INSTALL_PREFIX}/lib/cmake/Rodin - Resources to
${CMAKE_INSTALL_PREFIX}/share/Rodin/resources
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local
make -j4
make installmake install DESTDIR=/tmp/rodin-installCreate a CMakeLists.txt file:
cmake_minimum_required(VERSION 3.16)
project(MyProject CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find the installed Rodin package
find_package(Rodin REQUIRED)
# Create your executable
add_executable(my_app main.cpp)
# Link against Rodin libraries
target_link_libraries(my_app PRIVATE
Rodin::Geometry
Rodin::Variational
)#include <Rodin/Geometry.h>
#include <Rodin/Variational.h>
#include <iostream>
using namespace Rodin;
using namespace Rodin::Geometry;
using namespace Rodin::Variational;
int main()
{
// Create a uniform triangular mesh
Mesh mesh;
mesh = mesh.UniformGrid(Polytope::Type::Triangle, {16, 16});
// Define finite element space
P1 Vh(mesh);
std::cout << "Mesh has " << mesh.getCellCount() << " cells" << std::endl;
std::cout << "FE space has " << Vh.getSize() << " DOFs" << std::endl;
return 0;
}mkdir build && cd build
cmake ..
make
./my_appIf Rodin is installed in a non-standard location:
cmake .. -DCMAKE_PREFIX_PATH=/path/to/rodin/install| Option | Description | Default |
|---|---|---|
RODIN_BUILD_SRC |
Build the Rodin source code | ON |
RODIN_BUILD_EXAMPLES |
Build the Rodin examples | ON |
RODIN_BUILD_UNIT_TESTS |
Build Rodin unit tests | OFF |
RODIN_BUILD_MANUFACTURED_TESTS |
Build manufactured solution tests | OFF |
RODIN_BUILD_BENCHMARKS |
Build Rodin benchmarks | OFF |
RODIN_BUILD_DOC |
Build the Rodin documentation | OFF |
| Option | Description | Default |
|---|---|---|
RODIN_USE_OPENMP |
Enable OpenMP support | OFF (auto ON with RODIN_MULTITHREADED) |
RODIN_MULTITHREADED |
Enable multithreading capabilities | ON |
RODIN_THREAD_SAFE |
Enforce thread-safety | OFF (auto ON with RODIN_MULTITHREADED) |
RODIN_WITH_PLOT |
Build the Rodin::Plot module | OFF |
RODIN_WITH_PY |
Build Python bindings | OFF |
| Option | Description | Default |
|---|---|---|
RODIN_USE_MPI |
Enable MPI support | OFF |
RODIN_USE_PETSC |
Enable PETSc support | OFF |
RODIN_USE_UMFPACK |
Enable UMFPACK solver | OFF |
RODIN_USE_CHOLMOD |
Enable CHOLMOD solver | OFF |
RODIN_USE_SPQR |
Enable SPQR solver | OFF |
RODIN_USE_KLU |
Enable KLU solver | OFF |
RODIN_USE_SUPERLU |
Enable SuperLU solver | OFF |
RODIN_USE_PASTIX |
Enable PaStiX solver | OFF |
RODIN_USE_PARDISO |
Enable Pardiso solver | OFF |
RODIN_USE_SCOTCH |
Enable Scotch support | OFF |
| Option | Description | Default |
|---|---|---|
BUILD_SHARED_LIBS |
Build using shared libraries | OFF |
RODIN_LTO |
Compile with link time optimization | OFF |
RODIN_CODE_COVERAGE |
Compile with code coverage flags | OFF |
RODIN_SILENCE_WARNINGS |
Silence warnings outputted by Rodin | OFF |
RODIN_SILENCE_EXCEPTIONS |
Silence exceptions thrown by Rodin | ON |
When you find_package(Rodin), the following targets become available:
Rodin::Rodin- Main interface libraryRodin::Geometry- Mesh and geometry functionalityRodin::Variational- Variational formulationsRodin::Solver- Solver interfacesRodin::Math- Mathematical utilitiesRodin::IO- Input/output functionalityRodin::QF- Quadrature formulasRodin::Assembly- Assembly routinesRodin::FormLanguage- Form language support
Rodin::Alert- Logging and alertsRodin::Utility- General utilitiesRodin::Context- Execution contextRodin::Threads- Threading supportRodin::Serialization- Serialization supportRodin::Test- Testing utilities
Rodin::Models::Eikonal- Eikonal equation modelsRodin::Models::Advection- Advection models
Rodin::Plot- Plotting (requiresRODIN_WITH_PLOT=ON)Rodin::PETSc- PETSc integration (requiresRODIN_USE_PETSC=ON)Rodin::Scotch- Scotch integration (requiresRODIN_USE_SCOTCH=ON)Rodin::MPI- MPI support (requiresRODIN_USE_MPI=ON)
If CMake cannot find required dependencies:
# For Eigen3
sudo apt-get install libeigen3-dev # Ubuntu/Debian
brew install eigen # macOS
# For Boost
sudo apt-get install libboost-all-dev # Ubuntu/Debian
brew install boost # macOSIf you see errors about missing third-party libraries:
git submodule update --init --recursiveIf dependencies are installed in non-standard locations:
cmake .. \
-DEigen3_DIR=/path/to/eigen3/share/eigen3/cmake \
-DBoost_ROOT=/path/to/boost- Documentation: https://cbritopacheco.github.io/rodin/docs/
- GitHub Issues: https://github.com/cbritopacheco/rodin/issues
- Examples: See the
examples/directory in the source tree
Rodin is distributed under the Boost Software License, Version 1.0.
See the LICENSE file for details.