12.1.5. Building from Source on Windows 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 install AOCL-LibM:

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

  2. Navigate to the folder:

    $ cd aocl-libm-ose
    
  3. Install virtualenv:

    $ pip install virtualenv
    
  4. Initialize the environment for correct architecture using Visual Studio vcvarsall.bat file using following command:

    $ "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
    
  5. Activate virtual environment and install SCons inside:

    $ virtualenv -p python .venv3
    $ .venv3\Scripts\activate
    $ pip install scons
    
  6. Build the project using the clang compiler:

    Basic build command: scons ALM_CC=<clang-cl executable path> ALM_CXX=<clang-cl executable path> --aocl_utils_install_path="<libaoclutils library path>"
    
    Additional Flags:
    
    Build in parallel: -j<number of parallel builds>
    Verbosity: --verbose=1
    Debug mode build: --debug_mode=libs
    

    For example:

    $ scons -j32 ALM_CC="C:\PROGRA~1\LLVM\bin\clang-cl.exe" ALM_CXX="C:\PROGRA~1\LLVM\bin\clang- cl.exe" --verbose=1
    

By default, the static (libalm-static.lib) and dynamic (libalm.dll and libalm.lib) libraries are compiled and generated in the following location:

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

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

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