From ed6284c095e25281b496990ece3bdea3a8f1ffba Mon Sep 17 00:00:00 2001 From: Deepak Majeti Date: Tue, 5 Mar 2024 13:05:44 +0530 Subject: [PATCH] Add support for sudo in setup scripts --- scripts/setup-helper-functions.sh | 3 ++- scripts/setup-ubuntu.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/setup-helper-functions.sh b/scripts/setup-helper-functions.sh index 4f0a11e152fd..aeb29399ba30 100644 --- a/scripts/setup-helper-functions.sh +++ b/scripts/setup-helper-functions.sh @@ -158,6 +158,7 @@ function cmake_install { 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}" \ @@ -169,6 +170,6 @@ function cmake_install { -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS" \ -DBUILD_TESTING=OFF \ "$@" - ninja -C "${BINARY_DIR}" install + ${SUDO} ninja -C "${BINARY_DIR}" install } diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 102974b6a333..762b7b1e2d54 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -29,6 +29,7 @@ BOOST_VERSION=boost-1.84.0 NPROC=$(getconf _NPROCESSORS_ONLN) DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)} export CMAKE_BUILD_TYPE=Release +SUDO=sudo # Install all velox and folly dependencies. # The is an issue on 22.04 where a version conflict prevents glog install,