19.3.1. Introduction - 5.2 English - 57404

AOCL User Guide (57404)

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

The AOCL project provides a set of CMake presets to simplify the configuration and build process for different platforms and compilers. Some of these presets are:

  • aocl-linux-make-lp-ga-gcc-config: Linux with GNU Make and GCC

  • aocl-linux-make-ilp-ga-gcc-config: Linux with GNU Make and GCC (ILP64)

  • aocl-linux-make-lp-ga-aocc-config: Linux with GNU Make and AOCC

  • aocl-linux-make-ilp-ga-aocc-config: Linux with GNU Make and AOCC (ILP64)

  • aocl-win-msvc-lp-ga-config: Windows with Visual Studio and Clang/LLVM

  • aocl-win-msvc-ilp-ga-config: Windows with Visual Studio and Clang/LLVM (ILP64)

  • aocl-win-ninja-lp-ga-config: Windows with Ninja and Clang/LLVM

  • aocl-win-ninja-ilp-ga-config: Windows with Ninja and Clang/LLVM (ILP64)

Details of aocl-linux-make-lp-ga-gcc-config are given here.

The aocl-linux-make-lp-ga-gcc-config preset is a convenient and efficient way to build AOCL on Linux platforms with GCC. It provides a stable, production-ready configuration while allowing flexibility for customization based on specific requirements.

  • How is the Name Derived?

    • aocl: Refers to AMD Optimized Libraries.

    • linux: Indicates that the preset is for Linux platforms.

    • make: Specifies the use of the GNU Make build system.

    • lp: Refers to the LP64 data model, which is the default for most Linux systems.

    • ga: Stands for General Availability Release, indicating that this preset is stable and production-ready.

    • gcc: Specifies the use of the GCC compiler.

  • Default Configuration: By default, this preset builds a shared multithreaded library. It can be customized to build static or single-threaded libraries by modifying the relevant CMake variables.

    • CMAKE_BUILD_TYPE: Release Specifies that the build should be optimized for performance.

    • BUILD_SHARED_LIBS: ON Indicates that shared libraries are built by default.

    • ENABLE_ILP64: OFF Configures the build to use the LP64 data model.

    • ENABLE_MULTITHREADING: ON Enables multithreading support by default.

    • CMAKE_C_COMPILER: gcc Specifies GCC as the C compiler.

    • CMAKE_CXX_COMPILER: g++ Specifies G++ as the C++ compiler.

    • CMAKE_Fortran_COMPILER: gfortran Specifies GFortran as the Fortran compiler.

  • Required Environment Variables: Before running this preset, ensure the following environment variables are set:

    1. OPENSSL_INSTALL_DIR: Points to the directory where OpenSSL is installed. This is required for building the AOCL-Cryptography library. Ensure this directory contains the include folder and either the lib or lib64 folder with libcrypto.so and libssl.so libraries.

    2. ONEAPI_ROOT / oneAPI_ROOT: Specifies the root directory of the Intel oneAPI toolkit. Use ONEAPI_ROOT for Linux and oneAPI_ROOT for Windows. This is mandatory for Windows and optional for Linux. It is required if you want to use the Intel OpenMP runtime library.

      • Linux: The library is typically located at: $env{ONEAPI_ROOT}/compiler/latest/lib/libiomp5.so.

      • Windows: The library is typically located at: $env{oneAPI_ROOT}/compiler/latest/lib/libiomp5md.lib.

      Ensure that the appropriate environment variable (ONEAPI_ROOT or oneAPI_ROOT) is set to the correct path where the oneAPI toolkit is installed.

  • Example Command to Use This Preset: To configure the build using this preset, run the following command:

    $ cmake --preset aocl-linux-make-lp-ga-gcc-config --fresh
    

    This command will set up the build environment with the predefined configuration for this preset.

  • Customization Options: You can customize the build by overriding the default CMake variables. For example:

    • To build a static library, set -DBUILD_SHARED_LIBS=OFF.

    • To disable multithreading, set -DENABLE_MULTITHREADING=OFF.

    For more customization options, refer to the CMake variables Configure the Build Options.