Skip to content

Commit

Permalink
ARROW-8420: [C++] Distinguish ARMv7 from ARMv8 in SetupCxxFlags.cmake
Browse files Browse the repository at this point in the history
ARMv7 machines may not be that practical for data processing purposes, but the project should at least build there.

Closes #6914 from wesm/ARROW-8420

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
  • Loading branch information
wesm committed Apr 13, 2020
1 parent f1faade commit e185f74
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cpp/cmake_modules/SetupCxxFlags.cmake
Expand Up @@ -20,8 +20,13 @@
include(CheckCXXCompilerFlag)
# Get cpu architecture
set(ARROW_CPU_FLAG "x86")

message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")

if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64")
set(ARROW_CPU_FLAG "arm")
set(ARROW_CPU_FLAG "armv8")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7")
set(ARROW_CPU_FLAG "armv7")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc")
set(ARROW_CPU_FLAG "ppc")
endif()
Expand All @@ -46,7 +51,7 @@ elseif(ARROW_CPU_FLAG STREQUAL "ppc")
# power compiler flags, gcc/clang only
set(ARROW_ALTIVEC_FLAG "-maltivec")
check_cxx_compiler_flag(${ARROW_ALTIVEC_FLAG} CXX_SUPPORTS_ALTIVEC)
elseif(ARROW_CPU_FLAG STREQUAL "arm")
elseif(ARROW_CPU_FLAG STREQUAL "armv8")
# Arm64 compiler flags, gcc/clang only
set(ARROW_ARMV8_ARCH_FLAG "-march=${ARROW_ARMV8_ARCH}")
check_cxx_compiler_flag(${ARROW_ARMV8_ARCH_FLAG} CXX_SUPPORTS_ARMV8_ARCH)
Expand Down Expand Up @@ -328,7 +333,7 @@ if(ARROW_CPU_FLAG STREQUAL "ppc" AND ARROW_USE_SIMD)
endif()
endif()

if(ARROW_CPU_FLAG STREQUAL "arm")
if(ARROW_CPU_FLAG STREQUAL "armv8")
if(NOT CXX_SUPPORTS_ARMV8_ARCH)
message(FATAL_ERROR "Unsupported arch flag: ${ARROW_ARMV8_ARCH_FLAG}.")
endif()
Expand Down

0 comments on commit e185f74

Please sign in to comment.