summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-01-24 16:23:15 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-01-24 16:23:15 +0000
commitf45d5a9be1bf4d315a227b80617582b8eb4214d2 (patch)
tree29f24fc5f51448e831080d76eef3ac75d43c1934 /SConstruct
parent6943bb00e79fe2ea4c127dc04b3440c5b0b29ce0 (diff)
downloadarmcl-f45d5a9be1bf4d315a227b80617582b8eb4214d2.tar.gz
armcl-f45d5a9be1bf4d315a227b80617582b8eb4214d2.tar.bz2
armcl-f45d5a9be1bf4d315a227b80617582b8eb4214d2.zip
arm_compute v18.01
Change-Id: I9bfa178c2e38bfd5fc812e62aab6760d87748e05
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct22
1 files changed, 15 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct
index 090b94200..402bbb41e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -49,7 +49,7 @@ vars.AddVariables(
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(CXXFLAGS = ['-Wno-deprecated-declarations','-Wall','-DARCH_ARM',
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 @@ if env['cppthreads']:
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-v8a':
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 @@ elif env['arch'] == 'x86_64':
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 @@ if not GetOption("help"):
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)