This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new da61d29f99d [improve](cloud) support arm compilation in cloud mode 
(#42467) (#43377)
da61d29f99d is described below

commit da61d29f99de7ce128b720e68817760f26cfb0db
Author: Luwei <[email protected]>
AuthorDate: Thu Nov 7 10:10:52 2024 +0800

    [improve](cloud) support arm compilation in cloud mode (#42467) (#43377)
    
    pick master #42467
    
    Azure is not supported yet. You need to export DISABLE_BUILD_AZURE=ON &&
    sh build.sh --cloud when compiling.
---
 build.sh             |  6 ------
 cloud/CMakeLists.txt | 44 ++++++++++++++++++++++++++++----------------
 tools/fdb/fdb_ctl.sh | 38 ++++++++++++++++++++++++++++----------
 3 files changed, 56 insertions(+), 32 deletions(-)

diff --git a/build.sh b/build.sh
index 1da5df76bb2..db9a2c8d4c0 100755
--- a/build.sh
+++ b/build.sh
@@ -271,12 +271,6 @@ else
     fi
 fi
 
-ARCH="$(uname -m)"
-if [[ "${ARCH}" == "aarch64" ]]; then
-    echo "WARNING: Cloud module is not supported on ARM platform, will skip 
building it."
-    BUILD_CLOUD=0
-fi
-
 if [[ "${HELP}" -eq 1 ]]; then
     usage
 fi
diff --git a/cloud/CMakeLists.txt b/cloud/CMakeLists.txt
index 32e60f7bfb5..a8eccf60896 100644
--- a/cloud/CMakeLists.txt
+++ b/cloud/CMakeLists.txt
@@ -413,30 +413,42 @@ endif ()
 
 # Add libs if needed, download to current dir -- ${BUILD_DIR}
 set(FDB_LIB "fdb_lib_7_1_23.tar.xz")
+if (ARCH_AARCH64)
+    set(FDB_LIB "fdb_lib_7_1_57.aarch64.tar.xz")
+endif ()
 file(GLOB RELEASE_FILE_LIST LIST_DIRECTORIES false "/etc/*release*")
 execute_process(COMMAND "cat" ${RELEASE_FILE_LIST}
                 RESULT_VARIABLE CAT_RET_CODE
                 OUTPUT_VARIABLE CAT_RET_CONTENT)
 string(TOUPPER "${CAT_RET_CONTENT}" CAT_RET_CONTENT)
-if ("${CAT_RET_CONTENT}" MATCHES "UBUNTU")
-    message("Ubuntu OS")
-    SET(OS_RELEASE "Ubuntu")
-    set(FDB_LIB_URL 
"https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/ubuntu/";)
-    string(APPEND FDB_LIB_URL "${FDB_LIB}")
-    set(FDB_LIB_MD5SUM "a00fe45da95cfac4e0caffa274bb2b30")
-else()
-    # If it is not ubuntu, it is regarded as centos by default
-    message("Centos OS")
-    SET(OS_RELEASE "Centos")
-    set(FDB_LIB_URL 
"https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/centos/";)
-    string(APPEND FDB_LIB_URL "${FDB_LIB}")
-    set(FDB_LIB_MD5SUM "f9839a564849c0232a351143b4340de0")
+
+if (ARCH_AARCH64)
+        message("Centos OS")
+        SET(OS_RELEASE "Centos")
+        set(FDB_LIB_URL 
"https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/aarch64/";)
+        string(APPEND FDB_LIB_URL "${FDB_LIB}")
+        set(FDB_LIB_MD5SUM "2d01a431b7a7465077e4ae5520f89693")
+else ()
+    if ("${CAT_RET_CONTENT}" MATCHES "UBUNTU")
+        message("Ubuntu OS")
+        SET(OS_RELEASE "Ubuntu")
+        set(FDB_LIB_URL 
"https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/ubuntu/";)
+        string(APPEND FDB_LIB_URL "${FDB_LIB}")
+        set(FDB_LIB_MD5SUM "a00fe45da95cfac4e0caffa274bb2b30")
+    else()
+        # If it is not ubuntu, it is regarded as centos by default
+        message("Centos OS")
+        SET(OS_RELEASE "Centos")
+        set(FDB_LIB_URL 
"https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/centos/";)
+        string(APPEND FDB_LIB_URL "${FDB_LIB}")
+        set(FDB_LIB_MD5SUM "f9839a564849c0232a351143b4340de0")
+    endif()
 endif()
 
 if (NOT EXISTS "${THIRDPARTY_SRC}/${FDB_LIB}")
     file(MAKE_DIRECTORY ${THIRDPARTY_SRC})
-    execute_process(COMMAND "curl --retry 10 --retry-delay 2 --retry-max-time 
30" "${FDB_LIB_URL}"
-                            "-o" "${THIRDPARTY_SRC}/${FDB_LIB}" "-k"
+    execute_process(COMMAND curl --retry 10 --retry-delay 2 --retry-max-time 
30 ${FDB_LIB_URL}
+                            -o ${THIRDPARTY_SRC}/${FDB_LIB} -k
                     RESULTS_VARIABLE DOWNLOAD_RET)
     if (NOT ${DOWNLOAD_RET} STREQUAL "0")
         execute_process(COMMAND "rm" "-rf" "${THIRDPARTY_SRC}/${FDB_LIB}")
@@ -454,7 +466,7 @@ if (NOT EXISTS ${THIRDPARTY_DIR}/include/foundationdb)
         execute_process(COMMAND "rm" "-rf" "${THIRDPARTY_SRC}/${FDB_LIB}")
         message(FATAL_ERROR "${THIRDPARTY_SRC}/${FDB_LIB} md5sum check failed, 
remove it")
     endif ()
-    execute_process(COMMAND "tar" "xf" "${THIRDPARTY_SRC}/${FDB_LIB}" "-C" 
"${THIRDPARTY_DIR}/")
+    execute_process(COMMAND tar xf ${THIRDPARTY_SRC}/${FDB_LIB} -C 
${THIRDPARTY_DIR}/)
 endif ()
 
 # enable glog custom prefix
diff --git a/tools/fdb/fdb_ctl.sh b/tools/fdb/fdb_ctl.sh
index 09aaaaf3f2a..5a334faae35 100755
--- a/tools/fdb/fdb_ctl.sh
+++ b/tools/fdb/fdb_ctl.sh
@@ -81,17 +81,35 @@ function download_fdb() {
         return
     fi
 
-    local 
URL="https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/";
-    local TMP="${FDB_PKG_DIR}-tmp"
-
-    rm -rf "${TMP}"
-    mkdir -p "${TMP}"
+    arch=$(uname -m)
+    if [[ "${arch}" == "x86_64" ]]; then
+        local 
URL="https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}/";
+        local TMP="${FDB_PKG_DIR}-tmp"
+
+        rm -rf "${TMP}"
+        mkdir -p "${TMP}"
+
+        wget "${URL}/fdbbackup.x86_64" -O "${TMP}/fdbbackup"
+        wget "${URL}/fdbserver.x86_64" -O "${TMP}/fdbserver"
+        wget "${URL}/fdbcli.x86_64" -O "${TMP}/fdbcli"
+        wget "${URL}/fdbmonitor.x86_64" -O "${TMP}/fdbmonitor"
+        wget "${URL}/libfdb_c.x86_64.so" -O "${TMP}/libfdb_c.x86_64.so"
+    elif [[ "${arch}" == "aarch64" ]]; then
+        local 
URL="https://doris-build.oss-cn-beijing.aliyuncs.com/thirdparty/fdb/aarch64";
+        local TMP="${FDB_PKG_DIR}-tmp"
+
+        rm -rf "${TMP}"
+        mkdir -p "${TMP}"
+
+        wget "${URL}/fdbbackup" -O "${TMP}/fdbbackup"
+        wget "${URL}/fdbserver" -O "${TMP}/fdbserver"
+        wget "${URL}/fdbcli" -O "${TMP}/fdbcli"
+        wget "${URL}/fdbmonitor" -O "${TMP}/fdbmonitor"
+        wget "${URL}/libfdb_c.aarch64.so" -O "${TMP}/libfdb_c.aarch64.so"
+    else
+        echo "Unsupported architecture: ""${arch}"
+    fi
 
-    wget "${URL}/fdbbackup.x86_64" -O "${TMP}/fdbbackup"
-    wget "${URL}/fdbserver.x86_64" -O "${TMP}/fdbserver"
-    wget "${URL}/fdbcli.x86_64" -O "${TMP}/fdbcli"
-    wget "${URL}/fdbmonitor.x86_64" -O "${TMP}/fdbmonitor"
-    wget "${URL}/libfdb_c.x86_64.so" -O "${TMP}/libfdb_c.x86_64.so"
     chmod +x "${TMP}"/fdb*
 
     mv "${TMP}" "${FDB_PKG_DIR}"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to