Skip to content

Commit a66e5e2

Browse files
committed
Clean up CMakeLists
1 parent fafc50a commit a66e5e2

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ This ``CMakeLists.txt`` file will be used by ``setup.py``.
1818

1919
cmake_minimum_required(VERSION 3.21...3.27 FATAL_ERROR)
2020

21-
message(STATUS "NUMBA_DPEX_VERSION=" "${NUMBA_DPEX_VERSION}")
22-
2321
project(numba-dpex
24-
DESCRIPTION "An extension for Numba to add data-parallel offload capability"
2522
VERSION ${NUMBA_DPEX_VERSION}
23+
DESCRIPTION "An extension for Numba to add data-parallel offload capability"
2624
)
2725

28-
add_subdirectory(numba_dpex)
26+
# Help conda build find path from both host and build env.
27+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
28+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
29+
30+
add_subdirectory(numba_dpex/core/runtime)

numba_dpex/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

numba_dpex/core/runtime/CMakeLists.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ project(_dpexrt_python
2424
DESCRIPTION "A Python C extension for numba-dpex runtime."
2525
)
2626

27-
# Help conda build find path from both host and build env.
28-
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
29-
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
30-
3127
# Get numba include path
3228
if(NOT DEFINED Numba_INCLUDE_DIRS)
3329
execute_process(
@@ -78,23 +74,12 @@ endif()
7874
set(SKBUILD_MODULE_PATH ${SKBUILD_PATH}/resources/cmake)
7975
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SKBUILD_MODULE_PATH})
8076

81-
# Check CMAKE_MODULE_PATH
82-
message(STATUS "CMAKE_MODULE_PATH=" "${CMAKE_MODULE_PATH}")
83-
8477
# Add packages
8578
find_package(Python 3.9 REQUIRED
8679
COMPONENTS Interpreter Development.Module NumPy)
8780
find_package(Dpctl REQUIRED)
8881
find_package(IntelSYCL REQUIRED)
8982

90-
# Includes
91-
include(GNUInstallDirs)
92-
include_directories(${Python_INCLUDE_DIRS})
93-
include_directories(${Python_NumPy_INCLUDE_DIRS})
94-
include_directories(${Numba_INCLUDE_DIRS})
95-
include_directories(${Dpctl_INCLUDE_DIRS})
96-
include_directories(.)
97-
9883
# Source files, *.c
9984
file(GLOB_RECURSE DPEXRT_SOURCES CONFIGURE_DEPENDS "*.c")
10085
file(GLOB_RECURSE KERNEL_SOURCES CONFIGURE_DEPENDS "*.cpp")
@@ -109,7 +94,20 @@ python_add_library(${PROJECT_NAME} MODULE ${SOURCES})
10994
# Add SYCL to target, this must come after python_add_library()
11095
add_sycl_to_target(TARGET ${PROJECT_NAME} SOURCES ${KERNEL_SOURCES})
11196

112-
# Link the DPCTLSyclInterface library to target
97+
# Add source headers
98+
target_include_directories(${PROJECT_NAME} PRIVATE .)
99+
100+
# Add Numba Runtime headers
101+
target_include_directories(${PROJECT_NAME} PRIVATE ${Numba_INCLUDE_DIRS})
102+
103+
# Link numpy
104+
target_link_libraries(${PROJECT_NAME} PRIVATE Python::NumPy)
105+
106+
# TODO: switch to CMake, once dpctl supports it.
107+
# Include DPCTL libraray
108+
target_include_directories(${PROJECT_NAME} PRIVATE ${Dpctl_INCLUDE_DIRS})
109+
# Linking target binary with DPCTLSyclInterface.so/.dll so the symbols could
110+
# be found during runtime.
113111
target_link_libraries(${PROJECT_NAME} PRIVATE DPCTLSyclInterface)
114112

115113
# Install

0 commit comments

Comments
 (0)