diff options
author | Jakub Sujak <jakub.sujak@arm.com> | 2023-06-21 09:45:41 +0100 |
---|---|---|
committer | Jakub Sujak <jakub.sujak@arm.com> | 2023-06-29 12:17:11 +0000 |
commit | 7a698a38c625047bd558027d4cbc493f063739f5 (patch) | |
tree | 1622318aee018d0b843c0378fb464723a513cada /SConstruct | |
parent | cdb1ee068110111619b9e85b8477b6064c3797ac (diff) | |
download | ComputeLibrary-7a698a38c625047bd558027d4cbc493f063739f5.tar.gz |
Improvements to building CKW
* Always link Compute Kernel Writer statically to Compute Library
* Move CMake logic to be set on libckw target
* Build CKW in parallel from SCons
Resolves: COMPMID-6297
Change-Id: I247a1f6ddf84a58032358a196574866b857d9bdc
Signed-off-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9834
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/SConstruct b/SConstruct index 419fa33558..48f17472d3 100644 --- a/SConstruct +++ b/SConstruct @@ -423,7 +423,7 @@ print("CXX", env['CXX']) """Build the Compute Kernel Writer subproject""" if env['ckw']: - # Strip ccache from CC and CXX + # Strip ccache prefix from CC and CXX to obtain only the target triple CKW_CC = env['CC'].replace(env['compiler_cache'] + " ", "") CKW_CXX = env['CXX'].replace(env['compiler_cache'] + " ", "") CKW_CCACHE = 1 if env['compiler_cache'] else 0 @@ -452,20 +452,17 @@ if env['ckw']: CKW_CCACHE=CKW_CCACHE ) - CKW_CMAKE_CONFIGURE_STATIC = CKW_CMAKE_CMD + "-DBUILD_SHARED_LIBS=OFF" - CKW_CMAKE_CONFIGURE_SHARED = CKW_CMAKE_CMD + "-DBUILD_SHARED_LIBS=ON" - CKW_CMAKE_BUILD = "cmake --build {CKW_BUILD_DIR}".format(CKW_BUILD_DIR=CKW_BUILD_DIR) + # Configure CKW static objects with -fPIC (CMAKE_POSITION_INDEPENDENT_CODE) option to enable linking statically to ACL + CKW_CMAKE_CONFIGURE_STATIC = CKW_CMAKE_CMD + "-DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON" + CKW_CMAKE_BUILD = "cmake --build {CKW_BUILD_DIR} -j{NUM_JOBS}".format(CKW_BUILD_DIR=CKW_BUILD_DIR, + NUM_JOBS=GetOption('num_jobs') + ) # Build Compute Kernel Writer Static Library subprocess.check_call(CKW_CMAKE_CONFIGURE_STATIC, stderr=subprocess.STDOUT, shell=True) subprocess.check_call(CKW_CMAKE_BUILD, stderr=subprocess.STDOUT, shell=True) - # Build Compute Kernel Writer Shared Library - subprocess.check_call(CKW_CMAKE_CONFIGURE_SHARED, stderr=subprocess.STDOUT, shell=True) - subprocess.check_call(CKW_CMAKE_BUILD, stderr=subprocess.STDOUT, shell=True) - - # Linking library - env.Append(LIBS = ['ckw']) + # Let ACL know where to find CKW headers env.Append(CPPPATH = CKW_INCLUDE_DIR) if not GetOption("help"): |