2023-05-04 16:37:33 +08:00
|
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
|
project(UR)
|
|
|
|
|
|
|
2023-06-15 15:43:18 +08:00
|
|
|
|
|
2023-05-04 16:37:33 +08:00
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2023-12-22 11:17:18 +08:00
|
|
|
|
add_definitions(-DUSE_CUDA)
|
2023-10-09 09:29:21 +08:00
|
|
|
|
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
|
|
|
|
|
|
enable_language(CUDA)
|
|
|
|
|
|
find_package(CUDAToolkit REQUIRED)
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
|
|
|
|
|
|
|
2023-05-04 16:37:33 +08:00
|
|
|
|
find_package(Aurora REQUIRED)
|
2023-05-12 14:37:23 +08:00
|
|
|
|
find_package(Parser REQUIRED)
|
2023-05-23 09:39:21 +08:00
|
|
|
|
find_package(URDepends REQUIRED)
|
2023-08-01 15:58:38 +08:00
|
|
|
|
find_package(DCMTK REQUIRED)
|
|
|
|
|
|
set(DCMTK_WITH_JPEG OFF)
|
2023-05-04 16:37:33 +08:00
|
|
|
|
file(GLOB_RECURSE cpp_files ./src/*.cpp)
|
2023-10-09 09:29:21 +08:00
|
|
|
|
file(GLOB_RECURSE cu_files ./src/*.cu)
|
2023-05-04 16:37:33 +08:00
|
|
|
|
file(GLOB_RECURSE cxx_files ./src/*.cxx)
|
2023-05-05 16:48:34 +08:00
|
|
|
|
file(GLOB_RECURSE header_files ./src/*.h)
|
2023-12-22 11:17:18 +08:00
|
|
|
|
add_executable(UR ${cpp_files} ${cu_files} ${cxx_files} ${header_files} ${Aurora_Source} ${Aurora_Source_Cu} ./src/Aurora.cu ${Aurora_DIR}/src/CudaMatrixPrivate.cu)
|
|
|
|
|
|
|
|
|
|
|
|
#target_compile_options(UR PUBLIC ${Aurora_Complie_Options} "-march=native")
|
2023-05-25 16:15:21 +08:00
|
|
|
|
target_include_directories(UR PUBLIC ./src/)
|
2023-05-04 16:37:33 +08:00
|
|
|
|
target_include_directories(UR PUBLIC ${Aurora_INCLUDE_DIRS})
|
2023-09-12 09:50:15 +08:00
|
|
|
|
target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS})
|
2023-05-12 14:37:23 +08:00
|
|
|
|
target_include_directories(UR PUBLIC ${Parser_INCLUDE_DIRS})
|
2023-05-23 09:39:21 +08:00
|
|
|
|
target_include_directories(UR PUBLIC ${URDepends_INCLUDES_DIRS})
|
2023-10-09 09:29:21 +08:00
|
|
|
|
target_include_directories(UR PUBLIC ${DCMTK_INCLUDE_DIRS})
|
2023-05-04 16:37:33 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC ${Aurora_Libraries})
|
2023-09-12 09:50:15 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC dcmdata)
|
2023-05-05 16:48:34 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC matio)
|
2023-06-27 14:26:09 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC Parser)
|
|
|
|
|
|
|
2023-05-23 09:39:21 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC URDepends::TransDetection)
|
2024-12-19 10:32:06 +08:00
|
|
|
|
# target_link_libraries(UR PUBLIC URDepends::eikonal)
|
2023-06-02 15:51:45 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC URDepends::TVALGPU)
|
2023-06-12 17:01:34 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC URDepends::SaftTofi)
|
2023-10-09 09:29:21 +08:00
|
|
|
|
target_link_libraries(UR PUBLIC dcmdata)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
target_include_directories(UR PRIVATE ./src /usr/local/cuda/include)
|
|
|
|
|
|
set_target_properties(UR PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
|
|
|
|
|
#target_compile_options(UR PRIVATE ${Aurora_Complie_Options} "-march=native")
|
|
|
|
|
|
# target_compile_options(UR PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
|
|
|
|
|
# --use_fast_math
|
|
|
|
|
|
# --ptxas-options=-v
|
|
|
|
|
|
# -arch sm_75
|
|
|
|
|
|
# >)
|
|
|
|
|
|
target_compile_options(UR PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
2023-12-22 11:17:18 +08:00
|
|
|
|
-arch=sm_75 --expt-extended-lambda
|
2023-10-09 09:29:21 +08:00
|
|
|
|
>)
|
2023-12-22 11:17:18 +08:00
|
|
|
|
|
2023-10-09 09:29:21 +08:00
|
|
|
|
target_link_libraries(UR PRIVATE ${CUDA_RUNTIME_LIBRARY} CUDA::cufft CUDA::cudart)
|
|
|
|
|
|
|
2023-06-15 15:43:18 +08:00
|
|
|
|
# target_link_libraries(UR PUBLIC URDepends::SaftATT)
|
2023-05-05 16:48:34 +08:00
|
|
|
|
find_package(GTest REQUIRED)
|
|
|
|
|
|
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
|
|
|
|
|
|
|
2023-05-25 16:15:21 +08:00
|
|
|
|
enable_testing()
|
|
|
|
|
|
file(GLOB_RECURSE test_cpp test/*.cpp)
|
2024-09-19 15:37:02 +08:00
|
|
|
|
add_executable(UR_Test ${cpp_files} ${header_files} ${Aurora_Source} ${test_cpp} ${cu_files} ${Aurora_Source} ${Aurora_Source_Cu} ./src/Aurora.cu ${Aurora_DIR}/src/CudaMatrixPrivate.cu)
|
|
|
|
|
|
|
2023-05-05 16:48:34 +08:00
|
|
|
|
target_include_directories(UR_Test PUBLIC ./test/ ./src/)
|
2024-06-12 13:07:18 +08:00
|
|
|
|
# target_compile_options(UR_Test PUBLIC ${Aurora_Complie_Options} "-march=native")
|
2023-08-01 15:58:38 +08:00
|
|
|
|
target_include_directories(UR_Test PUBLIC ${DCMTK_INCLUDE_DIRS})
|
2023-05-05 16:48:34 +08:00
|
|
|
|
target_include_directories(UR_Test PUBLIC ${Aurora_INCLUDE_DIRS})
|
2023-05-12 14:37:23 +08:00
|
|
|
|
target_include_directories(UR_Test PUBLIC ${Parser_INCLUDE_DIRS})
|
2023-05-23 09:39:21 +08:00
|
|
|
|
target_include_directories(UR_Test PUBLIC ${URDepends_INCLUDES_DIRS})
|
2023-05-25 16:15:21 +08:00
|
|
|
|
# 必须写前面不然容易出问题
|
|
|
|
|
|
target_link_libraries(UR_Test PUBLIC ${GTEST_BOTH_LIBRARIES})
|
2023-05-05 16:48:34 +08:00
|
|
|
|
target_link_libraries(UR_Test PUBLIC ${Aurora_Libraries})
|
2023-08-01 15:58:38 +08:00
|
|
|
|
target_link_libraries(UR_Test PUBLIC dcmdata)
|
2023-05-05 16:48:34 +08:00
|
|
|
|
target_link_libraries(UR_Test PUBLIC matio)
|
2023-06-27 14:26:09 +08:00
|
|
|
|
# target_link_libraries(UR_Test PUBLIC ${Parser_Libraries})
|
|
|
|
|
|
target_link_libraries(UR_Test PUBLIC Parser)
|
2023-05-23 09:39:21 +08:00
|
|
|
|
target_link_libraries(UR_Test PUBLIC URDepends::TransDetection)
|
2024-12-19 10:32:06 +08:00
|
|
|
|
# target_link_libraries(UR_Test PUBLIC URDepends::eikonal)
|
2023-05-31 13:56:05 +08:00
|
|
|
|
target_link_libraries(UR_Test PUBLIC URDepends::TVALGPU)
|
2023-06-12 17:01:34 +08:00
|
|
|
|
target_link_libraries(UR_Test PUBLIC URDepends::SaftTofi)
|
2023-06-15 15:43:18 +08:00
|
|
|
|
# target_link_libraries(UR_Test PUBLIC URDepends::SaftATT)
|
2024-09-19 15:37:02 +08:00
|
|
|
|
target_include_directories(UR_Test PRIVATE ./src /usr/local/cuda/include)
|
|
|
|
|
|
set_target_properties(UR_Test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
|
|
|
|
|
|
|
|
|
|
|
target_compile_options(UR_Test PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
|
|
|
|
|
-arch=sm_75 --expt-extended-lambda
|
|
|
|
|
|
>)
|
2023-06-15 15:43:18 +08:00
|
|
|
|
|
2024-09-19 15:37:02 +08:00
|
|
|
|
target_link_libraries(UR_Test PRIVATE ${CUDA_RUNTIME_LIBRARY} CUDA::cufft CUDA::cudart)
|
2023-05-25 16:15:21 +08:00
|
|
|
|
gtest_discover_tests(UR_Test)
|