-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
59 lines (50 loc) · 1.57 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
cmake_minimum_required(VERSION 3.13)
project(pdc_mini_aevol)
set(CMAKE_CXX_STANDARD 14)
if ( DO_TRACES )
add_definitions(-DTRACES)
message( STATUS "Traces are activated" )
endif ( DO_TRACES )
if ( USE_CUDA )
# https://cliutils.gitlab.io/modern-cmake/chapters/packages/CUDA.html
find_package(CUDA REQUIRED)
include(CheckLanguage)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_FLAGS "-arch=compute_60")
set(CMAKE_CUDA_FLAGS_DEBUG "-Xcompiler -rdynamic -lineinfo")
else()
message(FATAL_ERROR "No CUDA support found")
endif()
endif ( USE_CUDA )
if ( USE_OMP )
find_package(OpenMP REQUIRED)
endif ( USE_OMP )
find_package(ZLIB REQUIRED)
add_library(micro_aevol
Abstract_ExpManager.cpp
ExpManager.cpp
AeTime.cpp
DnaMutator.cpp
MutationEvent.cpp
Organism.cpp
Stats.cpp
Threefry.cpp
Dna.cpp)
target_link_libraries(micro_aevol PUBLIC ZLIB::ZLIB)
if ( OPENMP_FOUND )
target_link_libraries(micro_aevol PUBLIC OpenMP::OpenMP_CXX)
target_compile_definitions(micro_aevol PUBLIC USE_OMP)
endif ()
if ( USE_CUDA )
add_subdirectory(cuda)
add_executable(micro_aevol_gpu main.cpp)
# nvToolsExt for enhanced profiling (ad-hoc chunks)
target_link_libraries(micro_aevol_gpu PUBLIC cuda_micro_aevol micro_aevol nvToolsExt)
else ()
add_executable(micro_aevol_cpu main.cpp)
target_link_libraries(micro_aevol_cpu micro_aevol)
endif ()