Skip to content
Naoki Shibata edited this page Nov 19, 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 only the include files without building the library 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.

ENABLE_INTSQRT

Default: OFF

If this option is turned on, sqrt will be computed with integer operations. The default configuration is to compute using the standard library sqrt function internally. On many CPUs with built-in FPUs, this is essentially a one-instruction computation, and therefore very fast. On the other hand, if the CPU does not have a built-in FPU, enabling this option may result in faster computation. 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 the library. When this option is on, optimization using architecture-specific intrinsics is enabled.

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