Complete the following steps to build different packages of the library, including dependencies and test application:
Install AOCL-BLAS, AOCL-LAPACK, and AOCL-Utils.
Define the environment variable
AOCL_ROOTto point to AOCL Libs installation:$ export AOCL_ROOT=/opt/aocl
For the case where
AOCL_ROOTcannot be exported by placing AOCL-BLAS, AOCL-LAPACK, and AOCL-Utils libraries in the same path, you can use the following variables during the CMake configuration to point to the location of the dependent libraries and headers:AOCL_BLIS_LIBAOCL_LIBFLAMEAOCL_UTILS_LIBAOCL_BLIS_INCLUDE_DIRAOCL_LIBFLAME_INCLUDE_DIRAOCL_UTILS_INCLUDE_DIR
Download the latest release of AOCL-Sparse (amd/aocl-sparse),
or
Clone the Git repository (amd/aocl-sparse.git).
Configure the project using the following tables:
Table 17.1 Compiler and Library Type# Compiler
Library Type
ILP 64 Support
Command
G++ (Default)
Static
OFF (Default)
cmake -S . -B out_sparse -DBUILD_SHARED_LIBS=OFFON
cmake -S . -B out_sparse -DBUILD_SHARED_LIBS=OFF -DBUILD_ILP64=ONShared (Default)
OFF (Default)
cmake -S . -B out_sparseON
cmake -S . -B out_sparse -DBUILD_ILP64=ONAOCC
Static
OFF (Default)
cmake -S . -B out_sparse -DCMAKE_CXX_COMPILER=clang++ -DBUILD_SHARED_LIBS=OFFON
cmake -S . -B out_sparse -DCMAKE_CXX_COMPILER=clang++ - DBUILD_SHARED_LIBS=OFF -DBUILD_ILP64=ONShared (Default)
OFF (Default)
cmake -S . -B out_sparse -DCMAKE_CXX_COMPILER=clang++ON
cmake -S . -B out_sparse -DCMAKE_CXX_COMPILER=clang++ -DBUILD_ILP64=ONTable 17.2 AOCL-Sparse - CMake Build Options# Build Option
Feature
CMAKE_INSTALL_PREFIXUse
-DCMAKE_INSTALL_PREFIX=<path>to choose the custom path. The default install path is/opt/aoclsparse/CMAKE_BUILD_TYPERelease => Release Library (Default)
Debug => Debug Library
CMAKE_CXX_COMPILERUse
-DCMAKE_CXX_COMPILER=clang++for AOCC buildsBUILD_SHARED_LIBSOFF => Build Static Library
ON => Build Dynamic/Shared library (Default)
BUILD_ILP64Integer length:
OFF => 32-bit integer length (Default)
ON => 64-bit integer length
SUPPORT_OMPMulti-threading using OpenMP:
OFF => Disable OpenMP
ON => Enable OpenMP (Default)
USE_AVX512OFF => Disables AVX512 kernel support
ON => Enables AVX512 kernel support (Default)
BUILD_CLIENTS_BENCHMARKSOFF => Disable building benchmarks (Default)
ON => Build benchmark framework (requires Boost library)
BUILD_CLIENTS_SAMPLESOFF => Disable building sparse API examples
ON => Enable building sparse API examples (Default)
BUILD_UNIT_TESTSOFF => Unit tests are not built
ON => Unit tests are built and target
testis activated. This target should be used to test the correctness of the compiled library (requires GTest)
BUILD_DOCSOFF => No documentation target is activated. (Default)
ON => Build PDF and HTML API documentation, this adds targets
docs,doc_htmlanddoc_pdf(requires Linux and modern LaTeX distribution). Uses latestrocm-docs-corepython package (python3 -m pip install --upgrade rocm-docs-core==<version-number>)
Build the AOCL-Sparse library:
$ cmake --build out_sparse --config <build_type> --parallel <nproc>
where,
build_typecan be Release/Debug as configured during configuration.nprocis the number of cores for the build to run in parallel.
Install AOCL-Sparse to the directory
/opt/aoclsparseor a custom path given byCMAKE_INSTALL_PREFIX:cmake --build out_sparse --target install
Note
If AOCL_ROOT contains the shared and static libraries in the same directory for any dependent library, Sparse will link to the library according to BUILD_SHARED_LIBS preference with fallback option to the appropriate library avaiable (static or shared).