-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
257 lines (227 loc) · 6.6 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# Copyright 2019, Alex Wiens <awiens@mail.upb.de>, Achim Lösch <achim.loesch@upb.de>
# SPDX-License-Identifier: BSD-2-Clause
cmake_minimum_required(VERSION 3.10)
project(sched)
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif(NOT WIN32)
### OPTIONS
option(MEASURE_AMPEHRE "build sched with Ampehre library" ON)
### LIBRARIES
# Threads
find_package( Threads )
if(NOT CMAKE_THREAD_LIBS_INIT)
message(FATAL_ERROR "Thread library not found")
endif()
# YAML
find_library(YAML_LIBRARY libyaml.so PATHS
/usr/lib
lib/libyaml/install/lib
)
include_directories(
lib/libyaml/install/include
)
if(NOT YAML_LIBRARY)
message(FATAL_ERROR "Yaml library not found")
else()
message(${YAML_LIBRARY})
endif()
# CJSON
find_library(CJSON_LIBRARY libcjson.so PATHS
/usr/lib/libcjson.so
/usr/lib
lib/cJSON/install/lib64
)
include_directories(
lib/cJSON/install/include
)
if(NOT CJSON_LIBRARY)
message(FATAL_ERROR "cJSON library not found")
else()
message(${CJSON_LIBRARY})
endif()
# LOG4CPP
find_library(LOG4CPP_LIBRARY liblog4cpp.so PATHS
/usr/lib
)
if(NOT LOG4CPP_LIBRARY)
message(FATAL_ERROR "log4cpp library not found")
else()
message(${LOG4CPP_LIBRARY})
endif()
# AMPEHRE
#find_library(AMPEHRE_LIBRARY libms_common.so PATHS
# /usr/ampehre/lib/libms_common.so
#)
include_directories(
/usr/ampehre/include
)
#add_library(ampehre SHARED IMPORTED)
#set_target_properties(ampehre PROPERTIES IMPORTED_LOCATION /usr/ampehre/lib/libms_common.so)
#if(NOT AMPEHRE_LIBRARY)
# message(FATAL_ERROR "Ampehre library not found")
#endif()
# SOURCE
set(SRC_SCHED
src/CLogger.cpp
src/CConfig.cpp
src/CTask.cpp
src/ETaskOnEnd.cpp
src/CTaskCopy.cpp
src/CTaskWrapper.cpp
src/CResource.cpp
src/CTaskDatabase.cpp
src/CSchedule.cpp
src/CScheduleExt.cpp
src/CFeedback.cpp
src/CFeedbackMain.cpp
src/CComServer.cpp
src/CComClient.cpp
src/CComSchedClient.cpp
src/CComUnixServer.cpp
src/CComUnixSchedServerMain.cpp
src/CComUnixClient.cpp
src/CComUnixSchedClient.cpp
src/CComUnixSchedClientMain.cpp
src/CComUnixWriteBuffer.cpp
src/CTaskLoader.cpp
src/CTaskLoaderMS.cpp
src/CExternalHook.cpp
src/CResourceLoader.cpp
src/CResourceLoaderMS.cpp
src/CScheduleAlgorithmMinMin.cpp
src/CScheduleAlgorithmMinMin2.cpp
src/CScheduleAlgorithmMinMin2Dyn.cpp
src/CScheduleAlgorithmMinMinMig.cpp
src/CScheduleAlgorithmMinMinMig2.cpp
src/CScheduleAlgorithmMinMinMig2Dyn.cpp
src/CScheduleAlgorithmMaxMin.cpp
src/CScheduleAlgorithmMaxMin2.cpp
src/CScheduleAlgorithmMaxMin2Dyn.cpp
src/CScheduleAlgorithmMaxMinMig2.cpp
src/CScheduleAlgorithmMaxMinMig2Dyn.cpp
src/CScheduleAlgorithmSufferage.cpp
src/CScheduleAlgorithmSufferage2.cpp
src/CScheduleAlgorithmSufferage2Dyn.cpp
src/CScheduleAlgorithmSufferageMig2.cpp
src/CScheduleAlgorithmSufferageMig2Dyn.cpp
src/CScheduleAlgorithmHEFT.cpp
src/CScheduleAlgorithmHEFT2.cpp
src/CScheduleAlgorithmHEFT2Dyn.cpp
src/CScheduleAlgorithmHEFTMig2.cpp
src/CScheduleAlgorithmHEFTMig2Dyn.cpp
src/CScheduleAlgorithmGenetic.cpp
src/CScheduleAlgorithmGeneticDyn.cpp
src/CScheduleAlgorithmGeneticMig.cpp
src/CScheduleAlgorithmGeneticMigDyn.cpp
src/CScheduleAlgorithmGeneticMigSolverLP.cpp
src/CScheduleAlgorithmGeneticMigSolverLPDyn.cpp
src/CScheduleAlgorithmGeneticMigSolverLPEnergy.cpp
src/CScheduleAlgorithmGeneticMigSolverLPEnergyDyn.cpp
src/CScheduleAlgorithmSimulatedAnnealing.cpp
src/CScheduleAlgorithmSimulatedAnnealingDyn.cpp
src/CScheduleAlgorithmSimulatedAnnealingMig.cpp
src/CScheduleAlgorithmSimulatedAnnealingMigDyn.cpp
src/CScheduleAlgorithmLinear.cpp
src/CScheduleAlgorithmTestMigration.cpp
src/CScheduleAlgorithmMCT.cpp
src/CScheduleAlgorithmMCT2.cpp
src/CScheduleAlgorithmMCTMig.cpp
src/CScheduleAlgorithmMCTMig2.cpp
src/CScheduleAlgorithmMET.cpp
src/CScheduleAlgorithmMET2.cpp
src/CScheduleAlgorithmMETMig2.cpp
src/CScheduleAlgorithmOLB.cpp
src/CScheduleAlgorithmOLB2.cpp
src/CScheduleAlgorithmOLBMig2.cpp
src/CScheduleAlgorithmSA.cpp
src/CScheduleAlgorithmSA2.cpp
src/CScheduleAlgorithmSAMig2.cpp
src/CScheduleAlgorithmKPB.cpp
src/CScheduleAlgorithmKPB2.cpp
src/CScheduleAlgorithmKPBMig2.cpp
src/CScheduleAlgorithmReMinMin.cpp
src/CScheduleAlgorithmReMinMin2.cpp
src/CScheduleAlgorithmReMinMin2Dyn.cpp
src/CScheduleAlgorithmReMinMinMig2.cpp
src/CScheduleAlgorithmReMinMinMig2Dyn.cpp
src/CScheduleAlgorithm.cpp
src/CScheduleExecutor.cpp
src/CScheduleExecutorMain.cpp
src/CScheduleComputer.cpp
src/CScheduleComputerMain.cpp
src/CEstimationLinear.cpp
src/CEstimation.cpp
src/CTimer.cpp
src/CMeasure.cpp
)
set(SRC_MAINSCHED
src/CMain.cpp
)
set(SRC_SIMSCHED
src/CSimMain.cpp
src/CSimQueue.cpp
)
set(SRC_WRAP
src/CComUnixSchedSchedulerWrap.cpp
src/CComUnixSchedScheduler.cpp
src/CComSchedScheduler.cpp
src/CComUnixSchedClientWrap.cpp
src/CComUnixSchedServerWrap.cpp
src/CUnixWrapClient.cpp
src/CWrapTaskGroup.cpp
src/CTaskDefinitions.cpp
src/CWrapMain.cpp
)
# OPTION MEASURE_AMPEHRE
if (MEASURE_AMPEHRE)
# add source file
set(SRC_SCHED
${SRC_SCHED}
src/CMeasureAmpehre.cpp
)
# add static library path to linker
SET( CMAKE_EXE_LINKER_FLAGS "/usr/ampehre/lib/libms_common.so")
# add define
add_definitions(-DSCHED_MEASURE_AMPEHRE)
message("${BoldCyan}Use Ampehre library for measurement${ColourReset}")
else (MEASURE_AMPEHRE)
# add source file
set(SRC_SCHED
${SRC_SCHED}
src/CMeasureNull.cpp
)
# add define
add_definitions(-DSCHED_MEASURE_NULL)
message("${BoldCyan}Use no measurement${ColourReset}")
endif (MEASURE_AMPEHRE)
# EXECUTABLES
# main executable
add_executable(sched ${SRC_MAINSCHED} ${SRC_SCHED} "src/sched.cpp")
target_link_libraries(sched ${YAML_LIBRARY} ${CJSON_LIBRARY} ${LOG4CPP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
# simulation executable
add_executable(simsched ${SRC_SCHED} ${SRC_SIMSCHED} "src/simsched.cpp")
target_link_libraries(simsched ${YAML_LIBRARY} ${CJSON_LIBRARY} ${LOG4CPP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
# wrap executable
add_executable(wrap ${SRC_SCHED} ${SRC_WRAP} "src/wrap.cpp")
target_link_libraries(wrap ${YAML_LIBRARY} ${CJSON_LIBRARY} ${LOG4CPP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
add_subdirectory(scripts)
install(TARGETS sched RUNTIME DESTINATION bin)
install(TARGETS simsched RUNTIME DESTINATION bin)
install(TARGETS wrap RUNTIME DESTINATION bin)