-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
772 lines (676 loc) · 53.8 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
# ---------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------- CMAKE PROJECT
# ---------------------------------------------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0054 NEW)
if(${CMAKE_VERSION} VERSION_EQUAL "3.14" OR ${CMAKE_VERSION} VERSION_GREATER "3.14")
cmake_policy(SET CMP0083 NEW)
endif()
project(aff3ct-core CXX)
# ---------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------- CMAKE OPTIONS
# ---------------------------------------------------------------------------------------------------------------------
option(AFF3CT_CORE_COMPILE_STATIC_LIB "Compile the static library" ON )
option(AFF3CT_CORE_COMPILE_SHARED_LIB "Compile the shared library" OFF)
option(AFF3CT_CORE_LINK_HWLOC "Link with the hwloc library (used for threads pinning)" OFF)
option(AFF3CT_CORE_COLORS "Enable the colors in the terminal" ON )
option(AFF3CT_CORE_TESTS "Enable the compilation of the tests" ON )
option(AFF3CT_CORE_STACKTRACE "Print the stack trace when an exception is raised" ON )
option(AFF3CT_CORE_STACKTRACE_SEGFAULT "Try to print the stack trace when a segfault occurs" OFF)
option(AFF3CT_CORE_SHOW_DEPRECATED "Print message each time a deprecated func. is called" OFF)
option(AFF3CT_CORE_FAST "Remove checks to speedup the code" OFF)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND NOT AFF3CT_CORE_OVERRIDE_VERSION)
message(FATAL_ERROR "The '.git' folder can't be found, AFF3CT_CORE can't be compiled if it is not cloned "
"from a Git repository. Please do not download archives from GitHub and make a Git "
"clone instead (git clone https://github.com/aff3ct-core/aff3ct-core.git).")
endif()
# ---------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------- CMAKE CONFIGURATION
# ---------------------------------------------------------------------------------------------------------------------
# set CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_INCLUDEDIR and CMAKE_INSTALL_DATAROOTDIR variables
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_MACOSX_RPATH 1)
# Enable C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Specify bin and lib paths
set(EXECUTABLE_OUTPUT_PATH bin/)
set(LIBRARY_OUTPUT_PATH lib/)
# Generate the source files list
file(GLOB_RECURSE source_files ${CMAKE_CURRENT_SOURCE_DIR}/src/*)
# ---------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------ CREATE FILTERS
# ---------------------------------------------------------------------------------------------------------------------
# Filters creation for IDEs (tested on Visual Studio and based on the "source_group" function)
function(assign_source_group)
foreach(_source IN ITEMS ${ARGN})
if(IS_ABSOLUTE "${_source}")
file(RELATIVE_PATH _source_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source}")
else()
set(source_rel "${_source}")
endif()
get_filename_component(_source_path "${_source_rel}" PATH)
string(REPLACE "/" "\\" _source_path_msvc "${_source_path}")
source_group("${_source_path_msvc}" FILES "${_source}")
endforeach()
endfunction(assign_source_group)
assign_source_group(${source_files})
# ---------------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------- OBJECTS/LIBS/EXE
# ---------------------------------------------------------------------------------------------------------------------
if(${CMAKE_VERSION} VERSION_EQUAL "3.14" OR ${CMAKE_VERSION} VERSION_GREATER "3.14")
include(CheckPIESupported)
check_pie_supported()
endif()
add_library(aff3ct-core-obj OBJECT ${source_files})
set_target_properties(aff3ct-core-obj PROPERTIES
POSITION_INDEPENDENT_CODE ON) # set -fpic
list(APPEND aff3ct_core_targets_list aff3ct-core-obj)
# Library
if(AFF3CT_CORE_COMPILE_SHARED_LIB)
add_library(aff3ct-core-shared-lib SHARED $<TARGET_OBJECTS:aff3ct-core-obj>)
set_target_properties(aff3ct-core-shared-lib PROPERTIES
OUTPUT_NAME aff3ct-core
POSITION_INDEPENDENT_CODE ON) # set -fpic
list(APPEND aff3ct_core_targets_list aff3ct-core-shared-lib)
message(STATUS "AFF3CT-core - Compile: shared library")
endif(AFF3CT_CORE_COMPILE_SHARED_LIB)
if(AFF3CT_CORE_COMPILE_STATIC_LIB)
add_library(aff3ct-core-static-lib STATIC $<TARGET_OBJECTS:aff3ct-core-obj>)
set_target_properties(aff3ct-core-static-lib PROPERTIES
OUTPUT_NAME aff3ct-core
POSITION_INDEPENDENT_CODE ON) # set -fpic
list(APPEND aff3ct_core_targets_list aff3ct-core-static-lib)
message(STATUS "AFF3CT-core - Compile: static library")
endif(AFF3CT_CORE_COMPILE_STATIC_LIB)
if(AFF3CT_CORE_STACKTRACE_SEGFAULT AND CPPTRACE_UNWIND_WITH_LIBUNWIND)
add_executable(aff3ct-core-signal-tracer ${CMAKE_CURRENT_SOURCE_DIR}/signal_tracer/main.cpp)
set_target_properties(aff3ct-core-signal-tracer PROPERTIES
OUTPUT_NAME aff3ct-core-signal-tracer
POSITION_INDEPENDENT_CODE ON) # set -fpie
endif()
# Tests
if(AFF3CT_CORE_TESTS)
add_executable(aff3ct-core-test-simple-chain $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/simple_chain.cpp)
set_target_properties(aff3ct-core-test-simple-chain PROPERTIES
OUTPUT_NAME test-simple-chain
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-simple-chain)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-simple-chain)
add_executable(aff3ct-core-test-simple-chain-fwd $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/simple_chain_fwd.cpp)
set_target_properties(aff3ct-core-test-simple-chain-fwd PROPERTIES
OUTPUT_NAME test-simple-chain-fwd
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-simple-chain-fwd)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-simple-chain-fwd)
add_executable(aff3ct-core-test-simple-chain-hybrid $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/simple_chain_hybrid.cpp)
set_target_properties(aff3ct-core-test-simple-chain-hybrid PROPERTIES
OUTPUT_NAME test-simple-chain-hybrid
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-simple-chain-hybrid)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-simple-chain-hybrid)
add_executable(aff3ct-core-test-for-loop $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/for_loop.cpp)
set_target_properties(aff3ct-core-test-for-loop PROPERTIES
OUTPUT_NAME test-for-loop
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-for-loop)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-for-loop)
add_executable(aff3ct-core-test-do-while-loop $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/do_while_loop.cpp)
set_target_properties(aff3ct-core-test-do-while-loop PROPERTIES
OUTPUT_NAME test-do-while-loop
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-do-while-loop)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-do-while-loop)
add_executable(aff3ct-core-test-exclusive-paths $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/exclusive_paths.cpp)
set_target_properties(aff3ct-core-test-exclusive-paths PROPERTIES
OUTPUT_NAME test-exclusive-paths
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-exclusive-paths)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-exclusive-paths)
add_executable(aff3ct-core-test-nested-loops $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/nested_loops.cpp)
set_target_properties(aff3ct-core-test-nested-loops PROPERTIES
OUTPUT_NAME test-nested-loops
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-nested-loops)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-nested-loops)
add_executable(aff3ct-core-test-nested-do-while-loops $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/nested_do_while_loops.cpp)
set_target_properties(aff3ct-core-test-nested-do-while-loops PROPERTIES
OUTPUT_NAME test-nested-do-while-loops
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_tests_list aff3ct-core-test-nested-do-while-loops)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-nested-do-while-loops)
add_executable(aff3ct-core-test-simple-pipeline $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/bootstrap/simple_pipeline.cpp)
set_target_properties(aff3ct-core-test-simple-pipeline PROPERTIES
OUTPUT_NAME test-simple-pipeline
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_targets_list aff3ct-core-test-simple-pipeline)
add_executable(aff3ct-core-test-pipeline-probe $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/advanced/pipeline_probe.cpp)
set_target_properties(aff3ct-core-test-pipeline-probe PROPERTIES
OUTPUT_NAME test-pipeline-probe
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_targets_list aff3ct-core-test-pipeline-probe)
add_executable(aff3ct-core-test-complex-pipeline-inter-stage $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/advanced/complex_pipeline_inter_stage.cpp)
set_target_properties(aff3ct-core-test-complex-pipeline-inter-stage PROPERTIES
OUTPUT_NAME test-complex-pipeline-inter-stage
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_targets_list aff3ct-core-test-complex-pipeline-inter-stage)
add_executable(aff3ct-core-test-pipeline-double-chain $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/advanced/pipeline_double_chain.cpp)
set_target_properties(aff3ct-core-test-pipeline-double-chain PROPERTIES
OUTPUT_NAME test-pipeline-double-chain
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_targets_list aff3ct-core-test-pipeline-double-chain)
add_executable(aff3ct-core-test-complex-pipeline-full-fwd $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/advanced/complex_pipeline_full_fwd.cpp)
set_target_properties(aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES
OUTPUT_NAME test-complex-pipeline-full-fwd
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_targets_list aff3ct-core-test-complex-pipeline-full-fwd)
add_executable(aff3ct-core-test-complex-pipeline-mix-fwd $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/advanced/complex_pipeline_mix_fwd.cpp)
set_target_properties(aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES
OUTPUT_NAME test-complex-pipeline-mix-fwd
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_targets_list aff3ct-core-test-complex-pipeline-mix-fwd)
add_executable(aff3ct-core-test-generic-pipeline $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/advanced/generic_pipeline.cpp)
set_target_properties(aff3ct-core-test-generic-pipeline PROPERTIES
OUTPUT_NAME test-generic-pipeline
POSITION_INDEPENDENT_CODE ON) # set -fpie
list(APPEND aff3ct_core_targets_list aff3ct-core-test-generic-pipeline)
add_executable(aff3ct-core-test-exclusive-paths-pipeline $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/ctrl_flow/exclusive_paths_pipeline.cpp)
set_target_properties(aff3ct-core-test-exclusive-paths-pipeline PROPERTIES
OUTPUT_NAME test-exclusive-paths-pipeline
POSITION_INDEPENDENT_CODE ON) # set -fpie
#list(APPEND aff3ct_core_tests_list aff3ct-core-test-nest-loops-pipeline)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-exclusive-paths-pipeline)
add_executable(aff3ct-core-test-nest-loops-pipeline $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/ctrl_flow/nested_loops_pipeline.cpp)
set_target_properties(aff3ct-core-test-nest-loops-pipeline PROPERTIES
OUTPUT_NAME test-nested-loops-pipeline
POSITION_INDEPENDENT_CODE ON) # set -fpie
# list(APPEND aff3ct_core_tests_list aff3ct-core-test-nest-loops-pipeline)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-nest-loops-pipeline)
if (AFF3CT_CORE_LINK_HWLOC)
#Pin test addition
add_executable(aff3ct-core-test-thread-pinning $<TARGET_OBJECTS:aff3ct-core-obj>
${CMAKE_CURRENT_SOURCE_DIR}/tests/advanced/thread_pinning.cpp)
set_target_properties(aff3ct-core-test-thread-pinning PROPERTIES
OUTPUT_NAME test-thread-pinning
POSITION_INDEPENDENT_CODE ON) # set -fpie
#list(APPEND aff3ct_core_tests_list aff3ct-core-test-nest-loops-pipeline)
list(APPEND aff3ct_core_targets_list aff3ct-core-test-thread-pinning)
endif (AFF3CT_CORE_LINK_HWLOC)
endif()
# ---------------------------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------- SUB-PROJECTS
# ---------------------------------------------------------------------------------------------------------------------
# cpptrace
if (AFF3CT_CORE_STACKTRACE OR AFF3CT_CORE_STACKTRACE_SEGFAULT)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/cpptrace/include/cpptrace/cpptrace.hpp")
option(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF "" OFF)
option(CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE "" ON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/cpptrace/)
else()
message(FATAL_ERROR "'cpptrace' can't be found, try to init the submodule with the following cmd:\n"
"$ git submodule update --init -- ../lib/cpptrace/")
endif()
endif()
# ---------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------ COMPILER DEFINITIONS
# ---------------------------------------------------------------------------------------------------------------------
macro(aff3ct_core_target_compile_definitions targets privacy def)
foreach(_target IN ITEMS ${targets})
target_compile_definitions(${_target} ${privacy} $<BUILD_INTERFACE:${def}> $<INSTALL_INTERFACE:${def}>)
endforeach()
endmacro()
# by system
if(WIN32) # for Windows operating system in general
set(WINDOWS_VISTA 0x0600)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC _WIN32_WINNT=${WINDOWS_VISTA})
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC NOMINMAX)
message(STATUS "AFF3CT-core - System: Windows")
elseif(APPLE) # for macOS
message(STATUS "AFF3CT-core - System: macOS")
elseif(UNIX AND NOT APPLE) # for Linux, BSD, Solaris, Minix
message(STATUS "AFF3CT-core - System: Unix/Linux")
endif()
# common
if(AFF3CT_CORE_COLORS)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC AFF3CT_CORE_COLORS)
message(STATUS "AFF3CT-core - Terminal colors: on")
else()
message(STATUS "AFF3CT-core - Terminal colors: off")
endif()
if(AFF3CT_CORE_STACKTRACE)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC AFF3CT_CORE_STACKTRACE)
message(STATUS "AFF3CT-core - Stacktrace: on")
else()
message(STATUS "AFF3CT-core - Stacktrace: off")
endif()
if (AFF3CT_CORE_STACKTRACE_SEGFAULT)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC AFF3CT_CORE_STACKTRACE_SEGFAULT)
if(CPPTRACE_UNWIND_WITH_LIBUNWIND)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC AFF3CT_CORE_STACKTRACE_SEGFAULT_LIBUNWIND)
if(AFF3CT_CORE_COLORS)
target_compile_definitions(aff3ct-core-signal-tracer PRIVATE AFF3CT_CORE_COLORS)
endif()
message(STATUS "AFF3CT-core - Stacktrace segfault: on [with libunwind -> experimental]")
else()
message(STATUS "AFF3CT-core - Stacktrace segfault: on [unsafe method]")
endif(CPPTRACE_UNWIND_WITH_LIBUNWIND)
else()
message(STATUS "AFF3CT-core - Stacktrace segfault: off")
endif()
if(AFF3CT_CORE_SHOW_DEPRECATED)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC AFF3CT_CORE_SHOW_DEPRECATED)
message(STATUS "AFF3CT-core - Show deprecated: on")
else()
message(STATUS "AFF3CT-core - Show deprecated: off")
endif()
if(AFF3CT_CORE_FAST)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC AFF3CT_CORE_FAST)
message(STATUS "AFF3CT-core - Fast: on")
else()
message(STATUS "AFF3CT-core - Fast: off")
endif()
# ---------------------------------------------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------- HEADER ONLY LIBRARIES
# ---------------------------------------------------------------------------------------------------------------------
macro(aff3ct_core_target_include_directories targets privacy dir_build dir_install)
foreach(_target IN ITEMS ${targets})
target_include_directories(${_target}
${privacy}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${dir_build}/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-core/${dir_install}>)
endforeach()
endmacro()
macro(aff3ct_core_target_include_directories2 targets privacy dir)
foreach(_target IN ITEMS ${targets})
target_include_directories(${_target} ${privacy} $<BUILD_INTERFACE:${dir}> $<INSTALL_INTERFACE:${dir}>)
endforeach()
endmacro()
# AFF3CT_CORE headers
aff3ct_core_target_include_directories("${aff3ct_core_targets_list}" PRIVATE "src" "aff3ct-core")
aff3ct_core_target_include_directories("${aff3ct_core_targets_list}" PUBLIC "include" "aff3ct-core")
# rang
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/rang/include/rang.hpp")
aff3ct_core_target_include_directories("${aff3ct_core_targets_list}" PUBLIC "lib/rang/include" "rang")
message(STATUS "AFF3CT-core - Header found: rang")
else()
message(FATAL_ERROR "AFF3CT-core - rang can't be found, try to init the submodule with the following cmd:\n"
"$ git submodule update --init -- ../lib/rang/")
endif()
# ---------------------------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------- COMPILED LIBRARIES
# ---------------------------------------------------------------------------------------------------------------------
macro(aff3ct_core_target_link_libraries targets privacy lib)
foreach(_target IN ITEMS ${targets})
target_link_libraries(${_target} ${privacy} ${lib})
endforeach()
endmacro()
# hwloc
if(AFF3CT_CORE_LINK_HWLOC)
aff3ct_core_target_compile_definitions("${aff3ct_core_targets_list}" PUBLIC "AFF3CT_CORE_HWLOC")
find_package(Hwloc REQUIRED QUIET)
if(Hwloc_FOUND)
message(STATUS "AFF3CT-core - Library found: hwloc")
aff3ct_core_target_include_directories2("${aff3ct_core_targets_list}" PUBLIC "${Hwloc_INCLUDE_DIRS}")
aff3ct_core_target_link_libraries("${aff3ct_core_targets_list}" PUBLIC "${Hwloc_LIBRARIES}")
endif(Hwloc_FOUND)
endif(AFF3CT_CORE_LINK_HWLOC)
# cpptrace
if(AFF3CT_CORE_STACKTRACE OR AFF3CT_CORE_STACKTRACE_SEGFAULT)
aff3ct_core_target_link_libraries("${aff3ct_core_targets_list}" PUBLIC "cpptrace::cpptrace")
if(AFF3CT_CORE_STACKTRACE_SEGFAULT AND CPPTRACE_UNWIND_WITH_LIBUNWIND)
target_link_libraries(aff3ct-core-signal-tracer PRIVATE "cpptrace::cpptrace")
endif()
endif()
# Threads
set(CMAKE_THREAD_PREFER_PTHREAD ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
aff3ct_core_target_link_libraries("${aff3ct_core_targets_list}" PUBLIC Threads::Threads)
# ---------------------------------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------------------------- EXPORT
# ---------------------------------------------------------------------------------------------------------------------
if(AFF3CT_CORE_STACKTRACE OR AFF3CT_CORE_STACKTRACE_SEGFAULT)
set(CPPTRACE_TARGETS cpptrace-lib)
if (CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF)
set(CPPTRACE_TARGETS ${CPPTRACE_TARGETS} dwarf)
endif()
else()
set(CPPTRACE_TARGETS)
endif()
if (AFF3CT_CORE_COMPILE_SHARED_LIB AND NOT AFF3CT_CORE_COMPILE_STATIC_LIB)
export(TARGETS aff3ct-core-shared-lib ${CPPTRACE_TARGETS}
NAMESPACE aff3ct-core::
FILE "lib/cmake/aff3ct-core/aff3ct-core-config.cmake")
endif()
if (AFF3CT_CORE_COMPILE_STATIC_LIB AND NOT AFF3CT_CORE_COMPILE_SHARED_LIB)
export(TARGETS aff3ct-core-static-lib ${CPPTRACE_TARGETS}
NAMESPACE aff3ct-core::
FILE "lib/cmake/aff3ct-core/aff3ct-core-config.cmake")
endif()
if(AFF3CT_CORE_COMPILE_SHARED_LIB AND AFF3CT_CORE_COMPILE_STATIC_LIB)
export(TARGETS aff3ct-core-shared-lib aff3ct-core-static-lib ${CPPTRACE_TARGETS}
NAMESPACE aff3ct-core::
FILE "lib/cmake/aff3ct-core/aff3ct-core-config.cmake")
endif()
# ---------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------- INSTALL
# ---------------------------------------------------------------------------------------------------------------------
if(AFF3CT_CORE_COMPILE_SHARED_LIB)
if(WIN32)
install(TARGETS aff3ct-core-shared-lib
EXPORT aff3ct-core-config
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/
COMPONENT library)
else()
install(TARGETS aff3ct-core-shared-lib
EXPORT aff3ct-core-config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/
COMPONENT library)
endif()
endif()
if(AFF3CT_CORE_COMPILE_STATIC_LIB)
install(TARGETS aff3ct-core-static-lib
EXPORT aff3ct-core-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/
COMPONENT library)
endif()
if (AFF3CT_CORE_COMPILE_SHARED_LIB OR AFF3CT_CORE_COMPILE_STATIC_LIB)
install(EXPORT
aff3ct-core-config
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/aff3ct-core/"
NAMESPACE aff3ct-core::
COMPONENT library)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-core/aff3ct-core
COMPONENT headers
FILES_MATCHING PATTERN "*.h")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-core/aff3ct-core
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-core/aff3ct-core
COMPONENT headers
FILES_MATCHING PATTERN "*.hxx")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib/rang/include/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-core/rang
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp")
if(AFF3CT_CORE_STACKTRACE OR AFF3CT_CORE_STACKTRACE_SEGFAULT)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib/cpptrace/include/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aff3ct-core/cpptrace
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp")
endif()
endif()
# ---------------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------- TEST
# ---------------------------------------------------------------------------------------------------------------------
if(AFF3CT_CORE_TESTS)
find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full")
include(CTest)
enable_testing()
macro(aff3ct_core_run_1t_tests targets)
foreach(_target IN ITEMS ${targets})
add_test(NAME run-1t::${_target} COMMAND ${_target} -d 2048 -s 5 -e 10 -t 1)
set_tests_properties(run-1t::${_target} PROPERTIES LABELS run-1t)
endforeach()
endmacro()
aff3ct_core_run_1t_tests("${aff3ct_core_tests_list}")
macro(aff3ct_core_run_tests targets)
foreach(_target IN ITEMS ${targets})
add_test(NAME run::${_target} COMMAND ${_target} -d 2048 -s 5 -e 100)
set_tests_properties(run::${_target} PROPERTIES LABELS run)
endforeach()
endmacro()
aff3ct_core_run_tests("${aff3ct_core_tests_list}")
macro(aff3ct_core_inter_frames_tests targets)
foreach(_target IN ITEMS ${targets})
add_test(NAME inter-frames::${_target} COMMAND ${_target} -d 2048 -s 5 -e 10 -f 13)
set_tests_properties(inter-frames::${_target} PROPERTIES LABELS inter-frames)
endforeach()
endmacro()
aff3ct_core_inter_frames_tests("${aff3ct_core_tests_list}")
macro(aff3ct_core_step_by_step_tests targets)
foreach(_target IN ITEMS ${targets})
add_test(NAME step-by-step::${_target} COMMAND ${_target} -d 2048 -s 5 -e 11 -f 13 -b)
set_tests_properties(step-by-step::${_target} PROPERTIES LABELS step-by-step)
endforeach()
endmacro()
aff3ct_core_step_by_step_tests("${aff3ct_core_tests_list}")
macro(aff3ct_core_copy_mode_tests targets)
foreach(_target IN ITEMS ${targets})
add_test(NAME copy-mode::${_target} COMMAND ${_target} -d 2048 -s 5 -e 15 -f 13 -c)
set_tests_properties(copy-mode::${_target} PROPERTIES LABELS copy-mode)
endforeach()
endmacro()
aff3ct_core_copy_mode_tests("${aff3ct_core_tests_list}")
macro(aff3ct_core_graph_dot_tests targets)
foreach(_target IN ITEMS ${targets})
add_test(NAME graph-dot::${_target} COMMAND ${_target} -d 2048 -s 5 -e 15 -f 13 -o graph.dot)
set_tests_properties(graph-dot::${_target} PROPERTIES LABELS graph-dot)
endforeach()
endmacro()
aff3ct_core_graph_dot_tests("${aff3ct_core_tests_list}")
set(INPUT_FILE "../mkdocs.yml")
add_test(NAME subseq0::aff3ct-core-test-simple-chain COMMAND aff3ct-core-test-simple-chain -d 2048 -s 5 -e 15 -f 13 -u)
set_tests_properties(subseq0::aff3ct-core-test-simple-chain PROPERTIES LABELS subseq)
add_test(NAME subseq1::aff3ct-core-test-simple-chain COMMAND aff3ct-core-test-simple-chain -d 2048 -s 5 -v)
set_tests_properties(subseq1::aff3ct-core-test-simple-chain PROPERTIES LABELS subseq)
add_test(NAME path0::aff3ct-core-test-exclusive-paths COMMAND aff3ct-core-test-exclusive-paths -d 2048 -s 5 -e 10 -f 13 -a 0)
set_tests_properties(path0::aff3ct-core-test-exclusive-paths PROPERTIES LABELS exclusive-paths)
add_test(NAME path1::aff3ct-core-test-exclusive-paths COMMAND aff3ct-core-test-exclusive-paths -d 2048 -s 5 -e 10 -f 13 -a 1)
set_tests_properties(path1::aff3ct-core-test-exclusive-paths PROPERTIES LABELS exclusive-paths)
add_test(NAME path2::aff3ct-core-test-exclusive-paths COMMAND aff3ct-core-test-exclusive-paths -d 2048 -s 5 -e 10 -f 13 -a 2)
set_tests_properties(path2::aff3ct-core-test-exclusive-paths PROPERTIES LABELS exclusive-paths)
add_test(NAME cyclic::aff3ct-core-test-exclusive-paths COMMAND aff3ct-core-test-exclusive-paths -d 2048 -s 5 -e 10 -f 13 -y)
set_tests_properties(cyclic::aff3ct-core-test-exclusive-paths PROPERTIES LABELS exclusive-paths)
add_test(NAME sequence0::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -q -t 1 -i ${INPUT_FILE})
set_tests_properties(sequence0::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME sequence1::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -q -t 1 -i ${INPUT_FILE} -p -g)
set_tests_properties(sequence1::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME sequence2::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -q -t 1 -i ${INPUT_FILE} -b)
set_tests_properties(sequence2::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME sequence3::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -q -t 1 -i ${INPUT_FILE} -o graph.dot)
set_tests_properties(sequence3::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME sequence4::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -q -t 1 -i ${INPUT_FILE} -f 2)
set_tests_properties(sequence4::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME sequence5::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -q -t 1 -i ${INPUT_FILE} -f 13)
set_tests_properties(sequence5::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME pipeline0::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE})
set_tests_properties(pipeline0::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME pipeline1::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE} -p)
set_tests_properties(pipeline1::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME pipeline2::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE} -w)
set_tests_properties(pipeline2::aff3ct-core-test-simple-pipeline PROPERTIES LABELS "simple-pipeline;skip-memcheck") # to exclude this previous test from memchecks, active waiting is too long in Valgrind :-(
add_test(NAME pipeline3::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE} -u 1)
set_tests_properties(pipeline3::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME pipeline4::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE} -u 1024)
set_tests_properties(pipeline4::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME pipeline5::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE} -u 128 -o graph.dot)
set_tests_properties(pipeline5::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME pipeline6::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE} -u 8 -f 2)
set_tests_properties(pipeline6::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
add_test(NAME pipeline7::aff3ct-core-test-simple-pipeline COMMAND aff3ct-core-test-simple-pipeline -i ${INPUT_FILE} -u 17 -f 5)
set_tests_properties(pipeline7::aff3ct-core-test-simple-pipeline PROPERTIES LABELS simple-pipeline)
# probes
add_test(NAME sequence0::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -q -t 1 -i ${INPUT_FILE})
set_tests_properties(sequence0::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME sequence1::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -q -t 1 -i ${INPUT_FILE} -p -g)
set_tests_properties(sequence1::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME sequence2::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -q -t 1 -i ${INPUT_FILE} -b)
set_tests_properties(sequence2::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME sequence3::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -q -t 1 -i ${INPUT_FILE} -o graph.dot)
set_tests_properties(sequence3::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME sequence4::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -q -t 1 -i ${INPUT_FILE} -f 2)
set_tests_properties(sequence4::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME sequence5::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -q -t 1 -i ${INPUT_FILE} -f 13)
set_tests_properties(sequence5::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME pipeline0::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE})
set_tests_properties(pipeline0::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME pipeline1::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE} -p)
set_tests_properties(pipeline1::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME pipeline2::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE} -w)
set_tests_properties(pipeline2::aff3ct-core-test-pipeline-probe PROPERTIES LABELS "pipeline-probe;skip-memcheck") # to exclude this previous test from memchecks, active waiting is too long in Valgrind :-(
add_test(NAME pipeline3::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE} -u 1)
set_tests_properties(pipeline3::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME pipeline4::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE} -u 1024)
set_tests_properties(pipeline4::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME pipeline5::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE} -u 128 -o graph.dot)
set_tests_properties(pipeline5::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME pipeline6::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE} -u 8 -f 2)
set_tests_properties(pipeline6::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
add_test(NAME pipeline7::aff3ct-core-test-pipeline-probe COMMAND aff3ct-core-test-pipeline-probe -i ${INPUT_FILE} -u 17 -f 5)
set_tests_properties(pipeline7::aff3ct-core-test-pipeline-probe PROPERTIES LABELS pipeline-probe)
# complex pipeline interstage
add_test(NAME pipeline0::aff3ct-core-test-complex-pipeline-inter-stage COMMAND aff3ct-core-test-complex-pipeline-inter-stage -i ${INPUT_FILE})
set_tests_properties(pipeline0::aff3ct-core-test-complex-pipeline-inter-stage PROPERTIES LABELS complex-pipeline-inter-stage)
add_test(NAME pipeline1::aff3ct-core-test-complex-pipeline-inter-stage COMMAND aff3ct-core-test-complex-pipeline-inter-stage -q -t 1 -i ${INPUT_FILE} -p -g)
set_tests_properties(pipeline1::aff3ct-core-test-complex-pipeline-inter-stage PROPERTIES LABELS complex-pipeline-inter-stage)
add_test(NAME pipeline2::aff3ct-core-test-complex-pipeline-inter-stage COMMAND aff3ct-core-test-complex-pipeline-inter-stage -i ${INPUT_FILE} -u 1)
set_tests_properties(pipeline2::aff3ct-core-test-complex-pipeline-inter-stage PROPERTIES LABELS complex-pipeline-inter-stage)
# pipeline double-chain
add_test(NAME sequence0::aff3ct-core-test-pipeline-double-chain COMMAND aff3ct-core-test-pipeline-double-chain -e 30 -q -t 1)
set_tests_properties(sequence0::aff3ct-core-test-pipeline-double-chain PROPERTIES LABELS pipeline-double-chain)
add_test(NAME sequence1::aff3ct-core-test-pipeline-double-chain COMMAND aff3ct-core-test-pipeline-double-chain -e 19 -q -t 3)
set_tests_properties(sequence1::aff3ct-core-test-pipeline-double-chain PROPERTIES LABELS pipeline-double-chain)
add_test(NAME sequence2::aff3ct-core-test-pipeline-double-chain COMMAND aff3ct-core-test-pipeline-double-chain -e 19 -q -t 3 -f 7)
set_tests_properties(sequence2::aff3ct-core-test-pipeline-double-chain PROPERTIES LABELS pipeline-double-chain)
add_test(NAME sequence3::aff3ct-core-test-pipeline-double-chain COMMAND aff3ct-core-test-pipeline-double-chain -e 19 -q -t 3 -f 7 -b)
set_tests_properties(sequence3::aff3ct-core-test-pipeline-double-chain PROPERTIES LABELS pipeline-double-chain)
add_test(NAME pipeline0::aff3ct-core-test-pipeline-double-chain COMMAND aff3ct-core-test-pipeline-double-chain -e 30)
set_tests_properties(pipeline0::aff3ct-core-test-pipeline-double-chain PROPERTIES LABELS pipeline-double-chain)
add_test(NAME pipeline1::aff3ct-core-test-pipeline-double-chain COMMAND aff3ct-core-test-pipeline-double-chain -e 115 -u 1024)
set_tests_properties(pipeline1::aff3ct-core-test-pipeline-double-chain PROPERTIES LABELS pipeline-double-chain)
add_test(NAME pipeline2::aff3ct-core-test-pipeline-double-chain COMMAND aff3ct-core-test-pipeline-double-chain -e 10 -u 15 -f 3)
set_tests_properties(pipeline2::aff3ct-core-test-pipeline-double-chain PROPERTIES LABELS pipeline-double-chain)
# complex pipeline fwd
add_test(NAME sequence0::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 100 -q -t 1)
set_tests_properties(sequence0::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME sequence1::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 100 -q)
set_tests_properties(sequence1::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME sequence2::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 100 -q -b -o graph.dot)
set_tests_properties(sequence2::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME sequence3::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 100 -q -b -f 5 -t 3)
set_tests_properties(sequence3::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME pipeline0::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 10 -t 1)
set_tests_properties(pipeline0::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME pipeline1::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 10)
set_tests_properties(pipeline1::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME pipeline2::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 1000 -u 128 -o graph.dot)
set_tests_properties(pipeline2::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME pipeline3::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 1000 -u 49 -f 13)
set_tests_properties(pipeline3::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS complex-pipeline-full-fwd)
add_test(NAME pipeline4::aff3ct-core-test-complex-pipeline-full-fwd COMMAND aff3ct-core-test-complex-pipeline-full-fwd -e 1000 -u 413 -w)
set_tests_properties(pipeline4::aff3ct-core-test-complex-pipeline-full-fwd PROPERTIES LABELS "complex-pipeline-full-fwd;skip-memcheck") # to exclude this previous test from memchecks, active waiting is too long in Valgrind :-(
# complex mix pipeline (fwd + in-out)
add_test(NAME sequence0::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 100 -q -t 1)
set_tests_properties(sequence0::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME sequence1::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 100 -q)
set_tests_properties(sequence1::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME sequence2::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 100 -q -b -o graph.dot)
set_tests_properties(sequence2::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME sequence3::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 100 -q -f 5 -t 3)
set_tests_properties(sequence3::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME pipeline0::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 10 -t 1)
set_tests_properties(pipeline0::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME pipeline1::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 10)
set_tests_properties(pipeline1::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME pipeline2::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 1000 -u 128 -o graph.dot)
set_tests_properties(pipeline2::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME pipeline3::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 1000 -u 49 -f 13)
set_tests_properties(pipeline3::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS complex-pipeline-mix-fwd)
add_test(NAME pipeline4::aff3ct-core-test-complex-pipeline-mix-fwd COMMAND aff3ct-core-test-complex-pipeline-mix-fwd -e 1000 -u 413 -w)
set_tests_properties(pipeline4::aff3ct-core-test-complex-pipeline-mix-fwd PROPERTIES LABELS "complex-pipeline-mix-fwd;skip-memcheck") # to exclude this previous test from memchecks, active waiting is too long in Valgrind :-(
# simple sequence example
add_test(NAME sequence0::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SIO)" -q)
set_tests_properties(sequence0::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME sequence1::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SFWD)" -q -b)
set_tests_properties(sequence1::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME sequence2::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4)" -t "(3)" -r "((SFWD,SIO,SFWD,SIO))" -q)
set_tests_properties(sequence2::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME sequence3::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4,1,2)" -t "(3,1,3)" -r "((SFWD,SIO,SFWD,SIO),(SFWD),(SIO,SIO))" -q -b)
set_tests_properties(sequence3::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
# simple pipeline example
add_test(NAME pipeline0::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SIO)")
set_tests_properties(pipeline0::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
# simple pipeline FWD example
add_test(NAME pipeline1::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SFWD)")
set_tests_properties(pipeline1::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME pipeline2::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SFWD)" -p)
set_tests_properties(pipeline2::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME pipeline3::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SFWD)" -w)
set_tests_properties(pipeline3::aff3ct-core-test-generic-pipeline PROPERTIES LABELS "generic-pipeline;skip-memcheck") # to exclude this previous test from memchecks, active waiting is too long in Valgrind :-(
add_test(NAME pipeline4::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SFWD)" -u 1)
set_tests_properties(pipeline4::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME pipeline5::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(3)" -t "(3)" -R "(SFWD)" -u 1024)
set_tests_properties(pipeline5::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
# simple pipeline hybrid
add_test(NAME pipeline6::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4)" -t "(3)" -r "((SFWD,SIO,SFWD,SIO))")
set_tests_properties(pipeline6::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME pipeline7::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4)" -t "(3)" -r "((SFWD,SIO,SFWD,SIO))" -u 1024)
set_tests_properties(pipeline7::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
# pipeline multiple stages
add_test(NAME pipeline8::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4,1,2)" -t "(3,1,3)" -r "((SFWD,SIO,SFWD,SIO),(SFWD),(SIO,SIO))")
set_tests_properties(pipeline8::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME pipeline9::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4,1,2)" -t "(3,1,3)" -r "((SFWD,SIO,SFWD,SIO),(SFWD),(SIO,SIO))" -p)
set_tests_properties(pipeline9::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME pipeline10::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4,1,2)" -t "(3,1,3)" -r "((SFWD,SIO,SFWD,SIO),(SFWD),(SIO,SIO))" -w)
set_tests_properties(pipeline10::aff3ct-core-test-generic-pipeline PROPERTIES LABELS "generic-pipeline;skip-memcheck") # to exclude this previous test from memchecks, active waiting is too long in Valgrind :-(
add_test(NAME pipeline11::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4,1,2)" -t "(3,1,3)" -r "((SFWD,SIO,SFWD,SIO),(SFWD),(SIO,SIO))" -u 1)
set_tests_properties(pipeline11::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME pipeline12::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4,1,2)" -t "(3,1,3)" -r "((SFWD,SIO,SFWD,SIO),(SFWD),(SIO,SIO))" -u 1024)
set_tests_properties(pipeline12::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
# pipeline with socket type per stage
add_test(NAME pipeline13::aff3ct-core-test-generic-pipeline COMMAND aff3ct-core-test-generic-pipeline -i ${INPUT_FILE} -n "(4,1,2)" -t "(3,1,3)" -R "(SFWD,SIO,SFWD)")
set_tests_properties(pipeline13::aff3ct-core-test-generic-pipeline PROPERTIES LABELS generic-pipeline)
add_test(NAME sequence0::aff3ct-core-test-exclusive-paths-pipeline COMMAND aff3ct-core-test-exclusive-paths-pipeline -t 1 -q -i ${INPUT_FILE})
set_tests_properties(sequence0::aff3ct-core-test-exclusive-paths-pipeline PROPERTIES LABELS exclusive-paths-pipeline)
add_test(NAME sequence1::aff3ct-core-test-exclusive-paths-pipeline COMMAND aff3ct-core-test-exclusive-paths-pipeline -t 1 -u 13 -q -b -i ${INPUT_FILE})
set_tests_properties(sequence1::aff3ct-core-test-exclusive-paths-pipeline PROPERTIES LABELS exclusive-paths-pipeline)
add_test(NAME pipeline0::aff3ct-core-test-exclusive-paths-pipeline COMMAND aff3ct-core-test-exclusive-paths-pipeline -t 4 -u 1 -i ${INPUT_FILE})
set_tests_properties(pipeline0::aff3ct-core-test-exclusive-paths-pipeline PROPERTIES LABELS exclusive-paths-pipeline)
add_test(NAME pipeline1::aff3ct-core-test-exclusive-paths-pipeline COMMAND aff3ct-core-test-exclusive-paths-pipeline -t 1 -u 5 -i ${INPUT_FILE})
set_tests_properties(pipeline1::aff3ct-core-test-exclusive-paths-pipeline PROPERTIES LABELS exclusive-paths-pipeline)
add_test(NAME pipeline2::aff3ct-core-test-exclusive-paths-pipeline COMMAND aff3ct-core-test-exclusive-paths-pipeline -t 8 -u 15 -i ${INPUT_FILE})
set_tests_properties(pipeline2::aff3ct-core-test-exclusive-paths-pipeline PROPERTIES LABELS exclusive-paths-pipeline)
add_test(NAME sequence0::aff3ct-core-test-nest-loops-pipeline COMMAND aff3ct-core-test-nest-loops-pipeline -e 200 -f 2 -q)
set_tests_properties(sequence0::aff3ct-core-test-nest-loops-pipeline PROPERTIES LABELS nest-loops-pipeline)
add_test(NAME sequence1::aff3ct-core-test-nest-loops-pipeline COMMAND aff3ct-core-test-nest-loops-pipeline -e 200 -f 13 -q -b -t 12)
set_tests_properties(sequence1::aff3ct-core-test-nest-loops-pipeline PROPERTIES LABELS nest-loops-pipeline)
add_test(NAME pipeline0::aff3ct-core-test-nest-loops-pipeline COMMAND aff3ct-core-test-nest-loops-pipeline -e 10 -f 13 -i 10 -j 12 -t 8)
set_tests_properties(pipeline0::aff3ct-core-test-nest-loops-pipeline PROPERTIES LABELS nest-loops-pipeline)
add_test(NAME pipeline1::aff3ct-core-test-nest-loops-pipeline COMMAND aff3ct-core-test-nest-loops-pipeline -e 10 -a -i 5 -j 13 -t 1)
set_tests_properties(pipeline1::aff3ct-core-test-nest-loops-pipeline PROPERTIES LABELS nest-loops-pipeline)
add_test(NAME pipeline2::aff3ct-core-test-nest-loops-pipeline COMMAND aff3ct-core-test-nest-loops-pipeline -e 200 -i 5 -j 3 -t 2)
set_tests_properties(pipeline2::aff3ct-core-test-nest-loops-pipeline PROPERTIES LABELS nest-loops-pipeline)
add_test(NAME pipeline3::aff3ct-core-test-nest-loops-pipeline COMMAND aff3ct-core-test-nest-loops-pipeline -e 200 -f 13)
set_tests_properties(pipeline3::aff3ct-core-test-nest-loops-pipeline PROPERTIES LABELS nest-loops-pipeline)
if (AFF3CT_CORE_LINK_HWLOC)
# Static test to verify pinning (for CPUs with at least 4 hardware threads)
add_test(NAME pipeline0::aff3ct-core-test-thread-pinning COMMAND aff3ct-core-test-thread-pinning -e 30)
set_tests_properties(pipeline0::aff3ct-core-test-thread-pinning PROPERTIES LABELS thread-pinning)
add_test(NAME pipeline1::aff3ct-core-test-thread-pinning COMMAND aff3ct-core-test-thread-pinning -e 300 -f 5)
set_tests_properties(pipeline1::aff3ct-core-test-thread-pinning PROPERTIES LABELS thread-pinning)
endif (AFF3CT_CORE_LINK_HWLOC)
endif()