Using CMake and Visual Studio GUI - 5.2 English - 57404

AOCL User Guide (57404)

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

Complete the following steps to prepare the project with CMake GUI:

  1. Install AOCL-BLAS, AOCL-LAPACK, and AOCL-Utils.

  2. Define the environment variable AOCL_ROOT to point to the AOCL Libs installation:

    $ set AOCL_ROOT="C:\Program Files\AMD\AOCL-Windows"
    

    For the cases where AOCL_ROOT cannot be exported by placing AOCL-BLAS, AOCL-LAPACK, and AOCL-Utils libraries in the same path, define the following variables during CMake configuration in cmake-gui to point to the corresponding libraries and headers:

    • AOCL_BLIS_LIB

    • AOCL_LIBFLAME

    • AOCL_UTILS_LIB

    • AOCL_BLIS_INCLUDE_DIR

    • AOCL_LIBFLAME_INCLUDE_DIR

    • AOCL_UTILS_INCLUDE_DIR

    Launch CMake GUI using the Windows command line:

    $ cmake-gui
    
  3. Set the source (folder containing the AOCL-Sparse source code) and build (folder in which the project files will be generated) folder paths. It is not recommended to use the folder named build as it is already used for Linux build system.

  4. Click on the Configure button to prepare the project options.

  5. Set the generator to Visual Studio 17 2022 and the platform toolset to clangCl:

    _images/image16.png

    Figure 17.1 Specify Generator#

  6. Update the options based on the project requirements. All the available options are listed in AOCL-Sparse - CMake Build Options. Select the available and recommended options as follows:

    _images/image17.png

    Figure 17.2 AOCL-Sparse CMake Config Options#

  7. Click the Generate button and then Open Project.

  8. Complete the following steps in Microsoft Visual Studio GUI:

    1. Open the AOCL-Sparse Visual Studio project from the build folder using the aoclsparse.sln file or the Open Project button in CMake GUI.

    2. To generate the AOCL-Sparse binaries, choose the appropriate build configuration Debug or Release and then build the AOCL-Sparse project. The library files would be generated at <build_dir>\library\Release.