From 8d2d40781c32d0365d20d0402f63f341aca267fe Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Sat, 21 Sep 2024 06:19:26 +0800 Subject: [PATCH] set CMAKE_SYSTEM_PROCESSOR in xnnpack.cmake (#22155) ### Description ### Motivation and Context By default, CMAKE_SYSTEM_PROCESSOR is same CMAKE_HOST_SYSTEM_PROCESSOR https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PROCESSOR.html KleidiAI uses CMAKE_SYSTEM_PROCESSOR to determine whether to include some arm64 ukernels. https://gitlab.arm.com/kleidi/kleidiai/-/blob/main/CMakeLists.txt#L134 We use Mac with Intel CPU to cross compile MAC with ARM in ios packaging pipeline So we need to make CMAKE_SYSTEM_PROCESSOR same with ORT_TARGET_PROCESSOR --- cmake/external/xnnpack.cmake | 3 +++ .../apple/default_full_apple_framework_build_settings.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake index 9519e4e6a7..26d56b1cbf 100644 --- a/cmake/external/xnnpack.cmake +++ b/cmake/external/xnnpack.cmake @@ -80,6 +80,9 @@ MESSAGE(STATUS "Building for ORT_TARGET_PROCESSOR: ${ORT_TARGET_PROCESSOR}") # KleidiAI is only used in Arm64 platform and not supported by MSVC, the details can be seen in # https://github.com/google/XNNPACK/blob/3b3f7b8a6668f6ab3b6ce33b9f1d1fce971549d1/CMakeLists.txt#L206C82-L206C117 if(ORT_TARGET_PROCESSOR MATCHES "^arm64.*" AND NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC") + # kleidiAI use CMAKE_SYSTEM_PROCESSOR to determine whether includes aarch64/arm64 ukernels + # https://gitlab.arm.com/kleidi/kleidiai/-/blob/main/CMakeLists.txt#L134 + set(CMAKE_SYSTEM_PROCESSOR arm64) FetchContent_Declare(kleidiai URL ${DEP_URL_kleidiai} URL_HASH SHA1=${DEP_SHA1_kleidiai}) onnxruntime_fetchcontent_makeavailable(kleidiai) set(KLEIDIAI_SOURCE_DIR ${kleidiai_SOURCE_DIR}) diff --git a/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json b/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json index f2d034dbfc..84d7e355ed 100644 --- a/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json +++ b/tools/ci_build/github/apple/default_full_apple_framework_build_settings.json @@ -24,7 +24,7 @@ ], "macosx": [ "--macos=MacOSX", - "--apple_deploy_target=13.3" + "--apple_deploy_target=11.0" ], "iphoneos": [ "--ios",