From 3dcca8db6947a2c1af777e542cc3a7225bd663e2 Mon Sep 17 00:00:00 2001 From: Christian Zentgraf Date: Thu, 8 Feb 2024 18:06:18 -0800 Subject: [PATCH] Ubuntu: build fmt from source in setup script (#8678) 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: https://github.com/facebookincubator/velox/pull/8678 Reviewed By: Yuhta Differential Revision: D53574103 Pulled By: kgpai fbshipit-source-id: 6b9ef7ccf81da94ada73d0da39df90a697437ba0 --- CMakeLists.txt | 2 +- scripts/setup-ubuntu.sh | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9c88d4add33..1c7dc7d568d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 14ac9f144b91..69760cf85ec0 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -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 @@ -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 \ @@ -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 @@ -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