forked from crillab/d4v2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
168 lines (141 loc) · 5.1 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
cmake_minimum_required(VERSION 3.27)
project(d4 VERSION 2.0.0 LANGUAGES CXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(Solver)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# FIXME: libmtkahypar currently can not be built statically (https://github.com/kahypar/mt-kahypar/pull/161)
option(BUILD_SHARED_LIBS "Build shared libraries." ON)
if(NOT BUILD_SHARED_LIBS)
set(GMP_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_LIBS ON)
set(MtKaHyPar_USE_STATIC_LIBS ON)
set(glucose_USE_STATIC_LIBS ON)
endif()
set(GPMC_USE_STATIC_LIBS ON)
find_package(GMP REQUIRED)
find_package(Boost REQUIRED COMPONENTS program_options)
find_package(MtKaHyPar REQUIRED)
find_package(arjun REQUIRED)
find_package(GPMC REQUIRED)
find_package(glucose REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/glucose-3.0)
include_directories(${GMP_INCLUDE_DIRS})
include_directories(${GMPXX_INCLUDE_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${MtKaHyPar_INCLUDE_DIR})
include_directories(${arjun_INCLUDE_DIR})
include_directories(${GMPC_INCLUDE_DIR})
include_directories(${glucose_INCLUDE_DIRS})
add_library(caching OBJECT
src/caching/BucketAllocator.cpp
src/caching/cnf/BucketInConstruction.cpp
src/caching/DataInfo.cpp
)
add_library(config OBJECT
src/config/Config.cpp
src/config/ConfigConverter.cpp
)
add_library(heuristics OBJECT
src/heuristics/cnf/PartitioningHeuristicBipartite.cpp
src/heuristics/cnf/PartitioningHeuristicBipartiteDual.cpp
src/heuristics/cnf/PartitioningHeuristicBipartitePrimal.cpp
src/heuristics/cnf/PartitioningHeuristicStatic.cpp
src/heuristics/cnf/PartitioningHeuristicStaticMulti.cpp
src/heuristics/cnf/PartitioningHeuristicStaticNone.cpp
src/heuristics/cnf/PartitioningHeuristicStaticSingle.cpp
src/heuristics/cnf/PartitioningHeuristicStaticSingleDual.cpp
src/heuristics/cnf/PartitioningHeuristicStaticSinglePrimal.cpp
src/heuristics/cnf/PhaseSelectorDynamic.cpp
src/heuristics/cnf/PhaseSelectorManager.cpp
src/heuristics/cnf/PhaseSelectorNone.cpp
src/heuristics/cnf/PhaseSelectorStatic.cpp
src/heuristics/cnf/ProjBackupHeuristicComponents.cpp
src/heuristics/cnf/ProjBackupHeuristicHypergraph.cpp
src/heuristics/cnf/ScoringMethodDlcs.cpp
src/heuristics/cnf/ScoringMethodJwts.cpp
src/heuristics/cnf/ScoringMethodMom.cpp
src/heuristics/cnf/ScoringMethodVsads.cpp
src/heuristics/cnf/ScoringMethodVsids.cpp
src/heuristics/PartitioningHeuristic.cpp
src/heuristics/PartitioningHeuristicNone.cpp
src/heuristics/PhaseHeuristic.cpp
src/heuristics/PhaseHeuristicFalse.cpp
src/heuristics/PhaseHeuristicOccurrence.cpp
src/heuristics/PhaseHeuristicPolarity.cpp
src/heuristics/PhaseHeuristicTrue.cpp
src/heuristics/ProjBackupHeuristic.cpp
src/heuristics/ScoringMethod.cpp
)
add_library(hyperGraph OBJECT
src/hyperGraph/HyperEdge.cpp
src/hyperGraph/HyperGraph.cpp
src/hyperGraph/HyperGraphExtractorDual.cpp
src/hyperGraph/HyperGraphExtractorDualProj.cpp
src/hyperGraph/HyperGraphExtractorPrimal.cpp
)
add_library(methods OBJECT
src/methods/MethodManager.cpp
src/methods/QueryManager.cpp
)
add_library(partitioner OBJECT
src/partitioner/PartitionerKahyparMT.cpp
src/partitioner/PartitionerManager.cpp
)
add_library(preprocs OBJECT
src/preprocs/cnf/util/lib_sharpsat_td/subsumer.cpp
src/preprocs/cnf/util/PreprocGPMC.cpp
src/preprocs/cnf/util/TestSolver.cpp
src/preprocs/cnf/PreprocBackboneCnf.cpp
src/preprocs/cnf/PreprocBasicCnf.cpp
src/preprocs/cnf/PreprocGPMC.cpp
src/preprocs/cnf/PreprocProj.cpp
src/preprocs/PreprocManager.cpp
)
add_library(problem OBJECT
src/problem/cnf/ParserDimacs.cpp
src/problem/cnf/ProblemManagerCnf.cpp
src/problem/ProblemManager.cpp
src/problem/ProblemTypes.cpp
)
add_library(solvers OBJECT
src/solvers/ActivityManager.cpp
src/solvers/cnf/minisat/Solver.cpp
src/solvers/cnf/WrapperMinisat.cpp
src/solvers/WrapperSolver.cpp
)
if(USE_GLUCOSE)
target_sources(solvers PRIVATE src/solvers/cnf/WrapperGlucose.cpp)
endif()
add_library(spec OBJECT
src/specs/cnf/SpecManagerCnf.cpp
src/specs/cnf/SpecManagerCnfDyn.cpp
src/specs/SpecManager.cpp
)
add_library(utils OBJECT
src/utils/AtMost1Extractor.cpp
src/utils/cnf/AndGatesExtractor.cpp
src/utils/EquivExtractor.cpp
)
add_library(core STATIC
$<TARGET_OBJECTS:config>
$<TARGET_OBJECTS:caching>
$<TARGET_OBJECTS:heuristics>
$<TARGET_OBJECTS:hyperGraph>
$<TARGET_OBJECTS:methods>
$<TARGET_OBJECTS:partitioner>
$<TARGET_OBJECTS:preprocs>
$<TARGET_OBJECTS:problem>
$<TARGET_OBJECTS:solvers>
$<TARGET_OBJECTS:spec>
$<TARGET_OBJECTS:utils>
)
target_link_libraries(core MtKaHyPar::MtKaHyPar GPMC::GPMC arjun glucose::glucose GMP::GMPXX GMP::GMP cadiback cadical)
if(USE_GLUCOSE)
target_link_libraries(core glucose::glucose)
endif()
add_executable(d4 src/Main.cpp)
target_link_libraries(d4 core Boost::program_options)
install(TARGETS d4)