Install Intel MKL Scalapack library

Intel MKL has Scalapack, which is installed when you select “Cluster Support” for C and/or Fortran from the Intel Compiler/MKL installer. The files installed under $MKLROOT=/opt/intel/mkl are

./include/mkl_scalapack.h
./lib/intel64_lin/libmkl_scalapack_ilp64.a
./lib/intel64_lin/libmkl_scalapack_ilp64.so
./lib/intel64_lin/libmkl_scalapack_lp64.a
./lib/intel64_lin/libmkl_scalapack_lp64.so

Cmake Intel MKL Scalapack

Inside your CMakeLists.txt file, you will need the lines

find_package(MKL)
set(MKLROOT $ENV{MKLROOT})
include_directories(${MKL_INCLUDE_DIRS})   # this will include $MKLROOT/include

list(APPEND FLIBS mkl_scalapack_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core mkl_blacs_openmpi_lp64 iomp5 pthread dl m)

add_executable(myexe myprogram.f90)
target_link_libraries(myexe PRIVATE ${FLIBS})

Leave a Comment