Build options#
Every Ginkgo build is controlled through CMake -D flags. This page groups
them by purpose. For installation walkthroughs and prerequisites, see
Install.
Backend modules#
Each backend compiles a separate set of kernels. Reference is required as the correctness baseline; the others are auto-detected from the toolchain.
Flag |
Type |
Purpose |
|---|---|---|
|
|
Single-threaded CPU reference kernels — the correctness baseline. Defaults to |
|
|
OpenMP-parallel CPU kernels. Defaults to |
|
|
CUDA kernels for NVIDIA GPUs. Defaults to |
|
|
HIP kernels for AMD (and via |
|
|
SYCL kernels for Intel GPUs (and other SYCL-enabled hardware). Defaults to |
|
|
The distributed module — |
|
|
Asserts (does not detect) that the linked MPI build accepts device pointers directly. When |
CUDA / HIP / SYCL specifics#
Flag |
Type |
Purpose |
|---|---|---|
|
list |
Semicolon-separated CUDA target architectures. Accepts |
|
path |
Forces CUDA’s host compiler. Useful when ABI mismatches cause linker errors. |
|
list |
AMDGPU targets passed to the HIP compiler (e.g. |
|
path |
Override individual ROCm component locations when ROCm is not at |
Precision and numerics#
Flag |
Type |
Purpose |
|---|---|---|
|
|
Compile true mixed-precision kernels instead of converting on the fly. Increases library size; faster mixed-precision paths. Defaults to |
|
|
Half-precision ( |
|
|
bfloat16 support. Defaults to |
|
|
All optimisations for the CUDA Jacobi algorithm. Defaults to |
Auxiliary components#
Flag |
Type |
Purpose |
|---|---|---|
|
|
Build the unit-test suite (downloads GoogleTest if not found). Defaults to |
|
|
Reduce input sizes for a few slow tests. Defaults to |
|
|
Build the |
|
|
Build the deal.II interfacing example. Defaults to |
|
|
Build the |
|
|
Generate the Doxygen documentation (requires |
|
|
Build with HWLOC for topology-aware execution. Defaults to |
Development tools#
Flag |
Type |
Purpose |
|---|---|---|
|
|
Install the formatting |
|
|
Run |
|
|
Run |
|
|
Compile-time check that internal Ginkgo libraries don’t depend on each other circularly. For development only. Defaults to |
|
integer |
Library log verbosity. |
Build types and sanitizers#
-DCMAKE_BUILD_TYPE=<type> selects the build configuration. Standard CMake
types (Debug, Release, RelWithDebInfo, MinSizeRel) are supported, plus
the Ginkgo-specific instrumented types:
Type |
What it produces |
|---|---|
|
Coverage instrumentation (gcov / llvm-cov). |
|
AddressSanitizer build. |
|
LeakSanitizer build. |
|
ThreadSanitizer build. |
|
Undefined-behavior sanitizer build. |
Defaults to Release.
Library shape and install layout#
Flag |
Type |
Purpose |
|---|---|---|
|
|
Build shared libraries when |
|
path |
Install root. Defaults to the platform’s standard prefix (typically |
|
|
Set |
|
|
Add |
|
|
Add dependency directories to the install |
|
|
Register the build directory in the user’s CMake package registry so other projects can |
Optional third-party dependencies#
Some features require external packages and are silently disabled when the package is not found:
Component |
Required for |
Discovery |
|---|---|---|
|
|
|
PAPI ≥ 7.1.0 |
|
|
Topology-aware execution (with |
Downloaded by Ginkgo if not found system-wide. |
|
A handful of examples |
Examples needing it are skipped if absent. |
GoogleTest, gflags, nlohmann-json, and hwloc are downloaded
automatically when their hosting flag is on and a system version isn’t
available. To use a custom install of any of these, point CMake at it:
cmake .. -DCMAKE_PREFIX_PATH="/path/to/dep1;/path/to/dep2"
A worked configuration#
Build everything (debug, with all backends and dev tooling) on a GPU-equipped Linux box:
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DGINKGO_DEVEL_TOOLS=ON \
-DGINKGO_BUILD_TESTS=ON \
-DGINKGO_BUILD_REFERENCE=ON \
-DGINKGO_BUILD_OMP=ON \
-DGINKGO_BUILD_CUDA=ON \
-DGINKGO_BUILD_HIP=ON \
-DGINKGO_BUILD_MPI=ON
cmake --build . -j
See also
Install — prerequisites and the standard install path.
Your first solver in 10 minutes — verify the build.
Upstream
INSTALL.md— the canonical, exhaustive build documentation.