Complete the following steps to build AOCL-LibMem for Linux:
Download and install the AOCL master installer (aocl-linux-<compiler>-<version>.tar.gz) from:
Locate the aocl-libmem folder in the root directory.
Configure for one of the following builds as required:
GCC build
Default Option - Compiling for Native CPU
$ cmake -D CMAKE_C_COMPILER=gcc -S <source_dir> -B <build_dir>
Compiling with Dynamic CPU Dispatcher
$ cmake -D CMAKE_C_COMPILER=gcc -D ALMEM_DYN_DISPATCH=Y -S <source_dir> -B <build_dir>
Compiling AVX2 binary
$ cmake -D CMAKE_C_COMPILER=gcc -D ALMEM_ISA=avx2 -S <source_dir> -B <build_dir>
Compiling AVX512 binary
$ cmake -D CMAKE_C_COMPILER=gcc -D ALMEM_ISA=avx512 -S <source_dir> -B <build_dir>
Compiling with Tunable Parameters
$ cmake -D CMAKE_C_COMPILER=gcc -D ALMEM_TUNABLES=Y -S <source_dir> -B <build_dir>
AOCC (Clang) build
Default Option - Compiling for Native CPU
$ cmake -D CMAKE_C_COMPILER=clang -S <source_dir> -B <build_dir>
Compiling with Dynamic CPU Dispatcher
$ cmake -D CMAKE_C_COMPILER=clang -D ALMEM_DYN_DISPATCH=Y -S <source_dir> -B <build_dir>
Compiling AVX2 binary
$ cmake -D CMAKE_C_COMPILER=clang -D ALMEM_ISA=avx2 -S <source_dir> -B <build_dir>
Compiling AVX512 binary
$ cmake -D CMAKE_C_COMPILER=clang -D ALMEM_ISA=avx512 -S <source_dir> -B <build_dir>
Compiling with Tunable Parameters
$ cmake -D CMAKE_C_COMPILER=clang -D ALMEM_TUNABLES=Y -S <source_dir> -B <build_dir>
Note
‘ALMEM_ISA’ has precedence over ‘ALMEM_DYN_DISPATCH’ and ‘ALMEM_TUNABLES’ options.
Build:
$ cmake --build <build_dir>
Install:
$ cmake --install <build_dir> ## For custom install path, run configure with "CMAKE_INSTALL_PREFIX"
Note
Both shared (libaocl-libmem.so) and static (libaocl-libmem.a) library files are installed under <build_dir>/lib/ path.
A Dynamic dispatched binary may not always deliver the best performance of the library on the specified architecture. To achieve optimal performance on the given architecture, it’s advisable to use the default native build option.
The dynamic loading library APIs (dlopen, dlclose, and dlsym) were added to Glibc in version 2.34. To run on environments with Glibc versions below 2.34, you should recompile the library with that specific Glibc version to avoid runtime symbol resolution issues.