From 9cc7ea4a97f2ecbfde873fc384d62bd8bc512075 Mon Sep 17 00:00:00 2001 From: liulixinkerry Date: Sat, 27 May 2023 12:13:38 +0800 Subject: [PATCH] update cmake --- CMakeLists.txt | 1 + cpp_to_py/gpudp/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d76f2..9f324cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,7 @@ message(STATUS TORCH_VERSION=${TORCH_VERSION_MAJOR}.${TORCH_VERSION_MINOR}) # find CUDA if (TORCH_ENABLE_CUDA) find_package(CUDA 11.4) + find_package(CUDAToolkit) if (NOT CUDA_FOUND) set(TORCH_ENABLE_CUDA 0 CACHE BOOL "Whether enable CUDA" FORCE) message(FATAL_ERROR "Xplace only supports CUDA mode, CMake will exit." ) diff --git a/cpp_to_py/gpudp/CMakeLists.txt b/cpp_to_py/gpudp/CMakeLists.txt index 492026a..bcd5eab 100644 --- a/cpp_to_py/gpudp/CMakeLists.txt +++ b/cpp_to_py/gpudp/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(dp SHARED ${CMAKE_CURRENT_SOURCE_DIR}/../io_parser/gp/GPDatabase.cpp ${SRC_FILES_DP_CUDA}) target_include_directories(dp PRIVATE ${PROJECT_SOURCE_DIR}/cpp_to_py ${TORCH_INCLUDE_DIRS} ${FLUTE_INCLUDE_DIR}) -target_link_libraries(dp PRIVATE torch ${TORCH_PYTHON_LIBRARY} xplace_common flute dp_cuda_tmp pthread) +target_link_libraries(dp PRIVATE torch ${TORCH_PYTHON_LIBRARY} xplace_common flute dp_cuda_tmp pthread CUDA::curand) target_compile_options(dp PRIVATE -fPIC) install(TARGETS dp DESTINATION ${XPLACE_LIB_DIR})