-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
125 lines (93 loc) · 2.96 KB
/
meson.build
File metadata and controls
125 lines (93 loc) · 2.96 KB
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
project('TaskR', [ 'cpp', 'c'],
subproject_dir : 'extern',
default_options : [
'cpp_std=c++17',
'buildtype=release'
],
version: '1.0.0'
)
####### Storage for TaskR dependencies
taskrDependencies = [ ]
####### Getting HiCR dependency (only if not a subproject)
if meson.is_subproject() == false
HiCRBackends = [ ]
if get_option('buildExamples') or get_option('buildTests')
# Selecting default HiCR Backends
HiCRBackends = ['hwloc']
if 'boost' in get_option('executionStateType')
HiCRBackends += ['boost']
endif
if 'nosv' in get_option('executionStateType')
HiCRBackends += ['nosv']
endif
if 'pthreads' in get_option('processingUnitType')
HiCRBackends += ['pthreads']
endif
if 'nosv' in get_option('processingUnitType')
if 'nosv' not in HiCRBackends
HiCRBackends += ['nosv']
endif
endif
endif
# Getting selected distributed engine
distributedEngines = get_option('distributedEngines')
# If, selected, adding the dependency for the distributed engine
foreach engine : distributedEngines
if engine != 'none' and engine not in HiCRBackends
HiCRBackends += engine
endif
endforeach
HiCRProject = subproject('HiCR', required: true, default_options: [ 'backends=' + ','.join(HiCRBackends), 'frontends=tasking' ])
HiCRBuildDep = HiCRProject.get_variable('hicrBuildDep')
taskrDependencies += HiCRBuildDep
endif
####### Creating TaskR dependency
# Warning handling option
warningAsErrorFlags=[]
if get_option('compileWarningsAsErrors') == true
warningAsErrorFlags=[ '-Werror' ]
endif
TaskRBuildCppArgs = [
'-Wfatal-errors',
warningAsErrorFlags
]
TaskRBuildIncludes = include_directories([
'include'
])
####### Build Instrumentation using TraCR
if get_option('buildInstrumentation')
InstrumentationProject = subproject('tracr', required: true)
InstrumentationBuildDep = InstrumentationProject.get_variable('InstrumentationBuildDep')
taskrDependencies += InstrumentationBuildDep
add_project_arguments('-DENABLE_INSTRUMENTATION', language: 'cpp')
# uncomment this to enable debug prints of TraCR
# add_project_arguments('-DENABLE_DEBUG', language: 'cpp')
endif
####### Collect the dependencies
TaskRBuildDep = declare_dependency(
compile_args: TaskRBuildCppArgs,
include_directories: TaskRBuildIncludes,
dependencies: taskrDependencies
)
####### Build PyTaskR
if get_option('buildPyTaskR')
missing = []
foreach r : ['boost', 'pthreads', 'nosv']
if not (r in HiCRBackends)
missing += r
endif
endforeach
assert(missing.length() == 0, 'Missing required backends for pyTaskr: ' + ', '.join(missing))
subdir('include/pytaskr')
endif
####### Build test / example targets only if TaskR is being loaded as a subproject
if meson.is_subproject() == false
# Build example targets
if get_option('buildExamples')
subdir('examples')
endif
# Build test targets
if get_option('buildTests')
subdir('tests')
endif
endif