Calling the Library on Linux - 5.2 English - 57404

AOCL User Guide (57404)

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

To compile and link to static AOCL libraries using g++, the following command can be used.

g++ <your_source_code>.cpp -I /<path to aocl-da
headers>/include_<INT_LIB>
/<path to aocl-da>/lib_<INT_LIB>/libaocl-da.a
/<path to amd-sparse>/lib_<INT_LIB>/libaoclsparse.a
/<path to amd-libflame>/lib_<INT_LIB>/libflame.a
/<path to amd-blis>/lib_<INT_LIB>/libblis-mt.a
/<path to libaoclutils>/lib_<INT_LIB>/libaoclutils.a -lgfortran
-lgomp

To compile and link to static AOCL libraries using clang++, the following command can be used.

clang++ <your_source_code>.cpp -I /<path to aocl-da
headers>/include_<INT_LIB>
/<path to aocl-da>/lib_<INT_LIB>/libaocl-da.a
/<path to amd-sparse>/lib_<INT_LIB>/libaoclsparse.a
/<path to amd-libflame>/lib_<INT_LIB>/libflame.a
/<path to amd-blis>/lib_<INT_LIB>/libblis-mt.a
/<path to libaoclutils>/lib_<INT_LIB>/libaoclutils.a -lflang -lomp
-lpgmath

To compile and link to dynamic AOCL libraries using g++, the following command can be used.

g++ <your_source_code>.cpp -I /<path to aocl-da
headers>/include_<INT_LIB>
-L /<path to aocl-da>/lib_<INT_LIB> -L /<path to
amd-sparse>/lib_<INT_LIB>
-L /<path to amd-libflame>/lib_<INT_LIB> -L /<path to
amd-blis>/lib_<INT_LIB>
-L /<path to amd-utils>/lib -laocl-da -laoclsparse -lflame -lblis-mt
-laoclutils -lgfortran -lgomp

To compile and link to dynamic AOCL libraries using clang++, the following command can be used.

clang++ <your_source_code>.cpp -I /<path to aocl-da
headers>/include_<INT_LIB>
-L /<path to aocl-da>/lib_<INT_LIB> -L /<path to
amd-sparse>/lib_<INT_LIB>
-L /<path to amd-libflame>/lib_<INT_LIB> -L /<path to
amd-blis>/lib_<INT_LIB>
-L /<path to amd-utils>/lib -laocl-da -laoclsparse -lflame -lblis-mt
-laoclutils -lflang -lomp -lpgmath

Note that for dynamic linking you will need to update your LD_LIBRARY_PATH environment variable.

If you wish to call AOCL-DA from a C code, then you should compile using your C compiler (e.g. gcc), but link separately, using a C++ linker (e.g. g++).