blob: e758eb9023212f486734f1df3581e12202e5057b [file] [log] [blame]
Jenkins18b685f2020-08-21 10:26:22 +01001# Copyright (c) 2016, 2017 Arm Limited.
Anthony Barbierdbdab852017-06-23 15:42:00 +01002#
3# SPDX-License-Identifier: MIT
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to
7# deal in the Software without restriction, including without limitation the
8# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9# sell copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in all
13# copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE.
22import collections
23import os.path
24import re
25import subprocess
Jenkins7dcb9fa2021-02-23 22:45:28 +000026import zlib
27import base64
28import string
Anthony Barbierdbdab852017-06-23 15:42:00 +010029
Jenkins7dcb9fa2021-02-23 22:45:28 +000030VERSION = "v21.02"
31LIBRARY_VERSION_MAJOR = 22
Jenkins18b685f2020-08-21 10:26:22 +010032LIBRARY_VERSION_MINOR = 0
Jenkins6a7771e2020-05-28 11:28:36 +010033LIBRARY_VERSION_PATCH = 0
34SONAME_VERSION = str(LIBRARY_VERSION_MAJOR) + "." + str(LIBRARY_VERSION_MINOR) + "." + str(LIBRARY_VERSION_PATCH)
Anthony Barbierdbdab852017-06-23 15:42:00 +010035
36Import('env')
37Import('vars')
Jenkinsb9abeae2018-11-22 11:58:08 +000038Import('install_lib')
Anthony Barbierdbdab852017-06-23 15:42:00 +010039
Jenkins36ccc902020-02-21 11:10:48 +000040def build_bootcode_objs(sources):
41
42 arm_compute_env.Append(ASFLAGS = "-I bootcode/")
43 obj = arm_compute_env.Object(sources)
44 obj = install_lib(obj)
45 Default(obj)
46 return obj
47
Jenkins7dcb9fa2021-02-23 22:45:28 +000048def build_library(name, build_env, sources, static=False, libs=[]):
Anthony Barbierdbdab852017-06-23 15:42:00 +010049 if static:
Jenkins7dcb9fa2021-02-23 22:45:28 +000050 obj = build_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
Anthony Barbierdbdab852017-06-23 15:42:00 +010051 else:
52 if env['set_soname']:
Jenkins7dcb9fa2021-02-23 22:45:28 +000053 obj = build_env.SharedLibrary(name, source=sources, SHLIBVERSION = SONAME_VERSION, LIBS = arm_compute_env["LIBS"] + libs)
Anthony Barbierdbdab852017-06-23 15:42:00 +010054 else:
Jenkins7dcb9fa2021-02-23 22:45:28 +000055 obj = build_env.SharedLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs)
Anthony Barbierdbdab852017-06-23 15:42:00 +010056
Jenkinsb9abeae2018-11-22 11:58:08 +000057 obj = install_lib(obj)
Anthony Barbierdbdab852017-06-23 15:42:00 +010058 Default(obj)
59 return obj
60
Jenkins7dcb9fa2021-02-23 22:45:28 +000061def remove_incode_comments(code):
62 def replace_with_empty(match):
63 s = match.group(0)
64 if s.startswith('/'):
65 return " "
66 else:
67 return s
68
69 comment_regex = re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE)
70 return re.sub(comment_regex, replace_with_empty, code)
71
Anthony Barbierdbdab852017-06-23 15:42:00 +010072def resolve_includes(target, source, env):
73 # File collection
74 FileEntry = collections.namedtuple('FileEntry', 'target_name file_contents')
75
76 # Include pattern
77 pattern = re.compile("#include \"(.*)\"")
78
79 # Get file contents
80 files = []
81 for i in range(len(source)):
82 src = source[i]
83 dst = target[i]
Jenkins7dcb9fa2021-02-23 22:45:28 +000084 contents = src.get_contents().decode('utf-8')
85 contents = remove_incode_comments(contents).splitlines()
Anthony Barbierdbdab852017-06-23 15:42:00 +010086 entry = FileEntry(target_name=dst, file_contents=contents)
87 files.append((os.path.basename(src.get_path()),entry))
88
89 # Create dictionary of tupled list
90 files_dict = dict(files)
91
92 # Check for includes (can only be files in the same folder)
93 final_files = []
94 for file in files:
95 done = False
96 tmp_file = file[1].file_contents
97 while not done:
98 file_count = 0
99 updated_file = []
100 for line in tmp_file:
101 found = pattern.search(line)
102 if found:
103 include_file = found.group(1)
104 data = files_dict[include_file].file_contents
105 updated_file.extend(data)
106 else:
107 updated_file.append(line)
108 file_count += 1
109
110 # Check if all include are replaced.
111 if file_count == len(tmp_file):
112 done = True
113
114 # Update temp file
115 tmp_file = updated_file
116
117 # Append and prepend string literal identifiers and add expanded file to final list
Anthony Barbierdbdab852017-06-23 15:42:00 +0100118 entry = FileEntry(target_name=file[1].target_name, file_contents=tmp_file)
119 final_files.append((file[0], entry))
120
121 # Write output files
122 for file in final_files:
123 with open(file[1].target_name.get_path(), 'w+') as out_file:
Jenkins7dcb9fa2021-02-23 22:45:28 +0000124 file_to_write = "\n".join( file[1].file_contents )
125 if env['compress_kernels']:
126 file_to_write = zlib.compress(file_to_write, 9).encode("base64").replace("\n", "")
127 file_to_write = "R\"(" + file_to_write + ")\""
128 out_file.write(file_to_write)
Anthony Barbierdbdab852017-06-23 15:42:00 +0100129
130def create_version_file(target, source, env):
131# Generate string with build options library version to embed in the library:
132 try:
133 git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"])
134 except (OSError, subprocess.CalledProcessError):
135 git_hash="unknown"
136
Anthony Barbierdbdab852017-06-23 15:42:00 +0100137 build_info = "\"arm_compute_version=%s Build options: %s Git hash=%s\"" % (VERSION, vars.args, git_hash.strip())
138 with open(target[0].get_path(), "w") as fd:
139 fd.write(build_info)
140
Anthony Barbierdbdab852017-06-23 15:42:00 +0100141arm_compute_env = env.Clone()
Jenkins52ba29e2018-08-29 15:32:11 +0000142version_file = arm_compute_env.Command("src/core/arm_compute_version.embed", "", action=create_version_file)
143arm_compute_env.AlwaysBuild(version_file)
Anthony Barbierdbdab852017-06-23 15:42:00 +0100144
Jenkins7dcb9fa2021-02-23 22:45:28 +0000145default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos'] else 'clang++'
146cpp_compiler = os.environ.get('CXX', default_cpp_compiler)
147
Anthony Barbier06ea0482018-02-22 15:45:35 +0000148# Generate embed files
Jenkins52ba29e2018-08-29 15:32:11 +0000149generate_embed = [ version_file ]
Anthony Barbier06ea0482018-02-22 15:45:35 +0000150if env['opencl'] and env['embed_kernels']:
151 cl_files = Glob('src/core/CL/cl_kernels/*.cl')
152 cl_files += Glob('src/core/CL/cl_kernels/*.h')
153
154 embed_files = [ f.get_path()+"embed" for f in cl_files ]
155 arm_compute_env.Append(CPPPATH =[Dir("./src/core/CL/").path] )
156
157 generate_embed.append(arm_compute_env.Command(embed_files, cl_files, action=resolve_includes))
158
159if env['gles_compute'] and env['embed_kernels']:
160 cs_files = Glob('src/core/GLES_COMPUTE/cs_shaders/*.cs')
161 cs_files += Glob('src/core/GLES_COMPUTE/cs_shaders/*.h')
162
163 embed_files = [ f.get_path()+"embed" for f in cs_files ]
164 arm_compute_env.Append(CPPPATH =[Dir("./src/core/GLES_COMPUTE/").path] )
165
166 generate_embed.append(arm_compute_env.Command(embed_files, cs_files, action=resolve_includes))
167
168Default(generate_embed)
169if env["build"] == "embed_only":
170 Return()
171
Jenkins6a7771e2020-05-28 11:28:36 +0100172# Append version defines for semantic versioning
173arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSION_MAJOR),
174 ('ARM_COMPUTE_VERSION_MINOR', LIBRARY_VERSION_MINOR),
175 ('ARM_COMPUTE_VERSION_PATCH', LIBRARY_VERSION_PATCH)])
176
177
Anthony Barbier06ea0482018-02-22 15:45:35 +0000178# Don't allow undefined references in the libraries:
Jenkins7dcb9fa2021-02-23 22:45:28 +0000179undefined_flag = '-Wl,-undefined,error' if 'macos' in arm_compute_env["os"] else '-Wl,--no-undefined'
180arm_compute_env.Append(LINKFLAGS=[undefined_flag])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100181arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] )
182
Anthony Barbierdbdab852017-06-23 15:42:00 +0100183arm_compute_env.Append(LIBS = ['dl'])
184
185core_files = Glob('src/core/*.cpp')
186core_files += Glob('src/core/CPP/*.cpp')
187core_files += Glob('src/core/CPP/kernels/*.cpp')
Jenkins49b8f902020-11-27 12:49:11 +0000188core_files += Glob('src/core/helpers/*.cpp')
Jenkins18b685f2020-08-21 10:26:22 +0100189core_files += Glob('src/core/utils/*.cpp')
Jenkins514be652019-02-28 12:25:18 +0000190core_files += Glob('src/core/utils/helpers/*.cpp')
191core_files += Glob('src/core/utils/io/*.cpp')
192core_files += Glob('src/core/utils/quantization/*.cpp')
Jenkins975dfe12019-09-02 11:47:54 +0100193core_files += Glob('src/core/utils/misc/*.cpp')
Jenkins514be652019-02-28 12:25:18 +0000194if env["logging"]:
195 core_files += Glob('src/core/utils/logging/*.cpp')
Anthony Barbierdbdab852017-06-23 15:42:00 +0100196
Kaizen8938bd32017-09-28 14:38:23 +0100197runtime_files = Glob('src/runtime/*.cpp')
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000198runtime_files += Glob('src/runtime/CPP/ICPPSimpleFunction.cpp')
199runtime_files += Glob('src/runtime/CPP/functions/*.cpp')
200
Anthony Barbierdbdab852017-06-23 15:42:00 +0100201# CLHarrisCorners uses the Scheduler to run CPP kernels
Kaizen8938bd32017-09-28 14:38:23 +0100202runtime_files += Glob('src/runtime/CPP/SingleThreadScheduler.cpp')
Anthony Barbierdbdab852017-06-23 15:42:00 +0100203
Jenkinsb3a371b2018-05-23 11:36:53 +0100204graph_files = Glob('src/graph/*.cpp')
205graph_files += Glob('src/graph/*/*.cpp')
206
Anthony Barbierdbdab852017-06-23 15:42:00 +0100207if env['cppthreads']:
Kaizen8938bd32017-09-28 14:38:23 +0100208 runtime_files += Glob('src/runtime/CPP/CPPScheduler.cpp')
Anthony Barbierdbdab852017-06-23 15:42:00 +0100209
210if env['openmp']:
Kaizen8938bd32017-09-28 14:38:23 +0100211 runtime_files += Glob('src/runtime/OMP/OMPScheduler.cpp')
Anthony Barbierdbdab852017-06-23 15:42:00 +0100212
213if env['opencl']:
214 core_files += Glob('src/core/CL/*.cpp')
215 core_files += Glob('src/core/CL/kernels/*.cpp')
Jenkins4ba87db2019-05-23 17:11:51 +0100216 core_files += Glob('src/core/CL/gemm/*.cpp')
Jenkins975dfe12019-09-02 11:47:54 +0100217 core_files += Glob('src/core/CL/gemm/native/*.cpp')
Jenkins4ba87db2019-05-23 17:11:51 +0100218 core_files += Glob('src/core/CL/gemm/reshaped/*.cpp')
219 core_files += Glob('src/core/CL/gemm/reshaped_only_rhs/*.cpp')
Jenkins7dcb9fa2021-02-23 22:45:28 +0000220 core_files += Glob('src/core/gpu/cl/*.cpp')
221 core_files += Glob('src/core/gpu/cl/kernels/*.cpp')
Anthony Barbierdbdab852017-06-23 15:42:00 +0100222
Kaizen8938bd32017-09-28 14:38:23 +0100223 runtime_files += Glob('src/runtime/CL/*.cpp')
224 runtime_files += Glob('src/runtime/CL/functions/*.cpp')
Jenkins6a7771e2020-05-28 11:28:36 +0100225 runtime_files += Glob('src/runtime/CL/gemm/*.cpp')
Jenkinsb3a371b2018-05-23 11:36:53 +0100226 runtime_files += Glob('src/runtime/CL/tuners/*.cpp')
Jenkins7dcb9fa2021-02-23 22:45:28 +0000227 runtime_files += Glob('src/runtime/gpu/cl/*.cpp')
228 runtime_files += Glob('src/runtime/gpu/cl/operators/*.cpp')
229 runtime_files += Glob('src/runtime/CL/mlgo/*.cpp')
230 runtime_files += Glob('src/runtime/CL/gemm_auto_heuristics/*.cpp')
Jenkinsb3a371b2018-05-23 11:36:53 +0100231
232 graph_files += Glob('src/graph/backends/CL/*.cpp')
233
Anthony Barbierdbdab852017-06-23 15:42:00 +0100234
Anthony Barbierdbdab852017-06-23 15:42:00 +0100235if env['neon']:
236 core_files += Glob('src/core/NEON/*.cpp')
237 core_files += Glob('src/core/NEON/kernels/*.cpp')
Jenkins52ba29e2018-08-29 15:32:11 +0000238 core_files += Glob('src/core/NEON/kernels/assembly/*.cpp')
Anthony Barbierdbdab852017-06-23 15:42:00 +0100239
Jenkinsb3a371b2018-05-23 11:36:53 +0100240 core_files += Glob('src/core/NEON/kernels/arm_gemm/*.cpp')
Jenkins7dcb9fa2021-02-23 22:45:28 +0000241 core_files += Glob('src/core/NEON/kernels/arm_conv/*.cpp')
242 core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/*.cpp')
243 core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/kernels/cpp_*/*.cpp')
Jenkinsb3a371b2018-05-23 11:36:53 +0100244
Jenkins975dfe12019-09-02 11:47:54 +0100245 # build winograd/depthwise sources for either v7a / v8a
Anthony Barbier06ea0482018-02-22 15:45:35 +0000246 core_files += Glob('src/core/NEON/kernels/convolution/*/*.cpp')
247 core_files += Glob('src/core/NEON/kernels/convolution/winograd/*/*.cpp')
Jenkins49b8f902020-11-27 12:49:11 +0000248 arm_compute_env.Append(CPPPATH = ["src/core/NEON/kernels/convolution/common/",
Jenkins18b685f2020-08-21 10:26:22 +0100249 "src/core/NEON/kernels/convolution/winograd/",
Jenkins49b8f902020-11-27 12:49:11 +0000250 "src/core/NEON/kernels/convolution/depthwise/",
251 "src/core/NEON/kernels/assembly/",
Jenkins975dfe12019-09-02 11:47:54 +0100252 "arm_compute/core/NEON/kernels/assembly/"])
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000253
Jenkinsb3a371b2018-05-23 11:36:53 +0100254 graph_files += Glob('src/graph/backends/NEON/*.cpp')
255
Jenkins36ccc902020-02-21 11:10:48 +0000256 if env['estate'] == '32':
Jenkinsb3a371b2018-05-23 11:36:53 +0100257 core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/a32_*/*.cpp')
258
Jenkins36ccc902020-02-21 11:10:48 +0000259 if env['estate'] == '64':
Jenkinsb3a371b2018-05-23 11:36:53 +0100260 core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/a64_*/*.cpp')
Jenkins7dcb9fa2021-02-23 22:45:28 +0000261 core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/kernels/a64_*/*.cpp')
Jenkinsb9abeae2018-11-22 11:58:08 +0000262 if "sve" in env['arch']:
263 core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/sve_*/*.cpp')
Jenkins7dcb9fa2021-02-23 22:45:28 +0000264 core_files += Glob('src/core/NEON/kernels/arm_conv/pooling/kernels/sve_*/*.cpp')
Kaizen8938bd32017-09-28 14:38:23 +0100265
Jenkins49b8f902020-11-27 12:49:11 +0000266 if any(i in env['data_type_support'] for i in ['all', 'fp16']):
Jenkins7dcb9fa2021-02-23 22:45:28 +0000267 core_files += Glob('src/core/NEON/kernels/*/impl/*/fp16.cpp')
Jenkins49b8f902020-11-27 12:49:11 +0000268 if any(i in env['data_type_support'] for i in ['all', 'fp32']):
Jenkins7dcb9fa2021-02-23 22:45:28 +0000269 core_files += Glob('src/core/NEON/kernels/*/impl/*/fp32.cpp')
Jenkins49b8f902020-11-27 12:49:11 +0000270 if any(i in env['data_type_support'] for i in ['all', 'qasymm8']):
Jenkins7dcb9fa2021-02-23 22:45:28 +0000271 core_files += Glob('src/core/NEON/kernels/*/impl/*/qasymm8.cpp')
Jenkins49b8f902020-11-27 12:49:11 +0000272 if any(i in env['data_type_support'] for i in ['all', 'qasymm8_signed']):
Jenkins7dcb9fa2021-02-23 22:45:28 +0000273 core_files += Glob('src/core/NEON/kernels/*/impl/*/qasymm8_signed.cpp')
Jenkins49b8f902020-11-27 12:49:11 +0000274 if any(i in env['data_type_support'] for i in ['all', 'qsymm16']):
Jenkins7dcb9fa2021-02-23 22:45:28 +0000275 core_files += Glob('src/core/NEON/kernels/*/impl/*/qsymm16.cpp')
276 if any(i in env['data_type_support'] for i in ['all', 'integer']):
277 core_files += Glob('src/core/NEON/kernels/*/impl/*/integer.cpp')
Jenkins49b8f902020-11-27 12:49:11 +0000278
Kaizen8938bd32017-09-28 14:38:23 +0100279 runtime_files += Glob('src/runtime/NEON/*.cpp')
280 runtime_files += Glob('src/runtime/NEON/functions/*.cpp')
Jenkins52ba29e2018-08-29 15:32:11 +0000281 runtime_files += Glob('src/runtime/NEON/functions/assembly/*.cpp')
Anthony Barbierdbdab852017-06-23 15:42:00 +0100282
Jenkins7dcb9fa2021-02-23 22:45:28 +0000283 core_files += Glob('src/core/cpu/*.cpp')
284 core_files += Glob('src/core/cpu/kernels/*.cpp')
285 core_files += Glob('src/core/cpu/kernels/*/*.cpp')
286 if any(i in env['data_type_support'] for i in ['all', 'fp16']):
287 core_files += Glob('src/core/cpu/kernels/*/*/fp16.cpp')
288 if any(i in env['data_type_support'] for i in ['all', 'fp32']):
289 core_files += Glob('src/core/cpu/kernels/*/*/fp32.cpp')
290 if any(i in env['data_type_support'] for i in ['all', 'qasymm8']):
291 core_files += Glob('src/core/cpu/kernels/*/*/qasymm8.cpp')
292 if any(i in env['data_type_support'] for i in ['all', 'qasymm8_signed']):
293 core_files += Glob('src/core/cpu/kernels/*/*/qasymm8_signed.cpp')
294 if any(i in env['data_type_support'] for i in ['all', 'qsymm16']):
295 core_files += Glob('src/core/cpu/kernels/*/*/qsymm16.cpp')
296 if any(i in env['data_type_support'] for i in ['all', 'integer']):
297 core_files += Glob('src/core/cpu/kernels/*/*/integer.cpp')
298
299 if any(i in env['data_layout_support'] for i in ['all', 'nchw']):
300 core_files += Glob('src/core/cpu/kernels/*/*/nchw/all.cpp')
301
302 runtime_files += Glob('src/runtime/cpu/*.cpp')
303 runtime_files += Glob('src/runtime/cpu/operators/*.cpp')
304
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000305if env['gles_compute']:
306 if env['os'] != 'android':
307 arm_compute_env.Append(CPPPATH = ["#opengles-3.1/include", "#opengles-3.1/mali_include"])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100308
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000309 core_files += Glob('src/core/GLES_COMPUTE/*.cpp')
310 core_files += Glob('src/core/GLES_COMPUTE/kernels/*.cpp')
311
312 runtime_files += Glob('src/runtime/GLES_COMPUTE/*.cpp')
313 runtime_files += Glob('src/runtime/GLES_COMPUTE/functions/*.cpp')
314
Jenkinsb3a371b2018-05-23 11:36:53 +0100315 graph_files += Glob('src/graph/backends/GLES/*.cpp')
Jenkins6a7771e2020-05-28 11:28:36 +0100316if env['tracing']:
317 arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_TRACING_ENABLED'])
318else:
319 # Remove TracePoint files if tracing is disabled:
320 core_files = [ f for f in core_files if not "TracePoint" in str(f)]
321 runtime_files = [ f for f in runtime_files if not "TracePoint" in str(f)]
Jenkinsb3a371b2018-05-23 11:36:53 +0100322
Jenkins36ccc902020-02-21 11:10:48 +0000323bootcode_o = []
324if env['os'] == 'bare_metal':
325 bootcode_files = Glob('bootcode/*.s')
326 bootcode_o = build_bootcode_objs(bootcode_files)
327Export('bootcode_o')
328
Jenkins7dcb9fa2021-02-23 22:45:28 +0000329arm_compute_core_a = build_library('arm_compute_core-static', arm_compute_env, core_files, static=True)
Anthony Barbierdbdab852017-06-23 15:42:00 +0100330Export('arm_compute_core_a')
331
Kaizen8938bd32017-09-28 14:38:23 +0100332if env['os'] != 'bare_metal' and not env['standalone']:
Jenkins7dcb9fa2021-02-23 22:45:28 +0000333 arm_compute_core_so = build_library('arm_compute_core', arm_compute_env, core_files, static=False)
Anthony Barbierdbdab852017-06-23 15:42:00 +0100334 Export('arm_compute_core_so')
335
Jenkins7dcb9fa2021-02-23 22:45:28 +0000336arm_compute_a = build_library('arm_compute-static', arm_compute_env, runtime_files, static=True, libs = [ arm_compute_core_a ])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100337Export('arm_compute_a')
338
Kaizen8938bd32017-09-28 14:38:23 +0100339if env['os'] != 'bare_metal' and not env['standalone']:
Jenkins7dcb9fa2021-02-23 22:45:28 +0000340 arm_compute_so = build_library('arm_compute', arm_compute_env, runtime_files, static=False, libs = [ "arm_compute_core" ])
Kaizenbf8b01d2017-10-12 14:26:51 +0100341 Depends(arm_compute_so, arm_compute_core_so)
Anthony Barbierdbdab852017-06-23 15:42:00 +0100342 Export('arm_compute_so')
343
Jenkins7dcb9fa2021-02-23 22:45:28 +0000344arm_compute_graph_env = arm_compute_env.Clone()
345
346arm_compute_graph_env.Append(CXXFLAGS = ['-Wno-redundant-move', '-Wno-pessimizing-move'])
347
348arm_compute_graph_a = build_library('arm_compute_graph-static', arm_compute_graph_env, graph_files, static=True, libs = [ arm_compute_a])
Jenkinsb3a371b2018-05-23 11:36:53 +0100349Export('arm_compute_graph_a')
Kaizen8938bd32017-09-28 14:38:23 +0100350
Jenkinsb3a371b2018-05-23 11:36:53 +0100351if env['os'] != 'bare_metal' and not env['standalone']:
Jenkins7dcb9fa2021-02-23 22:45:28 +0000352 arm_compute_graph_so = build_library('arm_compute_graph', arm_compute_graph_env, graph_files, static=False, libs = [ "arm_compute" , "arm_compute_core"])
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000353 Depends(arm_compute_graph_so, arm_compute_so)
Kaizen8938bd32017-09-28 14:38:23 +0100354 Export('arm_compute_graph_so')
355
Kaizen8938bd32017-09-28 14:38:23 +0100356if env['standalone']:
357 alias = arm_compute_env.Alias("arm_compute", [arm_compute_a])
358else:
359 alias = arm_compute_env.Alias("arm_compute", [arm_compute_a, arm_compute_so])
360
Anthony Barbierdbdab852017-06-23 15:42:00 +0100361Default(alias)
362
Kaizen8938bd32017-09-28 14:38:23 +0100363if env['standalone']:
364 Depends([alias,arm_compute_core_a], generate_embed)
365else:
366 Depends([alias,arm_compute_core_so, arm_compute_core_a], generate_embed)