Skip to content

Commit

Permalink
FindSCALAPACK: correct ALIAS of Lapack with MKL
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 26, 2023
1 parent 7119fdc commit 5ce7952
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()

project(MUMPS
LANGUAGES C Fortran
VERSION 5.6.2.1
VERSION 5.6.2.2
DESCRIPTION "Sparse direct parallel solver"
HOMEPAGE_URL "http://mumps-solver.org/"
)
Expand Down Expand Up @@ -48,11 +48,11 @@ find_package(Threads)

if(parallel)
find_package(MPI COMPONENTS C Fortran REQUIRED)
include(cmake/scalapack.cmake)
if(NOT MKL_FOUND)
if(NOT DEFINED ENV{MKLROOT})
# oneMKL MKLConfig.cmake must be invoked only once
include(cmake/lapack.cmake)
endif()
include(cmake/scalapack.cmake)

set(NUMERIC_LIBS SCALAPACK::SCALAPACK LAPACK::LAPACK)

Expand Down
11 changes: 4 additions & 7 deletions cmake/FindSCALAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ if(SCALAPACK_FOUND)
if(BLACS_LIBRARY)
list(APPEND SCALAPACK_LIBRARIES ${BLACS_LIBRARY})
endif()
if(SCALAPACK_MPI_LIB64)
list(APPEND SCALAPACK_LIBRARIES ${SCALAPACK_MPI_LIB64})
endif()

set(SCALAPACK_INCLUDE_DIRS ${SCALAPACK_INCLUDE_DIR})

Expand All @@ -258,11 +255,11 @@ Scalapack include directories: ${SCALAPACK_INCLUDE_DIRS}")
add_library(SCALAPACK::SCALAPACK INTERFACE IMPORTED)
set_property(TARGET SCALAPACK::SCALAPACK PROPERTY INTERFACE_LINK_LIBRARIES "${SCALAPACK_LIBRARIES}")
set_property(TARGET SCALAPACK::SCALAPACK PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SCALAPACK_INCLUDE_DIR}")
endif()

# For MKL, we don't use FindLapack, so define LAPACK::LAPACK as alias
if(MKL_FOUND)
add_library(LAPACK::LAPACK ALIAS SCALAPACK::SCALAPACK)
# For MKL, we don't use FindLapack, so define LAPACK::LAPACK as alias
if(MKL_FOUND AND NOT TARGET LAPACK::LAPACK)
add_library(LAPACK::LAPACK ALIAS SCALAPACK::SCALAPACK)
endif()
endif()
endif()

Expand Down

0 comments on commit 5ce7952

Please sign in to comment.