2022-03-22 07:04:25 +00:00
|
|
|
set(EIGEN_LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/eigen")
|
|
|
|
|
|
|
|
add_library (_eigen INTERFACE)
|
2022-03-23 10:17:55 +00:00
|
|
|
|
|
|
|
option (ENABLE_MKL "Build Eigen with Intel MKL" OFF)
|
|
|
|
if (ENABLE_MKL)
|
|
|
|
set(MKL_THREADING sequential)
|
|
|
|
set(MKL_INTERFACE lp64)
|
|
|
|
find_package(MKL REQUIRED)
|
|
|
|
if (MKL_FOUND)
|
|
|
|
message("MKL INCLUDE: ${MKL_INCLUDE}")
|
|
|
|
message("MKL LIBRARIES: ${MKL_LIBRARIES}")
|
|
|
|
target_compile_definitions(_eigen INTERFACE EIGEN_USE_MKL_ALL)
|
2022-05-09 07:26:46 +00:00
|
|
|
target_include_directories(_eigen INTERFACE ${MKL_INCLUDE})
|
2022-03-23 10:17:55 +00:00
|
|
|
target_link_libraries(_eigen INTERFACE ${MKL_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-05-11 12:45:10 +00:00
|
|
|
# Only include MPL2 code from Eigen library
|
|
|
|
target_compile_definitions(_eigen INTERFACE EIGEN_MPL2_ONLY)
|
|
|
|
|
2022-03-22 07:04:25 +00:00
|
|
|
target_include_directories (_eigen SYSTEM INTERFACE ${EIGEN_LIBRARY_DIR})
|
|
|
|
add_library(ch_contrib::eigen ALIAS _eigen)
|