Jenkins | 18b685f | 2020-08-21 10:26:22 +0100 | [diff] [blame] | 1 | # Copyright (c) 2016, 2017 Arm Limited. |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 2 | # |
| 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. |
| 22 | import collections |
| 23 | import os.path |
| 24 | import re |
| 25 | import subprocess |
| 26 | |
Jenkins | 49b8f90 | 2020-11-27 12:49:11 +0000 | [diff] [blame] | 27 | VERSION = "v20.11" |
| 28 | LIBRARY_VERSION_MAJOR = 21 |
Jenkins | 18b685f | 2020-08-21 10:26:22 +0100 | [diff] [blame] | 29 | LIBRARY_VERSION_MINOR = 0 |
Jenkins | 6a7771e | 2020-05-28 11:28:36 +0100 | [diff] [blame] | 30 | LIBRARY_VERSION_PATCH = 0 |
| 31 | SONAME_VERSION = str(LIBRARY_VERSION_MAJOR) + "." + str(LIBRARY_VERSION_MINOR) + "." + str(LIBRARY_VERSION_PATCH) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 32 | |
| 33 | Import('env') |
| 34 | Import('vars') |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 35 | Import('install_lib') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 36 | |
Jenkins | 36ccc90 | 2020-02-21 11:10:48 +0000 | [diff] [blame] | 37 | def build_bootcode_objs(sources): |
| 38 | |
| 39 | arm_compute_env.Append(ASFLAGS = "-I bootcode/") |
| 40 | obj = arm_compute_env.Object(sources) |
| 41 | obj = install_lib(obj) |
| 42 | Default(obj) |
| 43 | return obj |
| 44 | |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 45 | def build_library(name, sources, static=False, libs=[]): |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 46 | if static: |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 47 | obj = arm_compute_env.StaticLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 48 | else: |
| 49 | if env['set_soname']: |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 50 | obj = arm_compute_env.SharedLibrary(name, source=sources, SHLIBVERSION = SONAME_VERSION, LIBS = arm_compute_env["LIBS"] + libs) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 51 | else: |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 52 | obj = arm_compute_env.SharedLibrary(name, source=sources, LIBS = arm_compute_env["LIBS"] + libs) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 53 | |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 54 | obj = install_lib(obj) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 55 | Default(obj) |
| 56 | return obj |
| 57 | |
| 58 | def resolve_includes(target, source, env): |
| 59 | # File collection |
| 60 | FileEntry = collections.namedtuple('FileEntry', 'target_name file_contents') |
| 61 | |
| 62 | # Include pattern |
| 63 | pattern = re.compile("#include \"(.*)\"") |
| 64 | |
| 65 | # Get file contents |
| 66 | files = [] |
| 67 | for i in range(len(source)): |
| 68 | src = source[i] |
| 69 | dst = target[i] |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 70 | contents = src.get_contents().decode('utf-8').splitlines() |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 71 | entry = FileEntry(target_name=dst, file_contents=contents) |
| 72 | files.append((os.path.basename(src.get_path()),entry)) |
| 73 | |
| 74 | # Create dictionary of tupled list |
| 75 | files_dict = dict(files) |
| 76 | |
| 77 | # Check for includes (can only be files in the same folder) |
| 78 | final_files = [] |
| 79 | for file in files: |
| 80 | done = False |
| 81 | tmp_file = file[1].file_contents |
| 82 | while not done: |
| 83 | file_count = 0 |
| 84 | updated_file = [] |
| 85 | for line in tmp_file: |
| 86 | found = pattern.search(line) |
| 87 | if found: |
| 88 | include_file = found.group(1) |
| 89 | data = files_dict[include_file].file_contents |
| 90 | updated_file.extend(data) |
| 91 | else: |
| 92 | updated_file.append(line) |
| 93 | file_count += 1 |
| 94 | |
| 95 | # Check if all include are replaced. |
| 96 | if file_count == len(tmp_file): |
| 97 | done = True |
| 98 | |
| 99 | # Update temp file |
| 100 | tmp_file = updated_file |
| 101 | |
| 102 | # Append and prepend string literal identifiers and add expanded file to final list |
| 103 | tmp_file.insert(0, "R\"(\n") |
| 104 | tmp_file.append("\n)\"") |
| 105 | entry = FileEntry(target_name=file[1].target_name, file_contents=tmp_file) |
| 106 | final_files.append((file[0], entry)) |
| 107 | |
| 108 | # Write output files |
| 109 | for file in final_files: |
| 110 | with open(file[1].target_name.get_path(), 'w+') as out_file: |
| 111 | out_file.write( "\n".join( file[1].file_contents )) |
| 112 | |
| 113 | def create_version_file(target, source, env): |
| 114 | # Generate string with build options library version to embed in the library: |
| 115 | try: |
| 116 | git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]) |
| 117 | except (OSError, subprocess.CalledProcessError): |
| 118 | git_hash="unknown" |
| 119 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 120 | build_info = "\"arm_compute_version=%s Build options: %s Git hash=%s\"" % (VERSION, vars.args, git_hash.strip()) |
| 121 | with open(target[0].get_path(), "w") as fd: |
| 122 | fd.write(build_info) |
| 123 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 124 | arm_compute_env = env.Clone() |
Jenkins | 52ba29e | 2018-08-29 15:32:11 +0000 | [diff] [blame] | 125 | version_file = arm_compute_env.Command("src/core/arm_compute_version.embed", "", action=create_version_file) |
| 126 | arm_compute_env.AlwaysBuild(version_file) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 127 | |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 128 | # Generate embed files |
Jenkins | 52ba29e | 2018-08-29 15:32:11 +0000 | [diff] [blame] | 129 | generate_embed = [ version_file ] |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 130 | if env['opencl'] and env['embed_kernels']: |
| 131 | cl_files = Glob('src/core/CL/cl_kernels/*.cl') |
| 132 | cl_files += Glob('src/core/CL/cl_kernels/*.h') |
| 133 | |
| 134 | embed_files = [ f.get_path()+"embed" for f in cl_files ] |
| 135 | arm_compute_env.Append(CPPPATH =[Dir("./src/core/CL/").path] ) |
| 136 | |
| 137 | generate_embed.append(arm_compute_env.Command(embed_files, cl_files, action=resolve_includes)) |
| 138 | |
| 139 | if env['gles_compute'] and env['embed_kernels']: |
| 140 | cs_files = Glob('src/core/GLES_COMPUTE/cs_shaders/*.cs') |
| 141 | cs_files += Glob('src/core/GLES_COMPUTE/cs_shaders/*.h') |
| 142 | |
| 143 | embed_files = [ f.get_path()+"embed" for f in cs_files ] |
| 144 | arm_compute_env.Append(CPPPATH =[Dir("./src/core/GLES_COMPUTE/").path] ) |
| 145 | |
| 146 | generate_embed.append(arm_compute_env.Command(embed_files, cs_files, action=resolve_includes)) |
| 147 | |
| 148 | Default(generate_embed) |
| 149 | if env["build"] == "embed_only": |
| 150 | Return() |
| 151 | |
Jenkins | 6a7771e | 2020-05-28 11:28:36 +0100 | [diff] [blame] | 152 | # Append version defines for semantic versioning |
| 153 | arm_compute_env.Append(CPPDEFINES = [('ARM_COMPUTE_VERSION_MAJOR', LIBRARY_VERSION_MAJOR), |
| 154 | ('ARM_COMPUTE_VERSION_MINOR', LIBRARY_VERSION_MINOR), |
| 155 | ('ARM_COMPUTE_VERSION_PATCH', LIBRARY_VERSION_PATCH)]) |
| 156 | |
| 157 | |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 158 | # Don't allow undefined references in the libraries: |
| 159 | arm_compute_env.Append(LINKFLAGS=['-Wl,--no-undefined']) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 160 | arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] ) |
| 161 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 162 | arm_compute_env.Append(LIBS = ['dl']) |
| 163 | |
| 164 | core_files = Glob('src/core/*.cpp') |
| 165 | core_files += Glob('src/core/CPP/*.cpp') |
| 166 | core_files += Glob('src/core/CPP/kernels/*.cpp') |
Jenkins | 49b8f90 | 2020-11-27 12:49:11 +0000 | [diff] [blame] | 167 | core_files += Glob('src/core/helpers/*.cpp') |
Jenkins | 18b685f | 2020-08-21 10:26:22 +0100 | [diff] [blame] | 168 | core_files += Glob('src/core/utils/*.cpp') |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 169 | core_files += Glob('src/core/utils/helpers/*.cpp') |
| 170 | core_files += Glob('src/core/utils/io/*.cpp') |
| 171 | core_files += Glob('src/core/utils/quantization/*.cpp') |
Jenkins | 975dfe1 | 2019-09-02 11:47:54 +0100 | [diff] [blame] | 172 | core_files += Glob('src/core/utils/misc/*.cpp') |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 173 | if env["logging"]: |
| 174 | core_files += Glob('src/core/utils/logging/*.cpp') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 175 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 176 | runtime_files = Glob('src/runtime/*.cpp') |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 177 | runtime_files += Glob('src/runtime/CPP/ICPPSimpleFunction.cpp') |
| 178 | runtime_files += Glob('src/runtime/CPP/functions/*.cpp') |
| 179 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 180 | # CLHarrisCorners uses the Scheduler to run CPP kernels |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 181 | runtime_files += Glob('src/runtime/CPP/SingleThreadScheduler.cpp') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 182 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 183 | graph_files = Glob('src/graph/*.cpp') |
| 184 | graph_files += Glob('src/graph/*/*.cpp') |
| 185 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 186 | if env['cppthreads']: |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 187 | runtime_files += Glob('src/runtime/CPP/CPPScheduler.cpp') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 188 | |
| 189 | if env['openmp']: |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 190 | runtime_files += Glob('src/runtime/OMP/OMPScheduler.cpp') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 191 | |
| 192 | if env['opencl']: |
| 193 | core_files += Glob('src/core/CL/*.cpp') |
| 194 | core_files += Glob('src/core/CL/kernels/*.cpp') |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 195 | core_files += Glob('src/core/CL/gemm/*.cpp') |
Jenkins | 975dfe1 | 2019-09-02 11:47:54 +0100 | [diff] [blame] | 196 | core_files += Glob('src/core/CL/gemm/native/*.cpp') |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 197 | core_files += Glob('src/core/CL/gemm/reshaped/*.cpp') |
| 198 | core_files += Glob('src/core/CL/gemm/reshaped_only_rhs/*.cpp') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 199 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 200 | runtime_files += Glob('src/runtime/CL/*.cpp') |
| 201 | runtime_files += Glob('src/runtime/CL/functions/*.cpp') |
Jenkins | 6a7771e | 2020-05-28 11:28:36 +0100 | [diff] [blame] | 202 | runtime_files += Glob('src/runtime/CL/gemm/*.cpp') |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 203 | runtime_files += Glob('src/runtime/CL/tuners/*.cpp') |
| 204 | |
| 205 | graph_files += Glob('src/graph/backends/CL/*.cpp') |
| 206 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 207 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 208 | if env['neon']: |
| 209 | core_files += Glob('src/core/NEON/*.cpp') |
| 210 | core_files += Glob('src/core/NEON/kernels/*.cpp') |
Jenkins | 52ba29e | 2018-08-29 15:32:11 +0000 | [diff] [blame] | 211 | core_files += Glob('src/core/NEON/kernels/assembly/*.cpp') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 212 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 213 | core_files += Glob('src/core/NEON/kernels/arm_gemm/*.cpp') |
| 214 | |
Jenkins | 975dfe1 | 2019-09-02 11:47:54 +0100 | [diff] [blame] | 215 | # build winograd/depthwise sources for either v7a / v8a |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 216 | core_files += Glob('src/core/NEON/kernels/convolution/*/*.cpp') |
| 217 | core_files += Glob('src/core/NEON/kernels/convolution/winograd/*/*.cpp') |
Jenkins | 49b8f90 | 2020-11-27 12:49:11 +0000 | [diff] [blame] | 218 | arm_compute_env.Append(CPPPATH = ["src/core/NEON/kernels/convolution/common/", |
Jenkins | 18b685f | 2020-08-21 10:26:22 +0100 | [diff] [blame] | 219 | "src/core/NEON/kernels/convolution/winograd/", |
Jenkins | 49b8f90 | 2020-11-27 12:49:11 +0000 | [diff] [blame] | 220 | "src/core/NEON/kernels/convolution/depthwise/", |
| 221 | "src/core/NEON/kernels/assembly/", |
Jenkins | 975dfe1 | 2019-09-02 11:47:54 +0100 | [diff] [blame] | 222 | "arm_compute/core/NEON/kernels/assembly/"]) |
Anthony Barbier | f45d5a9 | 2018-01-24 16:23:15 +0000 | [diff] [blame] | 223 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 224 | graph_files += Glob('src/graph/backends/NEON/*.cpp') |
| 225 | |
Jenkins | 36ccc90 | 2020-02-21 11:10:48 +0000 | [diff] [blame] | 226 | if env['estate'] == '32': |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 227 | core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/a32_*/*.cpp') |
| 228 | |
Jenkins | 36ccc90 | 2020-02-21 11:10:48 +0000 | [diff] [blame] | 229 | if env['estate'] == '64': |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 230 | core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/a64_*/*.cpp') |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 231 | if "sve" in env['arch']: |
| 232 | core_files += Glob('src/core/NEON/kernels/arm_gemm/kernels/sve_*/*.cpp') |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 233 | |
Jenkins | 49b8f90 | 2020-11-27 12:49:11 +0000 | [diff] [blame] | 234 | if any(i in env['data_type_support'] for i in ['all', 'fp16']): |
| 235 | core_files += Glob('src/core/NEON/kernels/*/impl/fp16_*.cpp') |
| 236 | if any(i in env['data_type_support'] for i in ['all', 'fp32']): |
| 237 | core_files += Glob('src/core/NEON/kernels/*/impl/fp32_*.cpp') |
| 238 | if any(i in env['data_type_support'] for i in ['all', 'qasymm8']): |
| 239 | core_files += Glob('src/core/NEON/kernels/*/impl/qasymm8_neon*.cpp') |
| 240 | if any(i in env['data_type_support'] for i in ['all', 'qasymm8_signed']): |
| 241 | core_files += Glob('src/core/NEON/kernels/*/impl/qasymm8_signed_*.cpp') |
| 242 | if any(i in env['data_type_support'] for i in ['all', 'qsymm16']): |
| 243 | core_files += Glob('src/core/NEON/kernels/*/impl/qsymm16_*.cpp') |
| 244 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 245 | runtime_files += Glob('src/runtime/NEON/*.cpp') |
| 246 | runtime_files += Glob('src/runtime/NEON/functions/*.cpp') |
Jenkins | 52ba29e | 2018-08-29 15:32:11 +0000 | [diff] [blame] | 247 | runtime_files += Glob('src/runtime/NEON/functions/assembly/*.cpp') |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 248 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 249 | if env['gles_compute']: |
| 250 | if env['os'] != 'android': |
| 251 | arm_compute_env.Append(CPPPATH = ["#opengles-3.1/include", "#opengles-3.1/mali_include"]) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 252 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 253 | core_files += Glob('src/core/GLES_COMPUTE/*.cpp') |
| 254 | core_files += Glob('src/core/GLES_COMPUTE/kernels/*.cpp') |
| 255 | |
| 256 | runtime_files += Glob('src/runtime/GLES_COMPUTE/*.cpp') |
| 257 | runtime_files += Glob('src/runtime/GLES_COMPUTE/functions/*.cpp') |
| 258 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 259 | graph_files += Glob('src/graph/backends/GLES/*.cpp') |
Jenkins | 6a7771e | 2020-05-28 11:28:36 +0100 | [diff] [blame] | 260 | if env['tracing']: |
| 261 | arm_compute_env.Append(CPPDEFINES = ['ARM_COMPUTE_TRACING_ENABLED']) |
| 262 | else: |
| 263 | # Remove TracePoint files if tracing is disabled: |
| 264 | core_files = [ f for f in core_files if not "TracePoint" in str(f)] |
| 265 | runtime_files = [ f for f in runtime_files if not "TracePoint" in str(f)] |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 266 | |
Jenkins | 36ccc90 | 2020-02-21 11:10:48 +0000 | [diff] [blame] | 267 | bootcode_o = [] |
| 268 | if env['os'] == 'bare_metal': |
| 269 | bootcode_files = Glob('bootcode/*.s') |
| 270 | bootcode_o = build_bootcode_objs(bootcode_files) |
| 271 | Export('bootcode_o') |
| 272 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 273 | arm_compute_core_a = build_library('arm_compute_core-static', core_files, static=True) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 274 | Export('arm_compute_core_a') |
| 275 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 276 | if env['os'] != 'bare_metal' and not env['standalone']: |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 277 | arm_compute_core_so = build_library('arm_compute_core', core_files, static=False) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 278 | Export('arm_compute_core_so') |
| 279 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 280 | arm_compute_a = build_library('arm_compute-static', runtime_files, static=True, libs = [ arm_compute_core_a ]) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 281 | Export('arm_compute_a') |
| 282 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 283 | if env['os'] != 'bare_metal' and not env['standalone']: |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 284 | arm_compute_so = build_library('arm_compute', runtime_files, static=False, libs = [ "arm_compute_core" ]) |
Kaizen | bf8b01d | 2017-10-12 14:26:51 +0100 | [diff] [blame] | 285 | Depends(arm_compute_so, arm_compute_core_so) |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 286 | Export('arm_compute_so') |
| 287 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 288 | arm_compute_graph_a = build_library('arm_compute_graph-static', graph_files, static=True, libs = [ arm_compute_a]) |
| 289 | Export('arm_compute_graph_a') |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 290 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 291 | if env['os'] != 'bare_metal' and not env['standalone']: |
| 292 | arm_compute_graph_so = build_library('arm_compute_graph', graph_files, static=False, libs = [ "arm_compute" , "arm_compute_core"]) |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 293 | Depends(arm_compute_graph_so, arm_compute_so) |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 294 | Export('arm_compute_graph_so') |
| 295 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 296 | if env['standalone']: |
| 297 | alias = arm_compute_env.Alias("arm_compute", [arm_compute_a]) |
| 298 | else: |
| 299 | alias = arm_compute_env.Alias("arm_compute", [arm_compute_a, arm_compute_so]) |
| 300 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame] | 301 | Default(alias) |
| 302 | |
Kaizen | 8938bd3 | 2017-09-28 14:38:23 +0100 | [diff] [blame] | 303 | if env['standalone']: |
| 304 | Depends([alias,arm_compute_core_a], generate_embed) |
| 305 | else: |
| 306 | Depends([alias,arm_compute_core_so, arm_compute_core_a], generate_embed) |