Lines Matching full:env

63 def update_data_type_layout_flags(env, data_types, data_layouts):
66 env.Append(CXXFLAGS = ['-DENABLE_FP16_KERNELS'])
68 env.Append(CXXFLAGS = ['-DENABLE_FP32_KERNELS'])
70 env.Append(CXXFLAGS = ['-DENABLE_QASYMM8_KERNELS'])
72 env.Append(CXXFLAGS = ['-DENABLE_QASYMM8_SIGNED_KERNELS'])
74 env.Append(CXXFLAGS = ['-DENABLE_QSYMM16_KERNELS'])
76 env.Append(CXXFLAGS = ['-DENABLE_INTEGER_KERNELS'])
80 env.Append(CXXFLAGS = ['-DENABLE_NHWC_KERNELS'])
82 env.Append(CXXFLAGS = ['-DENABLE_NCHW_KERNELS'])
84 return env
144 env = Environment(variables=vars, ENV = os.environ)
147 build_path = env['build_dir']
149 if not env['build_dir'].startswith('/'):
155 install_path = env['install_dir']
157 if not env['install_dir'].startswith('/') and install_path != "":
160 env.Append(LIBPATH = [build_path])
161 Export('env')
168 return env.Install( "%s/lib/" % install_path, lib)
173 return env.Install( "%s/bin/" % install_path, bin)
177 return env.Install( "%s/include/" % install_path, inc)
182 Help(vars.GenerateHelpText(env))
184 if 'armv7a' in env['arch'] and env['os'] == 'android':
187 if env['linker_script'] and env['os'] != 'bare_metal':
191 if env['build'] == "embed_only":
195 if env['neon'] and 'x86' in env['arch']:
199 if env['set_soname'] and not version_at_least(SCons.__version__, "2.4"):
204 if env['os'] == 'bare_metal':
205 if env['cppthreads'] or env['openmp']:
209 if env['opencl'] and env['embed_kernels'] and env['compress_kernels'] and env['os'] not in ['androi…
213 if not env['exceptions']:
214 if env['opencl']:
218 env.Append(CPPDEFINES = ['ARM_COMPUTE_EXCEPTIONS_DISABLED'])
219 env.Append(CXXFLAGS = ['-fno-exceptions'])
221 env.Append(CXXFLAGS = ['-DARCH_ARM',
227 if not 'windows' in env['os']:
228 env.Append(CXXFLAGS = ['-Wall','-std=c++14', '-pedantic' ])
230 env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP'])
240 default_cpp_compiler = cpp_tool[env['os']]
241 default_c_compiler = c_tool[env['os']]
245 if env['os'] == 'android' and ( 'clang++' not in cpp_compiler or 'clang' not in c_compiler ):
249 env.Append(CXXFLAGS = ['-Wno-vla-extension'])
252 elif not 'windows' in env['os']:
253env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel','-Wno-misleading-inden…
257 env.Append(CXXFLAGS = ['-C'])
259 if env['cppthreads']:
260 env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])
262 if env['openmp']:
263 env.Append(CPPDEFINES = [('ARM_COMPUTE_OPENMP_SCHEDULER', 1)])
264 env.Append(CXXFLAGS = ['-fopenmp'])
265 env.Append(LINKFLAGS = ['-fopenmp'])
268 if env['estate'] == 'auto':
269 if 'v7a' in env['arch']:
270 env['estate'] = '32'
272 env['estate'] = '64'
275 if 'arm64' in env['arch']:
276 env['estate'] = '64'
278 if 'v7a' in env['estate'] and env['estate'] == '64':
282 env.Append(CPPDEFINES = ['ENABLE_NEON', 'ARM_COMPUTE_ENABLE_NEON'])
284 if 'sve' in env['arch']:
285 env.Append(CPPDEFINES = ['ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE'])
286 if 'sve2' in env['arch']:
287 env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVE2'])
289 if 'sme' in env['arch']:
290 env.Append(CPPDEFINES = ['ENABLE_SME', 'ARM_COMPUTE_ENABLE_SME'])
291 if 'sme2' in env['arch']:
292 env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SME2'])
295 if env['multi_isa']:
297 if 'v8' not in env['arch']:
301 if 'v8.6-a' in env['arch']:
302 if "disable_mmla_fp" not in env['custom_options']:
303 env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVEF32MM'])
305env.Append(CXXFLAGS = ['-march=armv8.2-a+fp16']) # explicitly enable fp16 extension otherwise __AR…
309 if 'v7a' in env['arch']:
310 env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
311 if (env['os'] == 'android' or env['os'] == 'tizen') and not 'hf' in env['arch']:
312 env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
314 env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
315 elif 'v8.6-a' in env['arch']:
316 if 'armv8.6-a-sve2' in env['arch']:
317 env.Append(CXXFLAGS = ['-march=armv8.6-a+sve2'])
318 elif 'armv8.6-a-sve' == env['arch']:
319 env.Append(CXXFLAGS = ['-march=armv8.6-a+sve'])
320 elif 'armv8.6-a' == env['arch']:
321 env.Append(CXXFLAGS = ['-march=armv8.6-a+fp16'])
323env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_I8MM', 'ARM_COMPUTE_ENABLE_BF16','ARM_COMPUTE_ENABLE_…
324 if "disable_mmla_fp" not in env['custom_options']:
325 env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVEF32MM'])
326 elif 'v8' in env['arch']:
328 if 'sve2' in env['arch']:
329 env.Append(CXXFLAGS = ['-march=armv8.2-a+sve2+fp16+dotprod'])
330 elif 'sve' in env['arch']:
331 env.Append(CXXFLAGS = ['-march=armv8.2-a+sve+fp16+dotprod'])
332 elif 'armv8r64' in env['arch']:
333 env.Append(CXXFLAGS = ['-march=armv8.4-a'])
334 elif 'v8.' in env['arch']:
335env.Append(CXXFLAGS = ['-march=armv8.2-a+fp16']) # explicitly enable fp16 extension otherwise __AR…
337 env.Append(CXXFLAGS = ['-march=armv8-a'])
339 if 'v8.' in env['arch']:
340 env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_FP16'])
342 elif 'x86' in env['arch']:
343 if env['estate'] == '32':
344 env.Append(CCFLAGS = ['-m32'])
345 env.Append(LINKFLAGS = ['-m32'])
347 env.Append(CXXFLAGS = ['-fPIC'])
348 env.Append(CCFLAGS = ['-m64'])
349 env.Append(LINKFLAGS = ['-m64'])
355 if 'x86' not in env['arch']:
356 if env['estate'] == '32':
357 if env['os'] == 'linux':
358 …auto_toolchain_prefix = "arm-linux-gnueabihf-" if 'v7' in env['arch'] else "armv8l-linux-gnueabihf…
359 elif env['os'] == 'bare_metal':
361 elif env['os'] == 'android':
363 elif env['os'] == 'tizen':
365 elif env['estate'] == '64' and 'v8' in env['arch']:
366 if env['os'] == 'linux':
368 elif env['os'] == 'bare_metal':
370 elif env['os'] == 'android':
372 elif env['os'] == 'tizen':
375 if env['build'] == 'native' or env["toolchain_prefix"] == "":
377 elif env["toolchain_prefix"] == "auto":
380 toolchain_prefix = env["toolchain_prefix"]
382 if env['build'] == 'native' or env["compiler_prefix"] == "":
384 elif env["compiler_prefix"] == "auto":
387 compiler_prefix = env["compiler_prefix"]
389 env['CC'] = env['compiler_cache']+ " " + compiler_prefix + c_compiler
390 env['CXX'] = env['compiler_cache']+ " " + compiler_prefix + cpp_compiler
391 env['LD'] = toolchain_prefix + "ld"
392 env['AS'] = toolchain_prefix + "as"
394 if env['os'] == 'windows':
395 env['AR'] = "llvm-lib"
396 env['RANLIB'] = "llvm-ranlib"
398 env['AR'] = toolchain_prefix + "ar"
400 env['RANLIB'] = toolchain_prefix + "ranlib"
403 print("CC", env['CC'])
404 print("CXX", env['CXX'])
408 if env['os'] == 'windows':
411 compiler_ver = check_output(env['CXX'].split() + ["-dumpversion"]).decode().strip()
413 print("ERROR: Compiler '%s' not found" % env['CXX'])
419 if env['arch'] == 'arm64-v8.2-a' and not version_at_least(compiler_ver, '6.2.1'):
422 elif env['arch'] == 'arm64-v8a' and not version_at_least(compiler_ver, '4.9'):
427 env.Append(CXXFLAGS = ['-Wno-ignored-attributes'])
430 env.Append(CXXFLAGS = ['-Wno-array-bounds'])
432 if not version_at_least(compiler_ver, '7.0.0') and env['os'] == 'bare_metal':
433 env.Append(LINKFLAGS = ['-fstack-protector-strong'])
436 if 'clang++' in cpp_compiler and env['os'] == 'android':
439 env['ndk_above_r21'] = True
441 if env['openmp']:
442 env.Append(LINKFLAGS = ['-static-openmp'])
449 env.Append(CXXFLAGS = ['-no-integrated-as'])
451 if env['high_priority'] and env['build_config']:
455 if not env['high_priority'] and not env['build_config']:
456 env.Append(CPPDEFINES = ['ARM_COMPUTE_GRAPH_ENABLED'])
462 if env['high_priority']:
465 elif env['build_config']:
466 data_types, data_layouts = read_build_config_json(env['build_config'])
468 data_types = env['data_type_support']
469 data_layouts = env['data_layout_support']
471 env = update_data_type_layout_flags(env, data_types, data_layouts)
473 if env['standalone']:
474 if not 'windows' in env['os']:
475 env.Append(CXXFLAGS = ['-fPIC'])
476 env.Append(LINKFLAGS = ['-static-libgcc','-static-libstdc++'])
478 if env['Werror']:
479 env.Append(CXXFLAGS = ['-Werror'])
481 if env['os'] == 'android':
482 env.Append(CPPDEFINES = ['ANDROID'])
483 env.Append(LINKFLAGS = ['-pie', '-static-libstdc++', '-ldl'])
484 elif env['os'] == 'bare_metal':
485 env.Append(LINKFLAGS = ['-static'])
486 env.Append(CXXFLAGS = ['-fPIC'])
487 if env['specs_file'] == "":
488 env.Append(LINKFLAGS = ['-specs=rdimon.specs'])
489 env.Append(CPPDEFINES = ['NO_MULTI_THREADING'])
490 env.Append(CPPDEFINES = ['BARE_METAL'])
491 if env['os'] == 'linux' and env['arch'] == 'armv7a':
492 env.Append(CXXFLAGS = [ '-Wno-psabi' ])
493 if env['os'] == 'windows':
494 env.Append(CXXFLAGS = [ '/std:c++14','/EHa'])
495env.Append(CXXFLAGS = [ '-Wno-c++98-compat', '-Wno-covered-switch-default','-Wno-c++98-compat-peda…
496 env.Append(CXXFLAGS = [ '-Wno-shorten-64-to-32', '-Wno-sign-conversion','-Wno-documentation'])
497env.Append(CXXFLAGS = [ '-Wno-extra-semi-stmt', '-Wno-float-equal','-Wno-implicit-int-conversion'])
498env.Append(CXXFLAGS = [ '-Wno-documentation-pedantic', '-Wno-extra-semi','-Wno-shadow-field-in-con…
499 env.Append(CXXFLAGS = [ '-Wno-float-conversion', '-Wno-switch-enum','-Wno-comma'])
500env.Append(CXXFLAGS = [ '-Wno-implicit-float-conversion', '-Wno-deprecated-declarations','-Wno-old…
501env.Append(CXXFLAGS = [ '-Wno-zero-as-null-pointer-constant', '-Wno-inconsistent-missing-destructo…
502 env.Append(CXXFLAGS = [ '-Wno-asm-operand-widths'])
505 if env['specs_file'] != "":
506 env.Append(LINKFLAGS = ['-specs='+env['specs_file']])
508 if env['neon']:
509 env.Append(CPPDEFINES = ['ARM_COMPUTE_CPU_ENABLED'])
511 if env['opencl']:
512 env.Append(CPPDEFINES = ['ARM_COMPUTE_OPENCL_ENABLED'])
513 if env['os'] in ['bare_metal'] or env['standalone']:
517 if env["os"] not in ["windows","android", "bare_metal"] and (env['opencl'] or env['cppthreads']):
518 env.Append(LIBS = ['pthread'])
520 if env['os'] == 'openbsd':
521 env.Append(LIBS = ['c'])
522 env.Append(CXXFLAGS = ['-fPIC'])
524 if env['opencl']:
525 if env['embed_kernels']:
526 env.Append(CPPDEFINES = ['EMBEDDED_KERNELS'])
527 if env['compress_kernels']:
528 env.Append(CPPDEFINES = ['ARM_COMPUTE_COMPRESSED_KERNELS'])
529 env.Append(LIBS = ['z'])
531 if env['debug']:
532 env['asserts'] = True
533 if not 'windows' in env['os']:
534 env.Append(CXXFLAGS = ['-O0','-g','-gdwarf-2'])
536 env.Append(CXXFLAGS = ['-Z7','-MTd','-fms-compatibility','-fdelayed-template-parsing'])
537 env.Append(LINKFLAGS = ['-DEBUG'])
539 env.Append(CPPDEFINES = ['ARM_COMPUTE_DEBUG_ENABLED'])
541 if not 'windows' in env['os']:
542 env.Append(CXXFLAGS = ['-O3'])
545 env.Append(CXXFLAGS = ['-O2'])
547 if env['asserts']:
548 env.Append(CPPDEFINES = ['ARM_COMPUTE_ASSERTS_ENABLED'])
549 if not 'windows' in env['os']:
550 env.Append(CXXFLAGS = ['-fstack-protector-strong'])
552 if env['logging']:
553 env.Append(CPPDEFINES = ['ARM_COMPUTE_LOGGING_ENABLED'])
555 env.Append(CPPPATH = ['#/include', "#"])
556 env.Append(CXXFLAGS = env['extra_cxx_flags'])
557 env.Append(LINKFLAGS = env['extra_link_flags'])
569 if env['examples'] and (env['build_config'] or env['high_priority']):
573 if env['examples'] and env['exceptions']:
574 if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':
579 if env['exceptions']:
580 if env['build_config'] or env['high_priority']:
583 if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':