arm_compute v18.01
Change-Id: I9bfa178c2e38bfd5fc812e62aab6760d87748e05
diff --git a/SConstruct b/SConstruct
index 090b942..402bbb4 100644
--- a/SConstruct
+++ b/SConstruct
@@ -49,7 +49,7 @@
BoolVariable("opencl", "Enable OpenCL support", True),
BoolVariable("neon", "Enable Neon support", False),
BoolVariable("gles_compute", "Enable OpenGL ES Compute Shader support", False),
- BoolVariable("embed_kernels", "Embed OpenCL kernels and OpenGL ES compute shaders in library binary", False),
+ BoolVariable("embed_kernels", "Embed OpenCL kernels and OpenGL ES compute shaders in library binary", True),
BoolVariable("set_soname", "Set the library's soname and shlibversion (requires SCons 2.4 or above)", False),
BoolVariable("openmp", "Enable OpenMP backend", False),
BoolVariable("cppthreads", "Enable C++11 threads backend", True),
@@ -86,7 +86,15 @@
env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP'])
-if os.environ.get('CXX', 'g++') == 'clang++':
+default_cpp_compiler = 'g++' if env['os'] != 'android' else 'clang++'
+default_c_compiler = 'gcc' if env['os'] != 'android' else 'clang'
+cpp_compiler = os.environ.get('CXX', default_cpp_compiler)
+c_compiler = os.environ.get('CC', default_c_compiler)
+
+if env['os'] == 'android' and ( cpp_compiler != 'clang++' or c_compiler != 'clang'):
+ print "WARNING: Only clang is officially supported to build the Compute Library for Android"
+
+if cpp_compiler == 'clang++':
env.Append(CXXFLAGS = ['-Wno-format-nonliteral','-Wno-deprecated-increment-bool','-Wno-vla-extension','-Wno-mismatched-tags'])
else:
env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel'])
@@ -95,7 +103,7 @@
env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])
if env['openmp']:
- if os.environ.get('CXX', 'g++') == 'clang++':
+ if cpp_compiler == 'clang++':
print "Clang does not support OpenMP. Use scheduler=cpp."
Exit(1)
@@ -128,7 +136,7 @@
elif env['arch'] == 'arm64-v8.2-a':
env.Append(CPPDEFINES = ['ARM_COMPUTE_AARCH64_V8_2'])
- if os.environ.get('CXX', 'g++') == 'clang++':
+ if cpp_compiler == 'clang++':
env.Append(CXXFLAGS = ['-fno-integrated-as'])
if env['os'] == 'linux':
@@ -147,8 +155,8 @@
if env['build'] == 'native':
prefix = ""
-env['CC'] = prefix + os.environ.get('CC', 'gcc')
-env['CXX'] = prefix + os.environ.get('CXX', 'g++')
+env['CC'] = prefix + c_compiler
+env['CXX'] = prefix + cpp_compiler
env['LD'] = prefix + "ld"
env['AS'] = prefix + "as"
env['AR'] = prefix + "ar"
@@ -161,7 +169,7 @@
print("ERROR: Compiler '%s' not found" % env['CXX'])
Exit(1)
- if os.environ.get('CXX','g++') == 'g++':
+ if cpp_compiler == 'g++':
if env['arch'] == 'arm64-v8.2-a' and not version_at_least(compiler_ver, '6.2.1'):
print "GCC 6.2.1 or newer is required to compile armv8.2-a code"
Exit(1)