12.1.4. Building from Source on Linux using scons - 5.2 English - 57404

AOCL User Guide (57404)

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

Refer to Installing AOCL to install the AOCL-Utils library. Then, complete the following steps to compile AOCL-LibM:

  1. Download source from GitHub (amd/aocl-libm-ose).

  2. Navigate to the LibM folder and checkout the branch aocl-5.2:

    $ cd aocl-libm-ose
    $ git checkout aocl-5.2
    
  3. Create a virtual environment:

    $ virtualenv -p python3 .venv3
    
  4. Activate the virtual environment:

    $ source .venv3/bin/activate
    
  5. Install SCons:

    $ pip install scons
    
  6. Compile AOCL-LibM:

    Basic build command: scons --aocl_utils_install_path=<libaoclutils library path>
    
    Additional Flags
    
    Build in parallel: -j<number of parallel builds>
    Installation: install --prefix=<path to install>
    Compiler selection: ALM_CC=<gcc/clang executable path>
    ALM_CXX=<g++/clang++ executable path>
    Verbosity: --verbose=1
    Debug mode build: --debug_mode=libs
    
  7. By default, the libraries (static and dynamic) will be compiled and generated in the following location:

    aocl-libm-ose/build/aocl-release/src/

    If a debug mode build has been selected, the libraries (static and dynamic) will instead be compiled and generated in the following location:

    aocl-libm-ose/build/aocl-debug/src

    If the installation option is used, the libraries will also be copied to the directory <path to install>/lib.