From d68bb50ef3144db4ef8068caaa99c2714f539ed1 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Mon, 25 Oct 2021 11:01:05 -0700 Subject: [PATCH] Disable SVE when cross-compiling for M1 (#67114) Summary: Followup after https://github.com/pytorch/pytorch/issues/58653 It does not matter whether one compiles locally or cross-compiles - attempts to use SVE on M1 results in compiler crash as SVE ABI is not defined on MacOS Fixes #{issue number} Pull Request resolved: https://github.com/pytorch/pytorch/pull/67114 Reviewed By: VitalyFedyunin Differential Revision: D31869356 Pulled By: malfet fbshipit-source-id: 184e26ae40edc7ef7b703200b53ea7a15da74818 --- aten/src/ATen/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt index 7355f0d219d..b0e2f9aec35 100644 --- a/aten/src/ATen/CMakeLists.txt +++ b/aten/src/ATen/CMakeLists.txt @@ -327,8 +327,10 @@ if(NOT MSVC AND NOT EMSCRIPTEN AND NOT INTERN_BUILD_MOBILE) set(BUILD_GNUABI_LIBS OFF CACHE BOOL "Don't build sleef gnuabi libs" FORCE) set(BUILD_TESTS OFF CACHE BOOL "Don't build sleef tests" FORCE) set(OLD_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(DISABLE_SVE ON CACHE BOOL "Xcode's clang-12.5 crashes while trying to compile SVE code" FORCE) + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64") + set(DISABLE_SVE ON CACHE BOOL "Xcode's clang-12.5 crashes while trying to compile SVE code" FORCE) + endif() endif() if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 6.9 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 8)