-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
107 lines (90 loc) · 2.78 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
103
104
105
106
107
cmake_minimum_required(VERSION 3.8)
project(ABISS)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(optionalLibs)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -fopenmp")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -Og -g -fopenmp")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Boost COMPONENTS iostreams system REQUIRED)
find_package(Threads REQUIRED)
find_package(OpenMP REQUIRED)
find_package(TBB REQUIRED)
find_package(absl)
find_package(PkgConfig REQUIRED)
pkg_check_modules(JEMALLOC jemalloc)
pkg_check_modules(MIMALLOC mimalloc)
if(MIMALLOC_FOUND)
add_definitions(-DUSE_MIMALLOC)
include_directories(${MIMALLOC_INCLUDE_DIRS})
set(optionalLibs ${optionalLibs} ${MIMALLOC_LDFLAGS})
message(STATUS "Use mimalloc as the default allocator.")
elseif(JEMALLOC_FOUND)
set(optionalLibs ${optionalLibs} ${JEMALLOC_LDFLAGS})
message(STATUS "Use jemalloc as the default allocator.")
endif()
if(absl_FOUND)
add_definitions(-DUSE_ABSL_HASHMAP)
set(optionalLibs ${optionalLibs}
absl::flat_hash_map
absl::flat_hash_set
)
message(STATUS "Use abseil::flat_hash_map and absl::flat_hash_set")
endif(absl_FOUND)
link_libraries(TBB::tbb ${Boost_LIBRARIES} ${optionalLibs})
if(EXTRACT_SIZE)
add_definitions(-DEXTRACT_SIZE)
endif(EXTRACT_SIZE)
if(EXTRACT_BBOX)
add_definitions(-DEXTRACT_BBOX)
endif(EXTRACT_BBOX)
if(EXTRACT_COM)
add_definitions(-DEXTRACT_COM)
endif(EXTRACT_COM)
if(MST_EDGE)
add_definitions(-DMST_EDGE)
endif(MST_EDGE)
if(DOUBLE)
add_definitions(-DDOUBLE)
endif(DOUBLE)
add_executable(meme
src/seg/merge_edges_ME.cpp)
add_executable(acme
src/seg/atomic_chunk_ME.cpp)
add_executable(assort
src/seg/assort.cpp)
add_executable(split_remap
src/seg/split_remap.cpp)
add_executable(match_chunks
src/seg/match_chunks.cpp)
add_executable(reduce_chunk
src/seg/reduce_chunk.cpp)
add_executable(size_map
src/seg/size_map.cpp)
add_executable(evaluate
src/seg/eval.cpp)
add_executable(ws
src/ws/atomic_chunk.cpp)
add_executable(ws2
src/ws/merge_chunks.cpp)
add_executable(ws3
src/ws/remap.cpp)
add_executable(agg
src/agg/mean_aggl.cpp)
add_executable(agg_nonoverlap
src/agg/mean_aggl.cpp)
add_executable(agg_overlap
src/agg/mean_aggl.cpp)
add_executable(agg_extra
src/agg/mean_aggl.cpp)
add_executable(accs
src/seg/contact_surface.cpp)
add_executable(mecs
src/seg/merge_cs.cpp)
#target_compile_definitions(agg PRIVATE FINAL PRIVATE EXTRA)
#target_compile_definitions(agg_overlap PRIVATE OVERLAPPED PRIVATE FINAL PRIVATE EXTRA)
#target_compile_definitions(agg_extra PRIVATE EXTRA)
target_compile_definitions(agg PRIVATE FINAL)
target_compile_definitions(agg_overlap PRIVATE OVERLAPPED PRIVATE FINAL)