From 7a698a38c625047bd558027d4cbc493f063739f5 Mon Sep 17 00:00:00 2001 From: Jakub Sujak Date: Wed, 21 Jun 2023 09:45:41 +0100 Subject: 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 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9834 Reviewed-by: Viet-Hoa Do Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins Tested-by: Arm Jenkins --- SConstruct | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'SConstruct') 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"): -- cgit v1.2.1