Skip to content
Naoki Shibata edited this page Nov 18, 2024 · 9 revisions

CMake options

BUILD_LIBS

Default: ON

With this option, you can specify whether to build the library. If you use TLFloat as a submodule, you can install the library without building it to reduce build time.

BUILD_TESTS

Default: ON

With this option, you can specify whether to build the testers.

BUILD_UTILS

Default: ON

With this option, you can specify whether to build the utilities.

BUILD_BENCH

Default: OFF

With this option, you can specify whether to build the benchmarking tools.

BUILD_INTSQRT

Default: OFF

When this option is turned on, sqrt is computed with integer operations. On most architectures, the default setting is faster. On CPUs without FPUs, integer computation may be faster. It may also be better to turn this option ON if the sqrt function in the standard library is unreliable.

ENABLE_INLINING

Default: OFF

Turning this option ON will cause aggressive inlining when building the library. The library will be more optimized, but it may take longer to build.

ENABLE_LTO

Default:OFF

Turning this option on will build the LTO version of the library.

ENABLE_ASAN

Default: OFF

Enable address sanitizer during tester build.

ENABLE_CUDA_TEST

Default: OFF

Enable building CUDA tester.

INSTALL_CONTINUOUS_TESTERS

Default: OFF

Enable installing continuous testers.

ENABLE_DOXYGEN

Default: OFF

Enable generating documents with Doxygen.

ENABLE_COVERAGE

Default: OFF

Enable generating coverage data.

ENABLE_ARCH_OPTIMIZATION

Default: ON

Enable architecture-specific optimization upon building library.

BUILD_EXHAUSTIVE_TESTING

Default: OFF

SET_COMPILER_SUPPORTS_INT128

Default: auto detect

Set whether the compiler supports __int128 type

SET_COMPILER_SUPPORTS_FLOAT128

Default: auto detect

Set whether the compiler supports __float128 type

SET_LONGDOUBLE_IS_FLOAT128

Default: auto detect

Set whether long double is IEEE binary128

Special build methods

Building with additional compiler options

For example, to build with the "-march=native" option, do the following.

CC=gcc-12 CXX=g++-12 CFLAGS="-march=native" CXXFLAGS="-march=native" cmake ..

Building with clang with LTO enabled

CXX=clang++-19 CC=clang-19 cmake .. -DENABLE_INLINING=True -DENABLE_LTO=True -DCMAKE_CXX_COMPILER_AR=/usr/bin/llvm-ar-19 -DCMAKE_CXX_COMPILER_RANLIB=/usr/bin/llvm-ranlib-19
Clone this wiki locally