-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
executable file
·102 lines (76 loc) · 2.64 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
102
CMAKE_MINIMUM_REQUIRED(VERSION 3.18)
IF (DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release")
ENDIF ()
MESSAGE("build type set to ${CMAKE_BUILD_TYPE}")
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
PROJECT(MARVL
LANGUAGES CXX C)
OPTION(CUDA_FEATS "Set to On to use CUDA features" ON)
IF (CUDA_FEATS)
# sm_60 = PASCAL
# sm_70 = VOLTA (TESLA)
# sm_75 = TURING
# sm_80 = AMPERE
# sm_89 = ADA
# sm_90 = HOPPER
# https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
ENABLE_LANGUAGE(CUDA)
SET(CMAKE_CUDA_ARCHITECTURES 52 60 61 70 75)
ELSE ()
MESSAGE("CUDA_FEATS set to OFF. Skipping CUDA targets.")
ENDIF ()
IF (NOT DEFINED CMAKE_CXX_STANDARD)
SET(CMAKE_CXX_STANDARD 11)
ENDIF ()
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
IF (NOT DEFINED CMAKE_CUDA_STANDARD)
SET(CMAKE_CUDA_STANDARD 11)
ENDIF ()
SET(CMAKE_CUDA_STANDARD_REQUIRED ON)
IF (DEFINED CMAKE_COMMON_FLAGS)
ADD_COMPILE_OPTIONS(${CMAKE_COMMON_FLAGS})
ENDIF ()
ADD_COMPILE_OPTIONS( $<$<COMPILE_LANGUAGE:C,CXX>:-Wall> )
ADD_COMPILE_OPTIONS( $<$<COMPILE_LANGUAGE:CXX>:-fopenmp> )
ADD_LINK_OPTIONS( $<$<LINK_LANGUAGE:CXX>:-fopenmp> )
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_COMPILE_OPTIONS( $<$<COMPILE_LANGUAGE:C,CXX>:-g> )
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-macros -Wall -Wextra -I../ -g -O0 -Wunreachable-code -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
# set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-macros -Wall -Wextra -I../ -g -O0 -Wunreachable-code -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
ELSEIF (CMAKE_BUILD_TYPE STREQUAL "Release")
ADD_COMPILE_OPTIONS( $<$<COMPILE_LANGUAGE:C,CXX>:-O2> )
ADD_COMPILE_OPTIONS( $<$<COMPILE_LANGUAGE:C,CXX>:-DNDEBUG> )
ENDIF ()
FIND_PACKAGE(Threads REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK QUIET gtk+-3.0)
INCLUDE_DIRECTORIES(
AFTER
SYSTEM
.
)
ADD_SUBDIRECTORY(corrector)
IF (CUDA_FEATS)
ADD_SUBDIRECTORY(cuda)
ADD_SUBDIRECTORY(cudalign)
ENDIF()
ADD_SUBDIRECTORY(dalign)
ADD_SUBDIRECTORY(dalign2)
ADD_SUBDIRECTORY(db)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(lib.ext)
ADD_SUBDIRECTORY(scrub)
ADD_SUBDIRECTORY(sv)
ADD_SUBDIRECTORY(touring)
ADD_SUBDIRECTORY(utils)
INSTALL(DIRECTORY scripts DESTINATION .
FILE_PERMISSIONS
OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
CONFIGURE_FILE( lib.python/marvel/config.py.in lib.python/marvel/config.py )
INSTALL(DIRECTORY lib.python DESTINATION .
PATTERN "*.in" EXCLUDE)
UNSET(CUDA_FEATS CACHE)