-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
101 lines (88 loc) · 2.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
cmake_minimum_required(VERSION 3.17.0)
cmake_policy(VERSION 3.6...3.17.0)
INCLUDE(CheckCSourceCompiles)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CUDAToolkit_ROOT /usr/bin)
project(glb VERSION 0.1 LANGUAGES C CXX CUDA )
# Check for restrict keyword
# Builds the macro A_C_RESTRICT form automake
foreach(ac_kw __restrict __restrict__ _Restrict restrict)
check_c_source_compiles(
"
typedef int * int_ptr;
int foo (int_ptr ${ac_kw} ip) {
return ip[0];
}
int main(){
int s[1];
int * ${ac_kw} t = s;
t[0] = 0;
return foo(t);
}
"
RESTRICT)
if(RESTRICT)
set(ac_cv_c_restrict ${ac_kw})
break()
endif()
endforeach()
if(RESTRICT)
add_definitions("-Drestrict=${ac_cv_c_restrict}")
else()
add_definitions("-Drestrict=")
endif()
find_package(MPI REQUIRED)
#find_package(FFTW3 REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
# Set architecture flag
add_subdirectory(blitz)
add_subdirectory(mdl2)
set(CMAKE_C_FLAGS -fopenmp)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Release build with debug info selected")
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
#set(CMAKE_C_FLAGS -DBZ_DEBUG)
add_executable(
orbit
src/orbit.cpp
src/services/setadd.cpp
src/services/TraversePST.cpp
src/services/countLeft.cpp
src/services/count.cpp
src/services/init.cu
src/services/copyParticles.cu
src/services/copyCells.cu
src/services/countLeftGPU.cu
src/services/countLeftGPUAxis.cu
src/services/partition.cpp
src/services/partitionGPU.cu
src/services/finalize.cu
src/services/makeAxis.cpp
src/tipsy/tipsy.cxx)
set(SOURCE_FILES
src/constants.h
src/IO.h
src/cell.h
src/services/copyParticles.h
src/services/count.h
src/services/countLefGPU.h
src/services/countLeft.h
src/services/countLeftAxis.h
src/services/finalize.h
src/services/init.h
src/services/makeAxis.h
src/services/partition.h
src/services/partitionGPU.h
src/services/pst.h
src/services/setadd.h
src/services/TraversePST.h
)
target_include_directories(orbit PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set_target_properties(orbit PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
target_link_libraries(orbit mdl2 blitz)