Skip to content

Commit

Permalink
Ubuntu: build fmt from source in setup script (#8678)
Browse files Browse the repository at this point in the history
Summary:
The default libfmt-dev package installed on Ubuntu 22.04 is version 8.1.1 (`libfmt-dev/jammy,now 8.1.1+ds1-2 amd64 [installed]`)

However, the fmt version installed needs to be at least fmt 9.

On CentOS fmt 10.1.1 is downloaded and installed.
This PR now does the same for Ubuntu.

Otherwise, both fmt and folly need to be set to build from the bundled versions.

Pull Request resolved: #8678

Reviewed By: Yuhta

Differential Revision: D53574103

Pulled By: kgpai

fbshipit-source-id: 6b9ef7ccf81da94ada73d0da39df90a697437ba0
  • Loading branch information
czentgr authored and facebook-github-bot committed Feb 9, 2024
1 parent cfa1133 commit 3dcca8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ if(${VELOX_ENABLE_DUCKDB})
endif()

set_source(fmt)
resolve_dependency(fmt)
resolve_dependency(fmt 9.0.0)

if(NOT ${VELOX_BUILD_MINIMAL})
find_package(ZLIB REQUIRED)
Expand Down
10 changes: 8 additions & 2 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ CPU_TARGET="${CPU_TARGET:-avx}"
COMPILER_FLAGS=$(get_cxx_flags "$CPU_TARGET")
export COMPILER_FLAGS
FB_OS_VERSION=v2023.12.04.00
FMT_VERSION=10.1.1
NPROC=$(getconf _NPROCESSORS_ONLN)
DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
export CMAKE_BUILD_TYPE=Release

# Install all velox and folly dependencies.
# 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
Expand All @@ -46,7 +47,6 @@ sudo --preserve-env apt update && sudo --preserve-env apt install -y libunwind-d
libboost-all-dev \
libicu-dev \
libdouble-conversion-dev \
libfmt-dev \
libgoogle-glog-dev \
libbz2-dev \
libgflags-dev \
Expand Down Expand Up @@ -87,6 +87,11 @@ function prompt {
) 2> /dev/null
}

function install_fmt {
github_checkout fmtlib/fmt "${FMT_VERSION}"
cmake_install -DFMT_TEST=OFF
}

function install_folly {
github_checkout facebook/folly "${FB_OS_VERSION}"
cmake_install -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
Expand Down Expand Up @@ -120,6 +125,7 @@ function install_conda {
}

function install_velox_deps {
run_and_time install_fmt
run_and_time install_folly
run_and_time install_fizz
run_and_time install_wangle
Expand Down

0 comments on commit 3dcca8d

Please sign in to comment.