diff --git a/build.sh b/build.sh index 1da5df76bb2fdd..db9a2c8d4c03e0 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 32e60f7bfb5467..a8eccf60896756 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 09aaaaf3f2a0d8..5a334faae35077 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}"