Skip to content

Commit

Permalink
Revert "Fix Ubuntu install script (facebookincubator#8988)"
Browse files Browse the repository at this point in the history
This reverts commit 84f94bc.
  • Loading branch information
assignUser committed Mar 18, 2024
1 parent 8af7411 commit d8216eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
7 changes: 3 additions & 4 deletions scripts/setup-helper-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}" \
Expand Down
21 changes: 9 additions & 12 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit d8216eb

Please sign in to comment.