diff --git a/scripts/setup-helper-functions.sh b/scripts/setup-helper-functions.sh index 4b46317ef66c8..aeb29399ba308 100644 --- a/scripts/setup-helper-functions.sh +++ b/scripts/setup-helper-functions.sh @@ -43,14 +43,13 @@ function github_checkout { shift local GIT_CLONE_PARAMS=$@ local DIRNAME=$(basename $REPO) - SUDO="${SUDO:-""}" cd "${DEPENDENCY_DIR}" if [ -z "${DIRNAME}" ]; then echo "Failed to get repo name from ${REPO}" exit 1 fi if [ -d "${DIRNAME}" ] && prompt "${DIRNAME} already exists. Delete?"; then - ${SUDO} rm -rf "${DIRNAME}" + rm -rf "${DIRNAME}" fi if [ ! -d "${DIRNAME}" ]; then git clone -q -b $VERSION $GIT_CLONE_PARAMS "https://github.com/${REPO}.git" @@ -153,13 +152,13 @@ function wget_and_untar { function cmake_install { local NAME=$(basename "$(pwd)") local BINARY_DIR=_build - SUDO="${SUDO:-""}" if [ -d "${BINARY_DIR}" ] && prompt "Do you want to rebuild ${NAME}?"; then - ${SUDO} rm -rf "${BINARY_DIR}" + rm -rf "${BINARY_DIR}" fi mkdir -p "${BINARY_DIR}" CPU_TARGET="${CPU_TARGET:-unknown}" COMPILER_FLAGS=$(get_cxx_flags $CPU_TARGET) + SUDO="${SUDO:-""}" # CMAKE_POSITION_INDEPENDENT_CODE is required so that Velox can be built into dynamic libraries \ cmake -Wno-dev -B"${BINARY_DIR}" \ diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 1fdbfbed5375e..4c35e0c701824 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -29,15 +29,14 @@ 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"}" +export SUDO=sudo # 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. - -${SUDO} apt update -${SUDO} apt install -y libunwind-dev -${SUDO} apt install -y \ +apt update && apt install sudo +sudo --preserve-env apt update && sudo --preserve-env apt install -y libunwind-dev && \ + sudo --preserve-env apt install -y \ g++ \ cmake \ ccache \ @@ -77,7 +76,7 @@ function install_fmt { function install_boost { github_checkout boostorg/boost "${BOOST_VERSION}" --recursive ./bootstrap.sh --prefix=/usr/local - ${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi + ./b2 "-j$(nproc)" -d0 install threading=multi } function install_folly { @@ -106,19 +105,17 @@ function install_fbthrift { } function install_conda { - MINICONDA_PATH=/opt/miniconda-for-velox - if [ -e ${MINICONDA_PATH} ]; then - echo "File or directory already exists: ${MINICONDA_PATH}" - return - fi + mkdir -p conda && cd conda ARCH=$(uname -m) + if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "aarch64" ]; then echo "Unsupported architecture: $ARCH" exit 1 fi - mkdir -p conda && cd conda wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$ARCH.sh + + MINICONDA_PATH=/opt/miniconda-for-velox bash Miniconda3-latest-Linux-$ARCH.sh -b -p $MINICONDA_PATH }