12.1.3. Building AOCL-LIBM on Linux and Windows using CMake - 5.2 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2025-12-29
Version
5.2 English

On Windows, configure Ninja (installed with MSVC) before performing the build.

  • Open the command prompt and navigate to the aocl-libm directory.

  • Run the following command, replacing “Path_To_VisualStudio” with the actual path where Visual Studio is installed:

    “Path_To_VisualStudio\VCAuxiliary\Build\vcvarsall.bat” x64

To list CMake configuration preset names:

$ cmake --list-presets

To configure CMake, select any preset name from --list-presets:

$ cmake --preset dev-release-gcc --fresh

To build, select the corresponding config preset name from --build --list-presets:

$ cmake --build --preset dev-release-gcc

To build library in parallel:

$ cmake --build --preset dev-release-gcc -j

To build the library in verbose mode:

$ cmake --build --preset dev-release-gcc -v

To configure CMake for STATIC_DISPATCH:

Available options for ALM_STATIC_DISPATCH
"AVX2"   or "ZEN3" - ZEN3 Code path in aocl-libm library.
"AVX512" or "ZEN5" - ZEN5 Code path in aocl-libm library.

$ cmake --preset dev-release-gcc -DALM_STATIC_DISPATCH=ZEN3 --fresh

Note

The compiled library should only be executed on machines that match the target architecture specified during compilation (e.g., ZEN3 binaries should run on ZEN3-compatible processors).

CMake-built aocl-libm library is installed only in release mode and the aocl-libm library is installed in build/{presetName}.