-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
121 lines (88 loc) · 3.17 KB
/
meson.build
File metadata and controls
121 lines (88 loc) · 3.17 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
project('DeployR', [ 'cpp', 'c'],
subproject_dir : 'extern',
default_options : [
'cpp_std=c++20',
'buildtype=release'
]
)
####### Storage for DeployR dependencies
deployrDependencies = [ ]
##### Getting selected distributed engines
engines = get_option('engines')
# If, selected, adding the dependency for the distributed engines
if 'local' in engines
DeployRDistributedCppFlag = '-D_DEPLOYR_DISTRIBUTED_ENGINE_LOCAL'
additionalHiCRBackends = [ ]
additionalHiCRFrontends = [ ]
endif
if 'mpi' in engines
DeployRDistributedCppFlag = '-D_DEPLOYR_DISTRIBUTED_ENGINE_MPI'
mpirunExecutable = find_program('mpirun', '/usr/bin/mpirun', '/usr/local/bin/mpirun', required : true)
additionalHiCRBackends = [ 'mpi' ]
additionalHiCRFrontends = [ ]
endif
if 'lpf' in engines
DeployRDistributedCppFlag = '-D_DEPLOYR_DISTRIBUTED_ENGINE_LPF'
additionalHiCRBackends = [ 'mpi', 'lpf' ]
additionalHiCRFrontends = [ ]
endif
if 'cloudr' in engines
mpirunExecutable = find_program('mpirun', '/usr/bin/mpirun', '/usr/local/bin/mpirun', required : true)
CloudRProject = subproject('cloudrRPC', required: true, default_options: [ ])
CloudRBuildDep = CloudRProject.get_variable('CloudRBuildDep')
deployrDependencies += CloudRBuildDep
DeployRDistributedCppFlag = '-D_DEPLOYR_DISTRIBUTED_ENGINE_CLOUDR'
CloudRHiCRBackends = CloudRProject.get_variable('CloudRHiCRBackends')
CloudRHiCRFrontends = CloudRProject.get_variable('CloudRHiCRFrontends')
additionalHiCRBackends = [ ] + CloudRHiCRBackends
additionalHiCRFrontends = [ ] + CloudRHiCRFrontends
endif
##### Adding HiCR Dependency
# Getting full list of backends and frontends
HiCRBackends = [] + additionalHiCRBackends
if 'hwloc' not in additionalHiCRBackends
HiCRBackends += 'hwloc'
endif
if 'pthreads' not in additionalHiCRBackends
HiCRBackends += 'pthreads'
endif
HiCRFrontends = [ ] + additionalHiCRFrontends
# Getting HiCR dependency
HiCRProject = subproject('HiCR', required: true, default_options: [ 'backends=' + ','.join(HiCRBackends), 'frontends=' + ','.join(HiCRFrontends) ])
HiCRBuildDep = HiCRProject.get_variable('hicrBuildDep')
deployrDependencies += HiCRBuildDep
####### Getting Hopcroft Karp dependency
HopcroftKarpProject = subproject('hopcroft_karp', required: true)
HopcroftKarpBuildDep = HopcroftKarpProject.get_variable('HopcroftKarpBuildDep')
deployrDependencies += HopcroftKarpBuildDep
####### Creating DeployR dependency
# Warning handling option
warningAsErrorFlags=[]
if get_option('compileWarningsAsErrors') == true
warningAsErrorFlags=[ '-Werror' ]
endif
DeployRBuildCppArgs = [
DeployRDistributedCppFlag,
'-Wfatal-errors',
warningAsErrorFlags
]
DeployRBuildIncludes = include_directories([
'include'
])
####### Collect the dependencies
DeployRBuildDep = declare_dependency(
compile_args: DeployRBuildCppArgs,
include_directories: DeployRBuildIncludes,
dependencies: deployrDependencies
)
####### Build test / example targets only if HiCR 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