Using Package Config - Using Package Config - 5.3 English - 57404

AOCL User Guide (57404)

Document_ID
57404
Release_Date
2026-05-13
Version
5.3 English

Package config (.pc files) is enabled for AOCL-BLAS, AOCL-LAPACK, AOCL-ScaLAPACK, AOCL-Utils, and other libraries that ship pkg-config metadata under the installed tree.

  1. Set PKG_CONFIG_PATH:

    After installation, .pc files live under <INSTALL_ROOT>/lib/pkgconfig, where that directory is INSTALL_ROOT (it contains lib, include, amd-libs.cfg, and the generated module file). The master installer (install.sh for AOCC or GCC) already extends PKG_CONFIG_PATH in both amd-libs.cfg (export PKG_CONFIG_PATH=...) and the generated Environment Modules file (prepend-path for PKG_CONFIG_PATH pointing at $AOCLhome/lib/pkgconfig). Sourcing amd-libs.cfg or loading that module therefore picks up pkg-config metadata for that INSTALL_ROOT.

    To set PKG_CONFIG_PATH explicitly, use:

    $ export PKG_CONFIG_PATH=<INSTALL_ROOT>/lib/pkgconfig:$PKG_CONFIG_PATH
    

    After PKG_CONFIG_PATH is set, compile using pkg-config. An example for AOCL-Utils:

    $ g++ cpuid_example.cc `pkg-config --cflags --libs aocl-utils`
    

    Note

    Package config is oriented toward shared libraries. For static linking you may need to adjust PKG_CONFIG_PATH or use the static .pc variants where the package provides them.