Skip to content

Commit bfa4c59

Browse files
fixed type in find_library call arguments PATH->PATHS
Also made libraries required, removed use of target_link_directories
1 parent 6ee76bc commit bfa4c59

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

examples/pybind11/onemkl_gemv/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ include(GNUInstallDirs)
1717
include(FetchContent)
1818
FetchContent_Declare(
1919
pybind11
20-
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.9.0.tar.gz
21-
URL_HASH SHA256=057fb68dafd972bc13afb855f3b0d8cf0fa1a78ef053e815d9af79be7ff567cb
20+
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.9.2.tar.gz
21+
URL_HASH SHA256=6bd528c4dbe2276635dc787b6b1f2e5316cf6b49ee3e150264e455a0d68d19c1
2222
)
2323
FetchContent_MakeAvailable(pybind11)
2424

2525
find_package(PythonExtensions REQUIRED)
2626
find_package(Dpctl REQUIRED)
2727

28-
find_library(mkl_core NAMES mkl_core PATH ${MKL_LIBRARY_DIR})
29-
find_library(mkl_sycl NAMES mkl_sycl PATH ${MKL_LIBRARY_DIR})
30-
find_library(mkl_intel_ilp64 NAMES mkl_intel_ilp64 PATH ${MKL_LIBRARY_DIR})
31-
find_library(mkl_tbb_thread NAMES mkl_tbb_thread PATH ${MKL_LIBRARY_DIR})
32-
find_library(tbb NAMES tbb PATH ${TBB_LIBRARY_DIR})
28+
find_library(mkl_core NAMES mkl_core PATHS ${MKL_LIBRARY_DIR} REQUIRED)
29+
find_library(mkl_sycl NAMES mkl_sycl PATHS ${MKL_LIBRARY_DIR} REQUIRED)
30+
find_library(mkl_intel_ilp64 NAMES mkl_intel_ilp64 PATHS ${MKL_LIBRARY_DIR} REQUIRED)
31+
find_library(mkl_tbb_thread NAMES mkl_tbb_thread PATHS ${MKL_LIBRARY_DIR} REQUIRED)
32+
find_library(tbb NAMES tbb PATHS ${TBB_LIBRARY_DIR} REQUIRED)
3333

3434
set(py_module_name _onemkl)
3535

@@ -41,12 +41,11 @@ target_include_directories(${py_module_name}
4141
PUBLIC ${MKL_INCLUDE_DIR} ${TBB_INCLUDE_DIR}
4242
)
4343
target_link_libraries(${py_module_name}
44-
PUBLIC mkl_sycl mkl_intel_ilp64 mkl_tbb_thread mkl_core tbb
44+
PRIVATE ${mkl_sycl} ${mkl_intel_ilp64} ${mkl_tbb_thread} ${mkl_core} ${tbb}
4545
)
4646

4747
install(TARGETS ${py_module_name} DESTINATION sycl_gemm)
4848
target_include_directories(${py_module_name} PUBLIC ${Dpctl_INCLUDE_DIRS})
49-
target_link_directories(${py_module_name} PUBLIC ${MKL_LIBRARY_DIR} ${TBB_LIBRARY_DIR})
5049

5150
get_target_property(_sycl_gemm_sources ${py_module_name} SOURCES)
5251
set_source_files_properties(${_sycl_gemm_sources}

examples/pybind11/onemkl_gemv/sycl_gemm/_onemkl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#include "dpctl4pybind11.hpp"
1+
// clang-format off
22
#include <CL/sycl.hpp>
33
#include <oneapi/mkl.hpp>
44
#include <pybind11/pybind11.h>
55
#include <pybind11/stl.h>
6+
#include "dpctl4pybind11.hpp"
7+
// clang-format on
68

79
namespace py = pybind11;
810

0 commit comments

Comments
 (0)