forked from sussmanLab/cellGPU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (66 loc) · 2.24 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
cmake_minimum_required(VERSION 3.9.0)
project(cellGPU LANGUAGES CUDA CXX)
#note: CGAL (which I will get rid of someday) needs at least c++14; some advanced gcc compilers will throw errors if you don't set the cpp standard to 17, though
set(CMAKE_CXX_STANDARD 17)
add_definitions(-DENABLE_CUDA)
find_package(OpenMP REQUIRED)
set(CUDA_ARCH "30;35;50")
#if you have different cuda-capable hardware, modify this line to get much more optimized performance. By default,
#I have set this to work on Tesla K40s (still used at many XSEDE facilities), but add the correct codes for optimizing performance
#on your cards
set(CMAKE_CC_FLAGS "${CMAKE_CC_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DBOOST_MATH_DISABLE_FLOAT128 -fopenmp -frounding-math")
set(CMAKE_CUDA_FLAGS "${CUDA_NVCC_FLAGS} --expt-relaxed-constexpr")
set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH})
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
add_definitions(-DDEBUGFLAGUP)
set(CUDA_CUDA_FLAGS "${CUDA_NVCC_FLAGS} -g -lineinfo -Xptxas --generate-line-info")
endif(${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmakeHelp)
find_package(CGAL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(CUDA REQUIRED)
include_directories(
${EIGEN3_INCLUDE_DIR}
${CUDA_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/inc
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/utility
${CMAKE_SOURCE_DIR}/src/updaters
${CMAKE_SOURCE_DIR}/src/simulation
${CMAKE_SOURCE_DIR}/src/models
${CMAKE_SOURCE_DIR}/src/analysis
${CMAKE_SOURCE_DIR}/src/databases
)
add_subdirectory(src)
set(myLibs
model
modelGPU
updaters
updatersGPU
analysis
database
simulation
utility
utilityGPU
)
link_directories(${CUDA_LIBRARY_DIRS} $ENV{LD_LIBRARY_PATH})
set(SOURCES
)
set(HEADERS
)
# list the names of cpp files corresponding to linked executables you'd like...
foreach(ARG
voronoi
Vertex
)
add_executable("${ARG}.out" "${ARG}.cpp" )
target_link_libraries("${ARG}.out"
${CUDA_LIBRARIES}
${myLibs}
CGAL::CGAL
netcdf
netcdf_c++
OpenMP::OpenMP_CXX
)
endforeach()