Linking via CMake config (recommended for direct AOCL-FFTZ API use): - Linking via CMake config (recommended for direct AOCL-FFTZ API use): - 5.3 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2026-05-13
Version
5.3 English

AOCL-FFTZ provides CMake package configuration files so that projects using AOCL-FFTZ APIs directly can link with find_package(aocl-fftz). After building and installing AOCL-FFTZ, the config is installed under <install-prefix>/lib/cmake/aocl-fftz/. Set the target application’s CMAKE_PREFIX_PATH to the AOCL-FFTZ install prefix, then use the following in the target application’s CMakeLists.txt:

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

# Find AOCL-FFTZ package
find_package(aocl-fftz REQUIRED)

# Create your application
add_executable(target_app main.c)

# Link with AOCL-FFTZ shared library (recommended for most applications)
target_link_libraries(target_app PRIVATE aocl-fftz::aocl_fftz)

# Or link with static library (when AOCL-FFTZ was built with BUILD_STATIC_LIBS=ON)
# target_link_libraries(target_app PRIVATE aocl-fftz::aocl_fftz_static)

Available Targets

  • aocl-fftz::aocl_fftz: Shared library target (recommended for most applications). Available when AOCL-FFTZ was built with BUILD_STATIC_LIBS=OFF (default).

  • aocl-fftz::aocl_fftz_static: Static library target. Available when AOCL-FFTZ was built with BUILD_STATIC_LIBS=ON. If the library was built with ENABLE_MULTI_THREADING=ON, the config runs find_dependency(OpenMP) so that the consumer links correctly with the OpenMP runtime; ensure your project enables C and CXX when using the static target with multi-threading.

Library and File Naming

  • Linux: The library is always named aocl_fftz. Either the shared (.so) or static (.a) version is provided by the installation depending on whether BUILD_STATIC_LIBS option was enabled or not.

  • Windows: Shared uses aocl_fftz; the static build is named aocl_fftz_static so you can have both in the same install if needed.