8.6.1. Integration Methods - 5.2 English - 57404

AOCL User Guide (57404)

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

AOCL-DLP provides multiple methods for integration depending on your build system and requirements.

CMake Package Integration (Recommended):

AOCL-DLP provides CMake package configuration files for seamless integration.

cmake_minimum_required(VERSION 3.26)
project(MyApp VERSION 1.0.0 LANGUAGES C CXX)

# Find AOCL-DLP package
find_package(AoclDlp REQUIRED)

# Create your application
add_executable(my_app main.c)

# Link with AOCL-DLP shared library
target_link_libraries(my_app PRIVATE AoclDlp::aocl-dlp)

Available Targets:

  • AoclDlp::aocl-dlp: Shared library (recommended for most applications)

  • AoclDlp::aocl-dlp_static: Static library (requires special linking flags)

Custom Installation Prefix:

If AOCL-DLP is installed in a non-standard location:

cmake -DCMAKE_PREFIX_PATH=/path/to/aocl-dlp/install ..
# or
cmake -DAoclDlp_DIR=/path/to/aocl-dlp/install/lib/cmake/AoclDlp ..

Manual Linking:

If you’re not using CMake or prefer manual control:

# Shared library linking
gcc -o my_app main.c \
    -I/usr/local/include \
    -L/usr/local/lib \
    -laocl-dlp \
    -lpthread -lm -fopenmp

# Static library linking (requires whole-archive - see below)
gcc -o my_app main.c \
    -I/usr/local/include \
    -L/usr/local/lib \
    -Wl,--whole-archive -laocl-dlp_static -Wl,--no-whole-archive \
    -lpthread -lm -fopenmp -lstdc++