Skip to content

Commit cdabab7

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

36 files changed

Lines changed: 941 additions & 533 deletions

.github/workflows/clang_test.yaml

Lines changed: 20 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,21 @@ 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+
env:
66+
CC: clang
67+
CXX: clang++
68+
run: ci/scripts/build_paimon.sh $(pwd) false true

.github/workflows/gcc_test.yaml

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

3232
jobs:
33-
gcc-test:
33+
gcc-test-ubuntu:
34+
name: AMD64 Ubuntu 24.04
3435
runs-on: ubuntu-24.04
3536
timeout-minutes: 120
3637
strategy:
@@ -46,3 +47,20 @@ jobs:
4647
CC: gcc-14
4748
CXX: g++-14
4849
run: ci/scripts/build_paimon.sh $(pwd)
50+
gcc-test-macos:
51+
name: AARCH64 MacOS 26
52+
runs-on: macos-26
53+
timeout-minutes: 120
54+
strategy:
55+
fail-fast: false
56+
steps:
57+
- name: Checkout paimon-cpp
58+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
59+
with:
60+
lfs: true
61+
- name: Build Paimon
62+
shell: bash
63+
env:
64+
CC: gcc-14
65+
CXX: g++-14
66+
run: ci/scripts/build_paimon.sh $(pwd)

CMakeLists.txt

Lines changed: 73 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,82 @@ 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"
374+
paimon_file_index_static
375+
paimon_global_index_static
376+
paimon_local_file_system_static
377+
paimon_mock_file_format_static
378+
paimon_parquet_file_format_shared
379+
paimon_blob_file_format_shared)
380+
else()
381+
set(TEST_STATIC_LINK_LIBS
382+
"-Wl,--whole-archive"
383+
paimon_file_index_static
384+
paimon_global_index_static
385+
paimon_local_file_system_static
386+
paimon_mock_file_format_static
387+
"-Wl,--no-whole-archive"
388+
"-Wl,--no-as-needed"
389+
paimon_parquet_file_format_shared
390+
paimon_blob_file_format_shared
391+
"-Wl,--as-needed")
392+
endif()
377393
378394
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")
395+
if(APPLE)
396+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
397+
else()
398+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
399+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
400+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
401+
endif()
382402
endif()
383403
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")
404+
if(APPLE)
405+
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
406+
else()
407+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
408+
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
409+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
410+
endif()
387411
endif()
388412
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")
413+
if(APPLE)
414+
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
415+
else()
416+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
417+
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
418+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
419+
endif()
392420
endif()
393421
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")
422+
if(APPLE)
423+
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
424+
else()
425+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
426+
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
427+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
428+
endif()
397429
endif()
398430
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")
431+
if(APPLE)
432+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
433+
else()
434+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
435+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
436+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
437+
endif()
402438
endif()
403439
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")
440+
if(APPLE)
441+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
442+
else()
443+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
444+
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
445+
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
446+
endif()
407447
endif()
408448
endif()
409449

ci/scripts/build_paimon.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,28 @@ 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+
else
40+
CMAKE_ARGS=(
41+
"-G Ninja"
42+
"-DCMAKE_BUILD_TYPE=${build_type}"
43+
"-DPAIMON_BUILD_TESTS=ON"
44+
"-DPAIMON_ENABLE_LANCE=ON"
45+
"-DPAIMON_ENABLE_JINDO=ON"
46+
"-DPAIMON_ENABLE_LUMINA=ON"
47+
"-DPAIMON_ENABLE_LUCENE=ON"
48+
)
49+
fi
3550

3651
if [[ "${enable_sanitizer}" == "true" ]]; then
3752
CMAKE_ARGS+=(

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ 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")
78+
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-global-constructors")
7979
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-missing-braces")
8080
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-parameter")
8181
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unknown-warning-option")

0 commit comments

Comments
 (0)