CMake Option List¶
The following discusses CMake options that are relevant to building Ginkgo. They are used by passing them to the configuration step by:
cmake -S <...> -B <...> -DOPTION1=VAL1 -DOPTION2=VAL2 ...
Ginkgo-Specific Options¶
All Ginkgo specific options are prefixed with GINKGO_.
-DGINKGO_DEVEL_TOOLS={ON, OFF}sets up the build system for development (requires pre-commit, will also download the clang-format pre-commit hook), default isOFF. The default behavior installs a pre-commit hook, which disables git commits. If it is set toON, a new pre-commit hook for formatting will be installed (enabling commits again). In both cases the hook may overwrite a user defined pre-commit hook when Ginkgo is used as a submodule.-DGINKGO_MIXED_PRECISION={ON, OFF}compiles true mixed-precision kernels instead of converting data on the fly, default isOFF. Enabling this flag increases the library size, but improves performance of mixed-precision kernels.-DGINKGO_BUILD_TESTS={ON, OFF}builds Ginkgo’s tests (will download googletest), default isON.-DGINKGO_FAST_TESTS={ON, OFF}reduces the input sizes for a few slow tests to speed them up, default isOFF.-DGINKGO_BUILD_BENCHMARKS={ON, OFF}builds Ginkgo’s benchmarks (will download gflags and nlohmann-json), default isON.-DGINKGO_BUILD_EXAMPLES={ON, OFF}builds Ginkgo’s examples, default isON-DGINKGO_BUILD_EXTLIB_EXAMPLE={ON, OFF}builds the interfacing example with deal.II, default isOFF.-DGINKGO_BUILD_REFERENCE={ON, OFF}build reference implementations of the kernels, useful for testing, default isON-DGINKGO_BUILD_OMP={ON, OFF}builds optimized OpenMP versions of the kernels, default isONif the selected C++ compiler supports OpenMP,OFFotherwise.-DGINKGO_BUILD_CUDA={ON, OFF}builds optimized cuda versions of the kernels (requires CUDA), default isONif a CUDA compiler could be detected,OFFotherwise.-DGINKGO_BUILD_DPCPP={ON, OFF}is deprecated. Please useGINKGO_BUILD_SYCLinstead.-DGINKGO_BUILD_SYCL={ON, OFF}builds optimized SYCL versions of the kernels (requiresCMAKE_CXX_COMPILERto be set to thedpcpporicpxcompiler). The default isONifCMAKE_CXX_COMPILERis a SYCL compiler,OFFotherwise. Due to some differences in IEEE 754 floating point numberhandling in the Intel SYCL compilers, Ginkgo tests may fail unless compiled with-DCMAKE_CXX_FLAGS=-ffp-model=precise-DGINKGO_BUILD_HIP={ON, OFF}builds optimized HIP versions of the kernels (requires HIP), default isONif an installation of HIP could be detected,OFFotherwise.-DGINKGO_BUILD_HWLOC={ON, OFF}builds Ginkgo with HWLOC. Default isOFF.-DGINKGO_BUILD_DOC={ON, OFF}creates an HTML version of Ginkgo’s documentation from inline comments in the code. The default isOFF.-DGINKGO_DOC_GENERATE_EXAMPLES={ON, OFF}generates the documentation of examples in Ginkgo. The default isON.-DGINKGO_DOC_GENERATE_PDF={ON, OFF}generates a PDF version of Ginkgo’s documentation from inline comments in the code. The default isOFF.-DGINKGO_DOC_GENERATE_DEV={ON, OFF}generates the developer version of Ginkgo’s documentation. The default isOFF.-DGINKGO_WITH_CLANG_TIDY={ON, OFF}makes Ginkgo callclang-tidyto find programming issues. The path can be manually controlled with the CMake variable-DGINKGO_CLANG_TIDY_PATH=<path>. The default isOFF.-DGINKGO_WITH_IWYU={ON, OFF}makes Ginkgo calliwyuto find include issues. The path can be manually controlled with the CMake variable-DGINKGO_IWYU_PATH=<path>. The default isOFF.-DGINKGO_CHECK_CIRCULAR_DEPS={ON, OFF}enables compile-time checks for circular dependencies between different Ginkgo libraries and self-sufficient headers. Should only be used for development purposes. The default isOFF.-DGINKGO_VERBOSE_LEVEL={0, 1}sets the verbosity of Ginkgo.0disables all output in the main libraries,1enables a few important messages related to unexpected behavior (default).
GINKGO_INSTALL_RPATHallows setting any RPATH information when installing the Ginkgo libraries. If this isOFF, the behavior is the same as if all other RPATH flags are set toOFFas well. The default isON.GINKGO_INSTALL_RPATH_ORIGINadds $ORIGIN (Linux) or @loader_path (MacOS) to the installation RPATH. The default isON.GINKGO_INSTALL_RPATH_DEPENDENCIESadds the dependencies to the installation RPATH. The default isOFF.-DGINKGO_JACOBI_FULL_OPTIMIZATIONS={ON, OFF}use all the optimizations for the CUDA Jacobi algorithm.OFFby default. Setting this option toONmay lead to very slow compile time (>20 minutes) for thejacobi_generate_kernels.cufile and high memory usage.-DGINKGO_CUDA_ARCHITECTURES=<list>where<list>is a semicolon (;) separated list of architectures. Supported values are:AutoKepler,Maxwell,Pascal,Volta,Turing,Ampere
Autowill automatically detect the present CUDA-enabled GPU architectures in the system.Kepler,Maxwell,Pascal,VoltaandAmperewill add flags for all architectures of that particular NVIDIA GPU generation. It is advised to use the non-Ginkgo optionCMAKE_CUDA_ARCHITECTURESas described below instead.
Important Non-Ginkgo-Specific Options¶
These are options that as defined by CMake. Only a selection of the most relevant options is given here, the full list is available here.
-DCMAKE_BUILD_TYPE=typespecifies which configuration will be used for this build of Ginkgo. The default isRELEASE. Supported values are CMake’s standard build types such asDEBUGandRELEASEand the Ginkgo specificCOVERAGE,ASAN(AddressSanitizer),LSAN(LeakSanitizer),TSAN(ThreadSanitizer) andUBSAN(undefined behavior sanitizer) types. link-DCMAKE_CXX_COMPILER=path,-DCMAKE_CUDA_COMPILER=path,-DCMAKE_HIP_COMPILER=pathset the compiler for the respective language. link-DCMAKE_<LANG>_HOST_COMPILER=pathinstructs the build system to explicitly set’s (either CUDA or HIP) host compiler to the path given as argument. By default, uses its toolchain’s host compiler. Setting this option may help if you’re experiencing linking errors due to ABI incompatibilities. link -DCMAKE_CUDA_ARCHITECTURES="gpuarch1;gpuarch2"the NVIDIA targets to be passed to the compiler. If empty, compiler chooses based on the available GPUs. link-DCMAKE_HIP_ARCHITECTURES="gpuarch1;gpuarch2"the AMDGPU targets to be passed to the compiler. If empty, compiler chooses based on the available GPUs. link-DCMAKE_INSTALL_PREFIX=pathsets the installation path formake install. The default value is usually something like/usr/local. link-DBUILD_SHARED_LIBS={ON, OFF}builds ginkgo as shared libraries (OFF) or as dynamic libraries (ON), default isON. link-DCMAKE_EXPORT_PACKAGE_REGISTRY={ON,OFF}if set toONthe build directory will be stored in the current user’s CMake package registry. link