Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ubuntu install script #8988

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/setup-helper-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ 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
rm -rf "${DIRNAME}"
${SUDO} 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 @@ -152,13 +153,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
rm -rf "${BINARY_DIR}"
${SUDO} 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: 12 additions & 9 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ BOOST_VERSION=boost-1.84.0
NPROC=$(getconf _NPROCESSORS_ONLN)
DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
export CMAKE_BUILD_TYPE=Release
export SUDO=sudo
SUDO="${SUDO:-"sudo --preserve-env"}"

# 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.
apt update && apt install sudo
sudo --preserve-env apt update && sudo --preserve-env apt install -y libunwind-dev && \
sudo --preserve-env apt install -y \

${SUDO} apt update
${SUDO} apt install -y libunwind-dev
${SUDO} apt install -y \
g++ \
cmake \
ccache \
Expand Down Expand Up @@ -76,7 +77,7 @@ function install_fmt {
function install_boost {
github_checkout boostorg/boost "${BOOST_VERSION}" --recursive
./bootstrap.sh --prefix=/usr/local
./b2 "-j$(nproc)" -d0 install threading=multi
${SUDO} ./b2 "-j$(nproc)" -d0 install threading=multi
}

function install_folly {
Expand Down Expand Up @@ -105,17 +106,19 @@ function install_fbthrift {
}

function install_conda {
mkdir -p conda && cd conda
MINICONDA_PATH=/opt/miniconda-for-velox
if [ -e ${MINICONDA_PATH} ]; then
echo "File or directory already exists: ${MINICONDA_PATH}"
return
fi
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
Loading