Skip to content

Commit da6be34

Browse files
committed
Restored python package build
1 parent f81ccea commit da6be34

2 files changed

Lines changed: 13 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ endif()
3434

3535
# Configure cuda dependencies
3636
if (CUBOOL_WITH_CUDA)
37-
message(STATUS "Add cub as cuda utility")
38-
# set(CUB_ENABLE_HEADER_TESTING OFF CACHE BOOL "" FORCE)
39-
# set(CUB_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
40-
# set(CUB_ENABLE_EXAMPLES OFF CACHE BOOL "" FORCE)
41-
# add_subdirectory(deps/cub)
42-
# add_library(cub INTERFACE IMPORTED)
43-
# target_link_libraries(cub INTERFACE CUB::CUB)
44-
4537
message(STATUS "Add nsparse library as crs matrix multiplication backend")
4638
add_subdirectory(deps/nsparse-um)
4739
endif()
@@ -60,7 +52,7 @@ endif()
6052
add_subdirectory(cubool)
6153

6254
# Copy scripts into binary directory
63-
# file(COPY scripts DESTINATION ${CMAKE_BINARY_DIR}/)
55+
file(COPY scripts DESTINATION ${CMAKE_BINARY_DIR}/)
6456

6557
# Copy python related stuff
66-
# file(COPY python DESTINATION ${CMAKE_BINARY_DIR}/)
58+
file(COPY python DESTINATION ${CMAKE_BINARY_DIR}/)

cubool/CMakeLists.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ endforeach()
222222
if (CUBOOL_WITH_CUDA)
223223
set_target_properties(cubool PROPERTIES CUDA_STANDARD 14)
224224
set_target_properties(cubool PROPERTIES CUDA_STANDARD_REQUIRED ON)
225-
# set_target_properties(cubool PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
226225

227226
# Settings: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
228227

@@ -249,14 +248,14 @@ if (CUBOOL_BUILD_TESTS)
249248
endif()
250249

251250
# Copy cubool library after build if allowed
252-
# if (CUBOOL_COPY_TO_PY_PACKAGE)
253-
# set(LIBRARY_FILE_NAME ${TARGET_FILE_NAME})
254-
#
255-
# add_custom_command(
256-
# TARGET cubool POST_BUILD
257-
# COMMAND "${CMAKE_COMMAND}" -E
258-
# copy
259-
# "${CMAKE_BINARY_DIR}/cubool/${LIBRARY_FILE_NAME}"
260-
# "${CMAKE_BINARY_DIR}/python/pycubool"
261-
# COMMENT "Copy ${LIBRARY_FILE_NAME} compiled lib into python folder")
262-
# endif()
251+
if (CUBOOL_COPY_TO_PY_PACKAGE)
252+
set(LIBRARY_FILE_NAME ${TARGET_FILE_NAME})
253+
254+
add_custom_command(
255+
TARGET cubool POST_BUILD
256+
COMMAND "${CMAKE_COMMAND}" -E
257+
copy
258+
"${CMAKE_BINARY_DIR}/cubool/${LIBRARY_FILE_NAME}"
259+
"${CMAKE_BINARY_DIR}/python/pycubool"
260+
COMMENT "Copy ${LIBRARY_FILE_NAME} compiled lib into python folder")
261+
endif()

0 commit comments

Comments
 (0)