Complete the following steps to build AOCL-ScaLAPACK from source:
Clone the GitHub repository (amd/aocl-scalapack.git).
Run CMake configuration command:
Create a new directory. For example, build:
$ cd aocl-scalapack $ mkdir build $ cd build
Export
PATHandLD_LIBRARY_PATHto the lib and bin folders of the MPI installation respectively:$ export PATH=<MPI installation folder>/bin:$PATH $ export LD_LIBRARY_PATH=<MPI installation folder>/lib:$LD_LIBRARY_PATH
Run cmake command based on the compiler and the type of library generation required.
Note
AOCL-LAPACK is dependent on the AOCL-Utils library, which in turn depends on libstdc++. Hence, you must link with AOCL-Utils and libstdc++(-lstdc++) along with the AOCL-LAPACK library while specifying the path for LAPACK_LIBRARIES in the CMake flags.
Table 15.2 GCC Compiler and Type of Library# Library Type
Threading
Command
Static
Single-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=OFF -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis.a" -DLAPACK_LIBRARIES="<path to AOCL-LAPACK library>/libflame.a;<path to AOCL-Utils library>/libaoclutils.a;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]Multi-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=OFF -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis-mt.a" -DLAPACK_LIBRARIES="-lstdc++ <path to AOCL-LAPACK library>/libflame.a;<path to AOCL-Utils library>/libaoclutils.a;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]Shared
Single-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=ON -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis.so" -DLAPACK_LIBRARIES="<path to AOCL-LAPACK library>/libflame.so;<path to AOCL-Utils library>/libaoclutils.so;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]Multi-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=ON -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis-mt.so" -DLAPACK_LIBRARIES="-lstdc++ <path to AOCL-LAPACK library>/libflame.so;<path to AOCL-Utils library>/libaoclutils.so;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]Table 15.3 AOCC Compiler and Type of Library# Library Type
Threading
Command
Static
Single-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=OFF -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis.a" -DLAPACK_LIBRARIES="<path to AOCL-LAPACK library>/libflame.a;<path to AOCL-Utils library>/libaoclutils.a;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]Multi-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=OFF -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis-mt.a" -DLAPACK_LIBRARIES="-lstdc++ <path to AOCL-LAPACK library>/libflame.a;<path to AOCL-Utils library>/libaoclutils.a;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]Shared
Single-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=ON -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis.so" -DLAPACK_LIBRARIES="<path to AOCL-LAPACK library>/libflame.so;<path to AOCL-Utils library>/libaoclutils.so;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]Multi-thread AOCL-BLAS
$ cmake .. -DBUILD_SHARED_LIBS=ON -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis-mt.so" -DLAPACK_LIBRARIES="-lstdc++ <path to AOCL-LAPACK library>/libflame.so;<path to AOCL-Utils library>/libaoclutils.so;-lstdc++" -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF [-DENABLE_ILP64=ON]On Linux, the inbuilt communications sub-module of AOCL-ScaLAPACK, called Basic Linear Algebra Communication Subprograms (BLACS), exposes the API symbols in lower case with underscore format.
You can build AOCL-ScaLAPACK with an external BLACS library on Linux using the configure option
BLACS_LIBRARIES.Example: To build static library with external BLACS library:
$ cmake .. -DBUILD_SHARED_LIBS=OFF -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis-mt.a" -DLAPACK_LIBRARIES="<path to AOCL-LAPACK library>/libflame.a;<path to AOCL-Utils library>/libaoclutils.a;-lstdc++" -DBLACS_LIBRARIES=<path to BLACS library>/libBLACS.a -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DUSE_OPTIMIZED_LAPACK_BLAS=OFF
You can build AOCL-ScaLAPACK with Intel MPI and ICC compiler tool chain using the following method.
Example: To build a static library with Intel MPI and ICC compiler:
$ cmake .. -DBUILD_SHARED_LIBS=OFF -DBLAS_LIBRARIES="-fopenmp <path to AOCL-BLAS library>/libblis-mt.a" -DLAPACK_LIBRARIES="<path to AOCL-LAPACK library>/libflame.a;<path to AOCL-Utils library>/libaoclutils.a;-lstdc++" -DCMAKE_C_COMPILER=mpiicc -DCMAKE_Fortran_COMPILER=mpiifort -DUSE_OPTIMIZED_LAPACK_BLAS=OFF
Ensure correct paths are provided for AOCL-LAPACK and AOCL-BLAS libraries. On completion, a message, βLAPACK routine dgesv is found: 1β similar to the following in CMake output is displayed:
... -- CHECKING BLAS AND LAPACK LIBRARIES -- --> LAPACK supplied by user is <path>/libflame.a. -- --> LAPACK routine dgesv is found: 1. -- --> LAPACK supplied by user is WORKING, will use <path>/libflame.a. -- BLAS library: <path>/libblis.a -- LAPACK library: <path>/libflame.a ...
Compile the code:
$ make -j
When the building process is complete, the AOCL-ScaLAPACK library is created in the lib directory. The test application binaries are generated in the <aocl-scalapack>/build/TESTING folder.