FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix oneAPI find_package command to look at the MKLROOT env var · arrayfire/arrayfire@6418b24 · GitHub

Repository navigation

Commit 6418b24

Browse files
committed
Fix oneAPI find_package command to look at the MKLROOT env var
1 parent 6cb7924 commit 6418b24

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ if(AF_WITH_EXTERNAL_PACKAGES_ONLY)
4545
set(AF_REQUIRED REQUIRED)
4646
endif()
4747

48-
#Set Intel OpenMP as default MKL thread layer
49-
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
48+
if(CXX_COMPILER_NAME STREQUAL "dpcpp" OR CXX_COMPILER_NAME STREQUAL "dpcpp.exe"
49+
OR CXX_COMPILER_NAME STREQUAL "icpx" OR CXX_COMPILER_NAME STREQUAL "icx.exe")
5050
set(MKL_THREAD_LAYER "TBB" CACHE STRING "The thread layer to choose for MKL")
5151
set(MKL_INTERFACE "ilp64")
5252
set(MKL_INTERFACE_INTEGER_SIZE 8)
@@ -125,7 +125,14 @@ elseif(MKL_THREAD_LAYER STREQUAL "TBB")
125125
set(MKL_THREADING "tbb_thread")
126126
else()
127127
endif()
128-
find_package(MKL)
128+
129+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
130+
# VCPKG overrides the find_package command and the PATH parameter is currently
131+
# broken with the current version of VCPKG so we are setting the MKL_ROOT
132+
# directory to the MKLROOT environment variable.
133+
set(MKL_ROOT "$ENV{MKLROOT}")
134+
find_package(MKL)
135+
endif()
129136

130137
af_multiple_option(NAME AF_COMPUTE_LIBRARY
131138
DEFAULT ${default_compute_library}
@@ -218,7 +225,7 @@ if(${AF_BUILD_CPU} OR ${AF_BUILD_OPENCL})
218225
if("${AF_COMPUTE_LIBRARY}" STREQUAL "Intel-MKL"
219226
OR "${AF_COMPUTE_LIBRARY}" STREQUAL "MKL")
220227
af_mkl_batch_check()
221-
dependency_check(MKL_FOUND "Please ensure Intel-MKL / oneAPI-oneMKL is installed")
228+
dependency_check(MKL_Shared_FOUND "Please ensure Intel-MKL / oneAPI-oneMKL is installed")
222229
set(BUILD_WITH_MKL ON)
223230
elseif("${AF_COMPUTE_LIBRARY}" STREQUAL "FFTW/LAPACK/BLAS")
224231
dependency_check(FFTW_FOUND "FFTW not found")

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL