Skip to content

Fix cmake FindDpctl.cmake #1484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmake/FindDpctl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ if(NOT Dpctl_FOUND)
find_package(Python 3.9 REQUIRED
COMPONENTS Interpreter Development.Module)

if(PYTHON_EXECUTABLE)
execute_process(COMMAND "${PYTHON_EXECUTABLE}"
if(Python_EXECUTABLE)
execute_process(COMMAND "${Python_EXECUTABLE}"
-c "import dpctl; print(dpctl.get_include())"
OUTPUT_VARIABLE _dpctl_include_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
execute_process(COMMAND "${PYTHON_EXECUTABLE}"
execute_process(COMMAND "${Python_EXECUTABLE}"
-c "import dpctl; print(dpctl.__version__)"
OUTPUT_VARIABLE Dpctl_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand All @@ -38,7 +38,7 @@ endif()

find_path(Dpctl_INCLUDE_DIR
dpctl_capi.h dpctl4pybind11.hpp dpctl_sycl_interface.h
PATHS "${_dpctl_include_dir}" "${PYTHON_INCLUDE_DIR}"
PATHS "${_dpctl_include_dir}" "${Python_INCLUDE_DIRS}"
PATH_SUFFIXES dpctl/include
)
get_filename_component(_dpctl_dir ${_dpctl_include_dir} DIRECTORY)
Expand Down