Skip to content

Commit e087e7f

Browse files
committed
Test: Fix FindMKL.cmake, which causes *** No rule to make target 'mkl_scalapack_lp64', needed by 'abacus'. when compiling with intel.
1 parent 6bcc26c commit e087e7f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmake/FindMKL.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,12 @@ endif()
9191
if(NOT TARGET MKL::MKL_SCALAPACK)
9292
find_library(MKL_SCALAPACK NAMES mkl_scalapack_lp64 HINTS ${MKLROOT}/lib ${MKLROOT}/lib/intel64)
9393
message(STATUS "Found MKL_SCALAPACK: ${MKL_SCALAPACK}")
94-
add_library(MKL::MKL_SCALAPACK OBJECT IMPORTED MKL_SCALAPACK)
94+
if(MKL_SCALAPACK)
95+
# create an IMPORTED target that points to the discovered library file
96+
add_library(MKL::MKL_SCALAPACK UNKNOWN IMPORTED)
97+
set_target_properties(MKL::MKL_SCALAPACK PROPERTIES
98+
IMPORTED_LOCATION "${MKL_SCALAPACK}"
99+
INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE}"
100+
)
101+
endif()
95102
endif()

0 commit comments

Comments
 (0)