Skip to content

Commit 8d46d38

Browse files
luwei16Your Name
authored andcommitted
[improve](cloud) support arm compilation in cloud mode (#42467)
Azure is not supported yet. You need to export DISABLE_BUILD_AZURE=ON && sh build.sh --cloud when compiling.
1 parent f43d9d9 commit 8d46d38

File tree

3 files changed

+56
-32
lines changed

3 files changed

+56
-32
lines changed

build.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,6 @@ else
271271
fi
272272
fi
273273

274-
ARCH="$(uname -m)"
275-
if [[ "${ARCH}" == "aarch64" ]]; then
276-
echo "WARNING: Cloud module is not supported on ARM platform, will skip building it."
277-
BUILD_CLOUD=0
278-
fi
279-
280274
if [[ "${HELP}" -eq 1 ]]; then
281275
usage
282276
fi

cloud/CMakeLists.txt

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -413,30 +413,42 @@ endif ()
413413

414414
# Add libs if needed, download to current dir -- ${BUILD_DIR}
415415
set(FDB_LIB "fdb_lib_7_1_23.tar.xz")
416+
if (ARCH_AARCH64)
417+
set(FDB_LIB "fdb_lib_7_1_57.aarch64.tar.xz")
418+
endif ()
416419
file(GLOB RELEASE_FILE_LIST LIST_DIRECTORIES false "/etc/*release*")
417420
execute_process(COMMAND "cat" ${RELEASE_FILE_LIST}
418421
RESULT_VARIABLE CAT_RET_CODE
419422
OUTPUT_VARIABLE CAT_RET_CONTENT)
420423
string(TOUPPER "${CAT_RET_CONTENT}" CAT_RET_CONTENT)
421-
if ("${CAT_RET_CONTENT}" MATCHES "UBUNTU")
422-
message("Ubuntu OS")
423-
SET(OS_RELEASE "Ubuntu")
424-
set(FDB_LIB_URL "https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/ubuntu/")
425-
string(APPEND FDB_LIB_URL "${FDB_LIB}")
426-
set(FDB_LIB_MD5SUM "a00fe45da95cfac4e0caffa274bb2b30")
427-
else()
428-
# If it is not ubuntu, it is regarded as centos by default
429-
message("Centos OS")
430-
SET(OS_RELEASE "Centos")
431-
set(FDB_LIB_URL "https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/centos/")
432-
string(APPEND FDB_LIB_URL "${FDB_LIB}")
433-
set(FDB_LIB_MD5SUM "f9839a564849c0232a351143b4340de0")
424+
425+
if (ARCH_AARCH64)
426+
message("Centos OS")
427+
SET(OS_RELEASE "Centos")
428+
set(FDB_LIB_URL "https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/aarch64/")
429+
string(APPEND FDB_LIB_URL "${FDB_LIB}")
430+
set(FDB_LIB_MD5SUM "2d01a431b7a7465077e4ae5520f89693")
431+
else ()
432+
if ("${CAT_RET_CONTENT}" MATCHES "UBUNTU")
433+
message("Ubuntu OS")
434+
SET(OS_RELEASE "Ubuntu")
435+
set(FDB_LIB_URL "https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/ubuntu/")
436+
string(APPEND FDB_LIB_URL "${FDB_LIB}")
437+
set(FDB_LIB_MD5SUM "a00fe45da95cfac4e0caffa274bb2b30")
438+
else()
439+
# If it is not ubuntu, it is regarded as centos by default
440+
message("Centos OS")
441+
SET(OS_RELEASE "Centos")
442+
set(FDB_LIB_URL "https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/centos/")
443+
string(APPEND FDB_LIB_URL "${FDB_LIB}")
444+
set(FDB_LIB_MD5SUM "f9839a564849c0232a351143b4340de0")
445+
endif()
434446
endif()
435447

436448
if (NOT EXISTS "${THIRDPARTY_SRC}/${FDB_LIB}")
437449
file(MAKE_DIRECTORY ${THIRDPARTY_SRC})
438-
execute_process(COMMAND "curl --retry 10 --retry-delay 2 --retry-max-time 30" "${FDB_LIB_URL}"
439-
"-o" "${THIRDPARTY_SRC}/${FDB_LIB}" "-k"
450+
execute_process(COMMAND curl --retry 10 --retry-delay 2 --retry-max-time 30 ${FDB_LIB_URL}
451+
-o ${THIRDPARTY_SRC}/${FDB_LIB} -k
440452
RESULTS_VARIABLE DOWNLOAD_RET)
441453
if (NOT ${DOWNLOAD_RET} STREQUAL "0")
442454
execute_process(COMMAND "rm" "-rf" "${THIRDPARTY_SRC}/${FDB_LIB}")
@@ -454,7 +466,7 @@ if (NOT EXISTS ${THIRDPARTY_DIR}/include/foundationdb)
454466
execute_process(COMMAND "rm" "-rf" "${THIRDPARTY_SRC}/${FDB_LIB}")
455467
message(FATAL_ERROR "${THIRDPARTY_SRC}/${FDB_LIB} md5sum check failed, remove it")
456468
endif ()
457-
execute_process(COMMAND "tar" "xf" "${THIRDPARTY_SRC}/${FDB_LIB}" "-C" "${THIRDPARTY_DIR}/")
469+
execute_process(COMMAND tar xf ${THIRDPARTY_SRC}/${FDB_LIB} -C ${THIRDPARTY_DIR}/)
458470
endif ()
459471

460472
# enable glog custom prefix

tools/fdb/fdb_ctl.sh

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,35 @@ function download_fdb() {
8181
return
8282
fi
8383

84-
local URL="https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/"
85-
local TMP="${FDB_PKG_DIR}-tmp"
86-
87-
rm -rf "${TMP}"
88-
mkdir -p "${TMP}"
84+
arch=$(uname -m)
85+
if [[ "${arch}" == "x86_64" ]]; then
86+
local URL="https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/"
87+
local TMP="${FDB_PKG_DIR}-tmp"
88+
89+
rm -rf "${TMP}"
90+
mkdir -p "${TMP}"
91+
92+
wget "${URL}/fdbbackup.x86_64" -O "${TMP}/fdbbackup"
93+
wget "${URL}/fdbserver.x86_64" -O "${TMP}/fdbserver"
94+
wget "${URL}/fdbcli.x86_64" -O "${TMP}/fdbcli"
95+
wget "${URL}/fdbmonitor.x86_64" -O "${TMP}/fdbmonitor"
96+
wget "${URL}/libfdb_c.x86_64.so" -O "${TMP}/libfdb_c.x86_64.so"
97+
elif [[ "${arch}" == "aarch64" ]]; then
98+
local URL="https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/aarch64"
99+
local TMP="${FDB_PKG_DIR}-tmp"
100+
101+
rm -rf "${TMP}"
102+
mkdir -p "${TMP}"
103+
104+
wget "${URL}/fdbbackup" -O "${TMP}/fdbbackup"
105+
wget "${URL}/fdbserver" -O "${TMP}/fdbserver"
106+
wget "${URL}/fdbcli" -O "${TMP}/fdbcli"
107+
wget "${URL}/fdbmonitor" -O "${TMP}/fdbmonitor"
108+
wget "${URL}/libfdb_c.aarch64.so" -O "${TMP}/libfdb_c.aarch64.so"
109+
else
110+
echo "Unsupported architecture: ""${arch}"
111+
fi
89112

90-
wget "${URL}/fdbbackup.x86_64" -O "${TMP}/fdbbackup"
91-
wget "${URL}/fdbserver.x86_64" -O "${TMP}/fdbserver"
92-
wget "${URL}/fdbcli.x86_64" -O "${TMP}/fdbcli"
93-
wget "${URL}/fdbmonitor.x86_64" -O "${TMP}/fdbmonitor"
94-
wget "${URL}/libfdb_c.x86_64.so" -O "${TMP}/libfdb_c.x86_64.so"
95113
chmod +x "${TMP}"/fdb*
96114

97115
mv "${TMP}" "${FDB_PKG_DIR}"

0 commit comments

Comments
 (0)