Migrating the Library That Uses the C Language
The OpenBlas contains the open source netlib LAPACK. If only some of the BLAS interfaces are used, perform the following steps:
- Identify the source code calling header files that use OpenBLAS and replace the header file #include <cblas.h> with #include <kblas.h>.
- Replace -lopenblas with -lkblas in the compilation options.
- Add environment variables. /PATH_TO_KBLAS is the installation path.
export LD_LIBRARY_PATH=/PATH_TO_KBLAS:$LD_LIBRARY_PATH
If both the BLAS and LAPACK interfaces are used, perform the migration by referring to "Installing the KML_LAPACK" in Kunpeng Math Library Developer Guide.
- In the compilation options, replace -lopenblas with -lkblas -lklapack_full.
- Add environment variables. /PATH_TO_KBLAS_AND_KLAPACK indicates the installation path.
export LD_LIBRARY_PATH=/PATH_TO_KBLAS_AND_KLAPACK:$LD_LIBRARY_PATH
Parent topic: Migrating a Library from OpenBLAS to KML_BLAS