Skip to content

Commit

Permalink
fix setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Abraham committed Sep 3, 2024
1 parent 3817916 commit c9a4610
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ PYTHON_VENV=${PYHTON_VENV:-"${SCRIPTDIR}/../.venv"}
NPROC=$(getconf _NPROCESSORS_ONLN)

DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
MACOS_VELOX_DEPS="bison boost double-conversion fast_float flex fmt gflags glog googletest icu4c libevent libsodium lz4 lzo openssl protobuf@21 simdjson snappy thrift xz xsimd zstd"
MACOS_VELOX_DEPS="bison flex fast_float fmt gflags glog googletest icu4c libevent libsodium lz4 lzo openssl protobuf@21 simdjson snappy thrift xz zstd"
MACOS_BUILD_DEPS="ninja cmake ccache"
FB_OS_VERSION="v2024.08.26.00"
XSIMD_VERSION="10.0.0"
BOOST_VERSION="boost-1.84.0"

function update_brew {
DEFAULT_BREW_PATH=/usr/local/bin/brew
Expand Down Expand Up @@ -78,6 +80,11 @@ function install_build_prerequisites {
source ${PYTHON_VENV}/bin/activate; pip3 install cmake-format regex pyyaml
}

function install_xsimd {
wget_and_untar https://github.com/xtensor-stack/xsimd/archive/refs/tags/${XSIMD_VERSION}.tar.gz xsimd
cmake_install xsimd
}

function install_velox_deps_from_brew {
for pkg in ${MACOS_VELOX_DEPS}
do
Expand All @@ -89,6 +96,23 @@ function install_proxygen {
github_checkout facebook/proxygen "${FB_OS_VERSION}"
cmake_install -DBUILD_TESTS=OFF
}
function install_boost {
wget_and_untar https://github.com/boostorg/boost/releases/download/${BOOST_VERSION}/${BOOST_VERSION}.tar.gz boost
(
cd boost
if [[ ${USE_CLANG} != "false" ]]; then
./bootstrap.sh --prefix=/usr/local --with-toolset="clang-15"
# Switch the compiler from the clang-15 toolset which doesn't exist (clang-15.jam) to
# clang of version 15 when toolset clang-15 is used.
# This reconciles the project-config.jam generation with what the b2 build system allows for customization.
sed -i 's/using clang-15/using clang : 15/g' project-config.jam
${SUDO} ./b2 "-j${NPROC}" -d0 install threading=multi toolset=clang-15 --without-python
else
./bootstrap.sh --prefix=/usr/local
${SUDO} ./b2 "-j${NPROC}" -d0 install threading=multi --without-python
fi
)
}

function install_folly {
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly
Expand Down Expand Up @@ -140,13 +164,14 @@ function install_velox_deps {
run_and_time install_wangle
run_and_time install_mvfst
run_and_time install_fbthrift
run_and_time install_boost
run_and_time install_xsimd
run_and_time install_proxygen
}

(return 2> /dev/null) && return # If script was sourced, don't run commands.

(
update_brew
if [[ $# -ne 0 ]]; then
for cmd in "$@"; do
run_and_time "${cmd}"
Expand Down

0 comments on commit c9a4610

Please sign in to comment.