Skip to content

Commit

Permalink
minor fix for cmake vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-Solovev committed Nov 13, 2024
1 parent c883a56 commit 7d6ac40
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions cmake/templates/oneDALConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ if(NOT DEFINED ONEDAL_SET_TBB_MANUALLY AND DEFINED SET_TBB_MANUALLY)
endif()

if ("${REF_BACKEND}" STREQUAL "" OR "${REF_BACKEND}" STREQUAL "OFF")
set(MATH_BACKEND "mkl" CACHE STRING "Backend math library" FORCE)
set(MATH_BACKEND "mkl")
elseif ("${REF_BACKEND}" STREQUAL "ON")
set(MATH_BACKEND "ref" CACHE STRING "Backend math library" FORCE)
set(MATH_BACKEND "ref")
elseif (NOT "${REF_BACKEND}" STREQUAL "OFF" AND NOT "${REF_BACKEND}" STREQUAL "ON")
message(FATAL_ERROR "REF_BACKEND must be 'ON' or 'OFF'")
endif()

if ("${ONEDAL_LINK}" STREQUAL "" OR "${ONEDAL_LINK}" STREQUAL "dynamic")
set(ONEDAL_LINK "dynamic")
set(MKL_DEPENDENCY "no" CACHE STRING "MKL_DEPENDENCY math library" FORCE)
set(MKL_DEPENDENCY "no")
elseif ("${ONEDAL_LINK}" STREQUAL "static")
set(ONEDAL_LINK "static")
if("${MATH_BACKEND}" STREQUAL "mkl")
set(MKL_DEPENDENCY "yes" CACHE STRING "MKL_DEPENDENCY math library" FORCE)
set(MKL_DEPENDENCY "yes")
elseif("${MATH_BACKEND}" STREQUAL "ref")
set(MKL_DEPENDENCY "no" CACHE STRING "MKL_DEPENDENCY math library" FORCE)
set(MKL_DEPENDENCY "no")
endif()
elseif (NOT "${ONEDAL_LINK}" STREQUAL "static" AND NOT "${ONEDAL_LINK}" STREQUAL "dynamic")
message(FATAL_ERROR "ONEDAL_LINK must be 'static' or 'dynamic'")
Expand Down Expand Up @@ -138,16 +138,12 @@ elseif (@VERSIONS_SET@ STREQUAL "FALSE")
endif()

if(MKL_DEPENDENCY STREQUAL "yes")
set(MKL_THREADING "tbb_thread" CACHE STRING "Threading type for MKL" FORCE)
set(MKL_SYCL_LINK "static" CACHE STRING "SYCL Link type for MKL" FORCE)
set(MKL_LINK "static" CACHE STRING "Link type for MKL" FORCE)
set(MKL_SYCL_INTERFACE_FULL "intel_ilp64" CACHE STRING "Link type for MKL" FORCE)
set(MKL_INTERFACE_FULL "intel_ilp64" CACHE STRING "Link type for MKL" FORCE)
set(MKL_THREADING "tbb_thread")
set(MKL_SYCL_LINK "static")
set(MKL_LINK "static")
set(MKL_SYCL_INTERFACE_FULL "intel_ilp64")
set(MKL_INTERFACE_FULL "intel_ilp64")
find_package(MKL REQUIRED MKL::MKL_SYCL)
message(STATUS "MKL dependencies are enabled")
message(STATUS "MKL_THREADING: ${MKL_THREADING}")
message(STATUS "MKL_SYCL_LINK: ${MKL_SYCL_LINK}")
message(STATUS "MKL_LINK: ${MKL_LINK}")
endif()

if (ONEDAL_USE_DPCPP STREQUAL "yes" AND ONEDAL_INTERFACE STREQUAL "no")
Expand Down

0 comments on commit 7d6ac40

Please sign in to comment.