Rate This Document
Findability
Accuracy
Completeness
Readability

Migration Procedure

Migrating the Library That Uses the C Language

OpenBLAS contains the open source netlib LAPACK. If only some of the BLAS interfaces are used, perform the following steps:

  1. Identify the source code calling header files that use OpenBLAS and replace the header file #include <cblas.h> with #include <kblas.h>.
  2. Replace -lopenblas with -lkblas in the compilation options.
  3. Add an environment variable. /PATH_TO_KBLAS indicates 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 "Generating a Complete LAPACK Library" in Kunpeng Math Library Developer Guide.

  1. In the compilation options, replace -lopenblas with -lkblas -lklapack_full.
  2. Add an environment variable. /PATH_TO_KBLAS_AND_KLAPACK indicates the installation path.
    export LD_LIBRARY_PATH=/PATH_TO_KBLAS_AND_KLAPACK:$LD_LIBRARY_PATH

Migrating the Library That Uses the Fortran Interface

The procedure of migrating the library that uses the Fortran interface is the same as that in Migrating the Library That Uses the C Language.