Skip to content

Commit e7e38f8

Browse files
committed
feat: support aarch64 architecture
1 parent 7c83b38 commit e7e38f8

34 files changed

Lines changed: 897 additions & 527 deletions

.github/workflows/clang_test.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ permissions:
3030
contents: read
3131

3232
jobs:
33-
clang-test:
33+
clang-test-ubuntu:
34+
name: AMD64 Ubuntu 24.04
3435
runs-on: ubuntu-24.04
3536
timeout-minutes: 120
3637
strategy:
@@ -47,3 +48,18 @@ jobs:
4748
CC: clang
4849
CXX: clang++
4950
run: ci/scripts/build_paimon.sh $(pwd) false true
51+
clang-test-macos:
52+
name: AARCH64 macOS 26
53+
runs-on: macos-26
54+
timeout-minutes: 120
55+
strategy:
56+
fail-fast: false
57+
steps:
58+
- name: Checkout paimon-cpp
59+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
60+
with:
61+
lfs: true
62+
fetch-depth: 0 # fetch all history for git diff in clang-tidy
63+
- name: Build Paimon
64+
shell: bash
65+
run: ci/scripts/build_paimon.sh $(pwd) false true

CMakeLists.txt

Lines changed: 72 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ option(PAIMON_ENABLE_AVRO "Whether to enable avro file format" ON)
5252
option(PAIMON_ENABLE_ORC "Whether to enable orc file format" ON)
5353
option(PAIMON_ENABLE_LANCE "Whether to enable lance file format" OFF)
5454
option(PAIMON_ENABLE_JINDO "Whether to enable jindo file system" OFF)
55-
option(PAIMON_ENABLE_LUMINA "Whether to enable lumina vector index" ON)
56-
option(PAIMON_ENABLE_LUCENE "Whether to enable lucene index" ON)
55+
option(PAIMON_ENABLE_LUMINA "Whether to enable lumina vector index" OFF)
56+
option(PAIMON_ENABLE_LUCENE "Whether to enable lucene index" OFF)
5757

5858
if(PAIMON_ENABLE_ORC)
5959
add_definitions(-DPAIMON_ENABLE_ORC)
@@ -334,8 +334,13 @@ add_compile_definitions("GLOG_USE_GLOG_EXPORT")
334334
335335
set(THREADS_PREFER_PTHREAD_FLAG ON)
336336
find_package(Threads REQUIRED)
337-
set(PAIMON_VERSION_SCRIPT_FLAGS
338-
"-Wl,--version-script=${CMAKE_SOURCE_DIR}/src/paimon/symbols.map")
337+
if(APPLE)
338+
set(PAIMON_VERSION_SCRIPT_FLAGS
339+
"-Wl,-exported_symbols_list,${CMAKE_SOURCE_DIR}/src/paimon/symbols.list")
340+
else()
341+
set(PAIMON_VERSION_SCRIPT_FLAGS
342+
"-Wl,--version-script=${CMAKE_SOURCE_DIR}/src/paimon/symbols.map")
343+
endif()
339344
340345
set(ENV{PAIMON_TEST_DATA} "${CMAKE_SOURCE_DIR}/test/test_data")
341346
@@ -363,47 +368,81 @@ if(PAIMON_BUILD_TESTS)
363368
include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
364369
include_directories("${CMAKE_SOURCE_DIR}/test/")
365370
366-
set(TEST_STATIC_LINK_LIBS
367-
"-Wl,--whole-archive"
368-
paimon_file_index_static
369-
paimon_global_index_static
370-
paimon_local_file_system_static
371-
paimon_mock_file_format_static
372-
"-Wl,--no-whole-archive"
373-
"-Wl,--no-as-needed"
374-
paimon_parquet_file_format_shared
375-
paimon_blob_file_format_shared
376-
"-Wl,--as-needed")
371+
if(APPLE)
372+
set(TEST_STATIC_LINK_LIBS
373+
"-Wl,-force_load,$<TARGET_FILE:paimon_file_index_static>"
374+
"-Wl,-force_load,$<TARGET_FILE:paimon_global_index_static>"
375+
"-Wl,-force_load,$<TARGET_FILE:paimon_local_file_system_static>"
376+
"-Wl,-force_load,$<TARGET_FILE:paimon_mock_file_format_static>"
377+
paimon_parquet_file_format_shared
378+
paimon_blob_file_format_shared)
379+
else()
380+
set(TEST_STATIC_LINK_LIBS
381+
"-Wl,--whole-archive"
382+
paimon_file_index_static
383+
paimon_global_index_static
384+
paimon_local_file_system_static
385+
paimon_mock_file_format_static
386+
"-Wl,--no-whole-archive"
387+
"-Wl,--no-as-needed"
388+
paimon_parquet_file_format_shared
389+
paimon_blob_file_format_shared
390+
"-Wl,--as-needed")
391+
endif()
377392
378393
if(PAIMON_ENABLE_LANCE)
379-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
380-
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
381-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
394+
if(APPLE)
395+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
396+
else()
397+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
398+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
399+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
400+
endif()
382401
endif()
383402
if(PAIMON_ENABLE_ORC)
384-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
385-
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
386-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
403+
if(APPLE)
404+
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
405+
else()
406+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
407+
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
408+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
409+
endif()
387410
endif()
388411
if(PAIMON_ENABLE_AVRO)
389-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
390-
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
391-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
412+
if(APPLE)
413+
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
414+
else()
415+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
416+
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
417+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
418+
endif()
392419
endif()
393420
if(PAIMON_ENABLE_JINDO)
394-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
395-
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
396-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
421+
if(APPLE)
422+
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
423+
else()
424+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
425+
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
426+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
427+
endif()
397428
endif()
398429
if(PAIMON_ENABLE_LUMINA)
399-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
400-
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
401-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
430+
if(APPLE)
431+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
432+
else()
433+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
434+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
435+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
436+
endif()
402437
endif()
403438
if(PAIMON_ENABLE_LUCENE)
404-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
405-
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
406-
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
439+
if(APPLE)
440+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
441+
else()
442+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
443+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
444+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
445+
endif()
407446
endif()
408447
endif()
409448

ci/scripts/build_paimon.sh

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,30 @@ build_dir=${1}/build
2525
mkdir ${build_dir}
2626
pushd ${build_dir}
2727

28-
CMAKE_ARGS=(
29-
"-G Ninja"
30-
"-DCMAKE_BUILD_TYPE=${build_type}"
31-
"-DPAIMON_BUILD_TESTS=ON"
32-
"-DPAIMON_ENABLE_LANCE=ON"
33-
"-DPAIMON_ENABLE_JINDO=ON"
34-
)
28+
is_macos() {
29+
[[ "${OSTYPE}" == "darwin"* ]]
30+
}
31+
32+
if is_macos; then
33+
CMAKE_ARGS=(
34+
"-G Ninja"
35+
"-DCMAKE_BUILD_TYPE=${build_type}"
36+
"-DPAIMON_BUILD_TESTS=ON"
37+
"-DPAIMON_ENABLE_JINDO=ON"
38+
)
39+
NPROCS=$(sysctl -n hw.ncpu)
40+
else
41+
CMAKE_ARGS=(
42+
"-G Ninja"
43+
"-DCMAKE_BUILD_TYPE=${build_type}"
44+
"-DPAIMON_BUILD_TESTS=ON"
45+
"-DPAIMON_ENABLE_LANCE=ON"
46+
"-DPAIMON_ENABLE_JINDO=ON"
47+
"-DPAIMON_ENABLE_LUMINA=ON"
48+
"-DPAIMON_ENABLE_LUCENE=ON"
49+
)
50+
NPROCS=$(nproc)
51+
fi
3552

3653
if [[ "${enable_sanitizer}" == "true" ]]; then
3754
CMAKE_ARGS+=(
@@ -41,8 +58,8 @@ if [[ "${enable_sanitizer}" == "true" ]]; then
4158
fi
4259

4360
cmake "${CMAKE_ARGS[@]}" ${source_dir}
44-
cmake --build . -- -j$(nproc)
45-
ctest --output-on-failure -j $(nproc)
61+
cmake --build . -- -j${NPROCS}
62+
ctest --output-on-failure -j ${NPROCS}
4663

4764
if [[ "${check_clang_tidy}" == "true" ]]; then
4865
cmake --build . --target check-clang-tidy

cmake_modules/BuildUtils.cmake

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,16 @@ function(add_paimon_lib LIB_NAME)
124124
target_link_libraries(${LIB_NAME}_shared
125125
PUBLIC "$<BUILD_INTERFACE:paimon_sanitizer_flags>")
126126

127-
target_link_options(${LIB_NAME}_shared
128-
PRIVATE
129-
-Wl,--exclude-libs,ALL
130-
-Wl,-Bsymbolic
131-
-Wl,-z,defs
132-
-Wl,--gc-sections)
127+
if(APPLE)
128+
target_link_options(${LIB_NAME}_shared PRIVATE -Wl,-dead_strip)
129+
else()
130+
target_link_options(${LIB_NAME}_shared
131+
PRIVATE
132+
-Wl,--exclude-libs,ALL
133+
-Wl,-Bsymbolic
134+
-Wl,-z,defs
135+
-Wl,--gc-sections)
136+
endif()
133137

134138
install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}
135139
EXPORT ${LIB_NAME}_targets

cmake_modules/SetupCxxFlags.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,17 @@ if("${BUILD_WARNING_LEVEL}" STREQUAL "CHECKIN")
7575
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
7676
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wextra")
7777
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wdocumentation")
78-
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wglobal-constructors")
7978
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-missing-braces")
8079
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-parameter")
8180
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unknown-warning-option")
8281
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-constant-logical-operand")
8382
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-deprecated-declarations")
8483
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-deprecated-builtins")
84+
if(APPLE)
85+
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-global-constructors")
86+
else()
87+
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wglobal-constructors")
88+
endif()
8589
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
8690
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
8791
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-conversion")

0 commit comments

Comments
 (0)