Linking via pkg-config (.pc files) - Linking via pkg-config (.pc files) - 5.3 English - 57404

AOCL User Guide (57404)

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

pkg-config lets build systems (Make, Autotools, Meson, etc.) discover the include path and link flags for a library. AOCL-FFTZ installs .pc files so you can link without hard-coding paths.

Usage

  1. Set PKG_CONFIG_PATH to <install-prefix>/lib/pkgconfig (or append that path to PKG_CONFIG_PATH).

  2. Run pkg-config --cflags --libs <package> with one of the package names below. Many build systems do this automatically when you tell them to use a package.

Selecting Package

Direct AOCL-FFTZ — Your code calls AOCL-FFTZ APIs; you only need libaocl_fftz:

  • fftz.pcpkg-config --cflags --libs fftz. Always installed.

FFTW API — Your code calls FFTW APIs; requires AOCL-FFTZ built with BUILD_THIRD_PARTY_WRAPPERS=ON:

  • fftw3.pc — double precision: pkg-config --cflags --libs fftw3

  • fftw3f.pc — single precision: pkg-config --cflags --libs fftw3f

  • fftw3_omp.pc — double precision, OpenMP link name: pkg-config --cflags --libs fftw3_omp

  • fftw3f_omp.pc — single precision, OpenMP link name: pkg-config --cflags --libs fftw3f_omp

Note

Use the .pc that matches your link flag (e.g. if you link with -lfftw3, use fftw3). FFTW .pc files list libaocl_fftz in Libs.private. When linking statically (e.g. pkg-config --static or when your build system requests static/private libs), use the private libs so libaocl_fftz is on the link line. When linking shared, pkg-config --cflags --libs <package> is enough—the wrapper library brings in libaocl_fftz at runtime.

Location of CMake Config Files

If you use CMake and find_package(), the configs are installed here:

  • aocl-fftz: <install-prefix>/lib/cmake/aocl-fftz/

  • FFTW3 (when wrappers are built): <install-prefix>/lib/cmake/FFTW3/

Set CMAKE_PREFIX_PATH to the install prefix when configuring your project so find_package(aocl-fftz) and find_package(FFTW3) can find them.