From 99cca16fbc02a1e27dfd8a1d99575b6fbda0cd61 Mon Sep 17 00:00:00 2001 From: "joey.ljy" Date: Thu, 21 Mar 2024 20:20:22 +0800 Subject: [PATCH] Download source code archive directly for ubuntu and macos setup --- scripts/setup-centos8.sh | 12 ++++---- scripts/setup-macos.sh | 65 ++++++++++++++++++++++++++++------------ scripts/setup-ubuntu.sh | 59 +++++++++++++++++++++++++----------- 3 files changed, 94 insertions(+), 42 deletions(-) diff --git a/scripts/setup-centos8.sh b/scripts/setup-centos8.sh index 7878f6ea324a7..73084c097a6cd 100755 --- a/scripts/setup-centos8.sh +++ b/scripts/setup-centos8.sh @@ -26,6 +26,10 @@ export CPPFLAGS=$CFLAGS # Used by LZO. CMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}" BUILD_DUCKDB="${BUILD_DUCKDB:-true}" +FB_OS_VERSION="v2023.12.04.00" +FMT_VERSION="10.1.1" +BOOST_VERSION="boost-1.84.0" + function dnf_install { dnf install -y -q --setopt=install_weak_deps=False "$@" } @@ -80,7 +84,7 @@ function install_lzo { } function install_boost { - wget_and_untar https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz boost + wget_and_untar https://github.com/boostorg/boost/releases/download/${BOOST_VERSION}/${BOOST_VERSION}.tar.gz boost ( cd boost ./bootstrap.sh --prefix=/usr/local @@ -97,7 +101,7 @@ function install_snappy { } function install_fmt { - wget_and_untar https://github.com/fmtlib/fmt/archive/10.1.1.tar.gz fmt + wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION}.tar.gz fmt ( cd fmt cmake_install -DFMT_TEST=OFF @@ -115,8 +119,6 @@ function install_protobuf { ) } -FB_OS_VERSION="v2023.12.04.00" - function install_fizz { wget_and_untar https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION}.tar.gz fizz ( @@ -129,7 +131,7 @@ function install_folly { wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly ( cd folly - cmake_install -DFOLLY_HAVE_INT128_T=ON + cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON ) } diff --git a/scripts/setup-macos.sh b/scripts/setup-macos.sh index 7872195b9e773..9da7c75b56897 100755 --- a/scripts/setup-macos.sh +++ b/scripts/setup-macos.sh @@ -37,6 +37,7 @@ DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)} MACOS_DEPS="ninja flex bison cmake ccache protobuf@21 icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl libsodium" FB_OS_VERSION="v2023.12.04.00" +FMT_VERSION="10.1.1" function update_brew { DEFAULT_BREW_PATH=/usr/local/bin/brew @@ -70,49 +71,75 @@ function install_build_prerequisites { } function install_fmt { - github_checkout fmtlib/fmt 10.1.1 - cmake_install -DFMT_TEST=OFF + wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION}.tar.gz fmt + ( + cd fmt + cmake_install -DFMT_TEST=OFF + ) } function install_folly { - github_checkout facebook/folly "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON + wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly + ( + cd folly + cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON + ) } function install_fizz { - github_checkout facebookincubator/fizz "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF -S fizz + wget_and_untar https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION}.tar.gz fizz + ( + cd fizz/fizz + cmake_install -DBUILD_TESTS=OFF -S fizz + ) } function install_wangle { - github_checkout facebook/wangle "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF -S wangle + wget_and_untar https://github.com/facebook/wangle/archive/refs/tags/${FB_OS_VERSION}.tar.gz wangle + ( + cd wangle/wangle + cmake_install -DBUILD_TESTS=OFF -S wangle + ) } function install_mvfst { - github_checkout facebook/mvfst "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF + wget_and_untar https://github.com/facebook/mvfst/archive/refs/tags/${FB_OS_VERSION}.tar.gz mvfst + ( + cd mvfst + cmake_install -DBUILD_TESTS=OFF + ) } - function install_fbthrift { - github_checkout facebook/fbthrift "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF + wget_and_untar https://github.com/facebook/fbthrift/archive/refs/tags/${FB_OS_VERSION}.tar.gz fbthrift + ( + cd fbthrift + cmake_install -Denable_tests=OFF + ) } function install_double_conversion { - github_checkout google/double-conversion v3.1.5 - cmake_install -DBUILD_TESTING=OFF + wget_and_untar https://github.com/google/double-conversion/archive/refs/tags/v3.1.5.tar.gz double-conversion + ( + cd double-conversion + cmake_install -DBUILD_TESTING=OFF + ) } function install_ranges_v3 { - github_checkout ericniebler/range-v3 0.12.0 - cmake_install -DRANGES_ENABLE_WERROR=OFF -DRANGE_V3_TESTS=OFF -DRANGE_V3_EXAMPLES=OFF + wget_and_untar https://github.com/ericniebler/range-v3/archive/refs/tags/0.12.0.tar.gz ranges_v3 + ( + cd ranges_v3 + cmake_install -DRANGES_ENABLE_WERROR=OFF -DRANGE_V3_TESTS=OFF -DRANGE_V3_EXAMPLES=OFF + ) } function install_re2 { - github_checkout google/re2 2021-04-01 - cmake_install -DRE2_BUILD_TESTING=OFF + wget_and_untar https://github.com/google/re2/archive/refs/tags/2021-04-01.tar.gz re2 + ( + cd re2 + cmake_install -DRE2_BUILD_TESTING=OFF + ) } function install_velox_deps { diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 1fdbfbed5375e..e3834c60eda53 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -23,14 +23,15 @@ source $SCRIPTDIR/setup-helper-functions.sh CPU_TARGET="${CPU_TARGET:-avx}" COMPILER_FLAGS=$(get_cxx_flags "$CPU_TARGET") export COMPILER_FLAGS -FB_OS_VERSION=v2023.12.04.00 -FMT_VERSION=10.1.1 -BOOST_VERSION=boost-1.84.0 NPROC=$(getconf _NPROCESSORS_ONLN) DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)} export CMAKE_BUILD_TYPE=Release SUDO="${SUDO:-"sudo --preserve-env"}" +FB_OS_VERSION="v2023.12.04.00" +FMT_VERSION="10.1.1" +BOOST_VERSION="boost-1.84.0" + # Install all velox and folly dependencies. # The is an issue on 22.04 where a version conflict prevents glog install, # installing libunwind first fixes this. @@ -41,6 +42,7 @@ ${SUDO} apt install -y \ g++ \ cmake \ ccache \ + curl \ ninja-build \ checkinstall \ git \ @@ -70,39 +72,60 @@ ${SUDO} apt install -y \ wget function install_fmt { - github_checkout fmtlib/fmt "${FMT_VERSION}" - cmake_install -DFMT_TEST=OFF + wget_and_untar https://github.com/fmtlib/fmt/archive/${FMT_VERSION}.tar.gz fmt + ( + cd fmt + cmake_install -DFMT_TEST=OFF + ) } function install_boost { - github_checkout boostorg/boost "${BOOST_VERSION}" --recursive - ./bootstrap.sh --prefix=/usr/local - ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi + wget_and_untar https://github.com/boostorg/boost/releases/download/${BOOST_VERSION}/${BOOST_VERSION}.tar.gz boost + ( + cd boost + ./bootstrap.sh --prefix=/usr/local + ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi + ) } function install_folly { - github_checkout facebook/folly "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON + wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly + ( + cd folly + cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON + ) } function install_fizz { - github_checkout facebookincubator/fizz "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF -S fizz + wget_and_untar https://github.com/facebookincubator/fizz/archive/refs/tags/${FB_OS_VERSION}.tar.gz fizz + ( + cd fizz/fizz + cmake_install -DBUILD_TESTS=OFF -S fizz + ) } function install_wangle { - github_checkout facebook/wangle "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF -S wangle + wget_and_untar https://github.com/facebook/wangle/archive/refs/tags/${FB_OS_VERSION}.tar.gz wangle + ( + cd wangle/wangle + cmake_install -DBUILD_TESTS=OFF -S wangle + ) } function install_mvfst { - github_checkout facebook/mvfst "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF + wget_and_untar https://github.com/facebook/mvfst/archive/refs/tags/${FB_OS_VERSION}.tar.gz mvfst + ( + cd mvfst + cmake_install -DBUILD_TESTS=OFF + ) } function install_fbthrift { - github_checkout facebook/fbthrift "${FB_OS_VERSION}" - cmake_install -DBUILD_TESTS=OFF + wget_and_untar https://github.com/facebook/fbthrift/archive/refs/tags/${FB_OS_VERSION}.tar.gz fbthrift + ( + cd fbthrift + cmake_install -Denable_tests=OFF + ) } function install_conda {