2023-04-18 13:31:14 +08:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
project(Aurora)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2023-10-30 10:28:24 +08:00
|
|
|
|
|
|
|
|
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
|
|
|
|
|
enable_language(CUDA)
|
|
|
|
|
find_package(CUDAToolkit REQUIRED)
|
|
|
|
|
|
2023-04-18 13:31:14 +08:00
|
|
|
find_package (OpenMP REQUIRED)
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
|
|
|
|
if(OPENMP_FOUND)
|
|
|
|
|
message("OPENMP FOUND")
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(MKL_INTERFACE_FULL intel_lp64)
|
|
|
|
|
find_package(MKL CONFIG REQUIRED)
|
2023-04-23 16:01:53 +08:00
|
|
|
include_directories(./ ./src /usr/local/include/eigen3 ./thirdparty/include)
|
2023-04-18 13:31:14 +08:00
|
|
|
file(GLOB_RECURSE cpp_files ./src/*.cpp)
|
|
|
|
|
file(GLOB_RECURSE cxx_files ./src/*.cxx)
|
|
|
|
|
add_executable(Aurora ${cpp_files} ${cxx_files} )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
target_compile_options(Aurora PUBLIC $<TARGET_PROPERTY:MKL::MKL,INTERFACE_COMPILE_OPTIONS>)
|
|
|
|
|
target_include_directories(Aurora PUBLIC $<TARGET_PROPERTY:MKL::MKL,INTERFACE_INCLUDE_DIRECTORIES>)
|
|
|
|
|
target_link_libraries(Aurora PUBLIC $<LINK_ONLY:MKL::MKL>)
|
|
|
|
|
target_link_libraries(Aurora PUBLIC OpenMP::OpenMP_CXX)
|
2023-04-27 14:32:57 +08:00
|
|
|
target_link_libraries(Aurora PUBLIC matio)
|
2023-10-30 10:28:24 +08:00
|
|
|
|
|
|
|
|
target_include_directories(Aurora PRIVATE ./src /usr/local/cuda/include)
|
|
|
|
|
set_target_properties(Aurora PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
|
|
|
|
target_compile_options(Aurora PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
|
|
|
|
-arch=sm_75
|
|
|
|
|
>)
|
|
|
|
|
target_link_libraries(Aurora PRIVATE ${CUDA_RUNTIME_LIBRARY} CUDA::cufft CUDA::cudart)
|
|
|
|
|
|
2023-04-18 13:31:14 +08:00
|
|
|
find_package(GTest REQUIRED)
|
|
|
|
|
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
|
2023-04-23 16:01:53 +08:00
|
|
|
include_directories(./src/util)
|
2023-04-18 13:31:14 +08:00
|
|
|
|
|
|
|
|
file(GLOB_RECURSE test_cpp ./test/*.cpp)
|
2023-04-23 09:40:22 +08:00
|
|
|
|
2023-04-18 13:31:14 +08:00
|
|
|
enable_testing()
|
|
|
|
|
|
2023-04-23 09:40:22 +08:00
|
|
|
add_executable(Aurora_Test ${cpp_files} ${test_cpp} )
|
|
|
|
|
target_include_directories(Aurora_Test PUBLIC ./test/)
|
2023-04-18 13:31:14 +08:00
|
|
|
target_compile_options(Aurora_Test PUBLIC $<TARGET_PROPERTY:MKL::MKL,INTERFACE_COMPILE_OPTIONS>)
|
|
|
|
|
target_include_directories(Aurora_Test PUBLIC $<TARGET_PROPERTY:MKL::MKL,INTERFACE_INCLUDE_DIRECTORIES>)
|
|
|
|
|
target_link_libraries(Aurora_Test PUBLIC $<LINK_ONLY:MKL::MKL>)
|
|
|
|
|
target_link_libraries(Aurora_Test PUBLIC OpenMP::OpenMP_CXX)
|
2023-04-27 14:32:57 +08:00
|
|
|
target_link_libraries(Aurora_Test PUBLIC matio)
|
2023-04-18 13:31:14 +08:00
|
|
|
target_link_libraries(Aurora_Test PUBLIC ${GTEST_BOTH_LIBRARIES} )
|
2023-10-30 10:28:24 +08:00
|
|
|
|
|
|
|
|
target_include_directories(Aurora_Test PRIVATE ./src /usr/local/cuda/include)
|
|
|
|
|
set_target_properties(Aurora_Test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
|
|
|
|
target_compile_options(Aurora_Test PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
|
|
|
|
|
-arch=sm_75
|
|
|
|
|
>)
|
|
|
|
|
target_link_libraries(Aurora_Test PRIVATE ${CUDA_RUNTIME_LIBRARY} CUDA::cufft CUDA::cudart)
|
2023-04-18 13:31:14 +08:00
|
|
|
gtest_discover_tests(Aurora_Test )
|
|
|
|
|
#target_link_libraries(CreateMatchedFilter PRIVATE TBB::tbb)
|