Skip to content

Commit

Permalink
build: Add option to build monolithic, shared library (facebookincuba…
Browse files Browse the repository at this point in the history
…tor#10732)

Summary:
This introduces the option to build a shared version of the monolithic `libvelox.a`, the result is a much smaller build tree, library and executables. They are now so small that moving them is much easier, e.g. for test sharding.

I also fixed some miscellaneous things in this PR:
- Removed `FILESYSTEM`, the link is not necessary with GCC >= 9 which is our minimum.
- Replaced `FOLLYBENCHMARK` with the proper target
- Improved bundled folly's use of glog and gflags (when also bundled)
- [Cleaned up the usage of an addition proto wrapper target](https://github.com/facebookincubator/velox/pull/10732/files#diff-6e1ef8f965a01fe12b35484f26064a6e30207eb3e8722eabe552dba288fbf934R18) so we don't link generated proto files twice (which doesn't cause issues in a static build)
- Added a marker in the log so it's clear when we are running velox cmake vs. dependency cmake:
```
-- [xsimd] xsimd v10.0.0
-- [stemmer] Building stemmer from source
-- Setting Arrow source to AUTO
-- [Arrow] Checking for module 'thrift'
```
Initially I looked at forcing a bundled build of folly and gflags to make sure they are shared but that introduces weird rpath issues when the dependencies are also on the system (like our CI image), instead I just changed the build script to build folly as shared in the image, we maybe want to make that an option so people can keep folly as static (though even for static build shared folly will likely make the binary size much smaller.).  If folly is build from source it will be built static or shared matching the velox build.

I have changed the wrapper function so that only the mono library target is explicitly created as shared, the few other velox utils, test libraries etc. will be build statically to avoid linking and test issues.

Pull Request resolved: facebookincubator#10732

Reviewed By: xiaoxmeng

Differential Revision: D66515203

Pulled By: kgpai

fbshipit-source-id: 260e5c8c9027c560bfc4c0d63a999fa284ef9775
  • Loading branch information
assignUser authored and facebook-github-bot committed Dec 8, 2024
1 parent 21f1e21 commit 164b4c2
Show file tree
Hide file tree
Showing 44 changed files with 215 additions and 115 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/linux-build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# prevent errors when forks ff their main branch
if: ${{ github.repository == 'facebookincubator/velox' }}
runs-on: 8-core-ubuntu
container: ghcr.io/facebookincubator/velox-dev:adapters
container: ghcr.io/assignuser/velox-dev:adapters
defaults:
run:
shell: bash
Expand Down Expand Up @@ -95,6 +95,7 @@ jobs:
"-DVELOX_ENABLE_REMOTE_FUNCTIONS=ON"
"-DVELOX_ENABLE_GPU=ON"
"-DVELOX_MONO_LIBRARY=ON"
"-DVELOX_BUILD_SHARED=ON"
)
if [[ "${USE_CLANG}" = "true" ]]; then scripts/setup-centos9.sh install_clang15; export CC=/usr/bin/clang-15; export CXX=/usr/bin/clang++-15; CUDA_FLAGS="-ccbin /usr/lib64/llvm15/bin/clang++-15"; fi
make release EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS[*]}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
-DENABLE_ALL_WARNINGS=1 \
-DVELOX_ENABLE_PARQUET=ON \
-DVELOX_MONO_LIBRARY=ON \
-DVELOX_BUILD_SHARED=ON \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
Expand Down
31 changes: 24 additions & 7 deletions CMake/VeloxUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ function(velox_add_library TARGET)
# Target already exists, append sources to it.
target_sources(velox PRIVATE ${ARGN})
else()
set(_type STATIC)
if(VELOX_BUILD_SHARED)
set(_type SHARED)
endif()
# Create the target if this is the first invocation.
add_library(velox ${ARGN})
add_library(velox ${_type} ${ARGN})
set_target_properties(velox PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/lib)
set_target_properties(velox PROPERTIES ARCHIVE_OUTPUT_DIRECTORY
Expand All @@ -93,13 +97,26 @@ function(velox_link_libraries TARGET)
# TODO(assignUser): Handle scope keywords (they currently are empty calls ala
# target_link_libraries(target PRIVATE))
if(VELOX_MONO_LIBRARY)
message(DEBUG "${TARGET}: ${ARGN}")
foreach(_lib ${ARGN})
if("${_lib}" MATCHES "^velox_*")
message(DEBUG "\t\tDROP: ${_lib}")
# These targets follow the velox_* name for consistency but are NOT actually
# aliases to velox when building the mono lib and need to be linked
# explicitly (this is a hack)
set(explicit_targets
velox_exec_test_lib
# see velox/experimental/wave/README.md
velox_wave_common
velox_wave_decode
velox_wave_dwio
velox_wave_exec
velox_wave_stream
velox_wave_vector)

foreach(_arg ${ARGN})
list(FIND explicit_targets ${_arg} _explicit)
if(_explicit EQUAL -1 AND "${_arg}" MATCHES "^velox_*")
message(DEBUG "\t\tDROP: ${_arg}")
else()
message(DEBUG "\t\tADDING: ${_lib}")
target_link_libraries(velox ${_lib})
message(DEBUG "\t\tADDING: ${_arg}")
target_link_libraries(velox ${_arg})
endif()
endforeach()
else()
Expand Down
3 changes: 2 additions & 1 deletion CMake/resolve_dependency_modules/cpr.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FetchContent_Declare(
PATCH_COMMAND
git apply ${CMAKE_CURRENT_LIST_DIR}/cpr/cpr-libcurl-compatible.patch && git
apply ${CMAKE_CURRENT_LIST_DIR}/cpr/cpr-remove-sancheck.patch)
set(BUILD_SHARED_LIBS OFF)
set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
set(CPR_USE_SYSTEM_CURL OFF)
# ZLIB has already been found by find_package(ZLIB, REQUIRED), set CURL_ZLIB=OFF
# to save compile time.
Expand All @@ -44,3 +44,4 @@ FetchContent_MakeAvailable(cpr)
# libcpr in its CMakeLists.txt file disables the BUILD_TESTING globally when
# CPR_USE_SYSTEM_CURL=OFF. unset BUILD_TESTING here.
unset(BUILD_TESTING)
unset(BUILD_SHARED_LIBS)
30 changes: 12 additions & 18 deletions CMake/resolve_dependency_modules/folly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
project(Folly)
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.28)

set(VELOX_FOLLY_BUILD_VERSION v2024.07.01.00)
set(VELOX_FOLLY_BUILD_SHA256_CHECKSUM
Expand All @@ -27,37 +27,31 @@ message(STATUS "Building Folly from source")

if(gflags_SOURCE STREQUAL "BUNDLED")
set(glog_patch && git apply ${CMAKE_CURRENT_LIST_DIR}/folly-gflags-glog.patch)
# Together with the patch applied above prevents folly from test compiling a
# snippet to find the right namespace (which would fail because gflags isn't
# built yet)
set(FOLLY_UNUSUAL_GFLAGS_NAMESPACE OFF)
set(FOLLY_GFLAGS_NAMESPACE gflags)
endif()

FetchContent_Declare(
folly
URL ${VELOX_FOLLY_SOURCE_URL}
URL_HASH ${VELOX_FOLLY_BUILD_SHA256_CHECKSUM}
PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/folly-no-export.patch
${glog_patch})
${glog_patch} OVERRIDE_FIND_PACKAGE SYSTEM EXCLUDE_FROM_ALL)

set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})

# Suppress all warnings
set(FOLLY_CXX_FLAGS -w)
# Enable INT128 support
set(FOLLY_HAVE_INT128_T ON)

FetchContent_MakeAvailable(folly)

# Folly::folly is not valid for FC but we want to match FindFolly
add_library(Folly::folly ALIAS folly)
add_library(Folly::follybenchmark ALIAS follybenchmark)

# The folly target does not contain any include directories, they are propagated
# from folly_base. This marks them as system headers which should suppress
# warnigs generated by them when they are included else where.
set_target_properties(
folly_deps
PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:folly_deps,INTERFACE_INCLUDE_DIRECTORIES>)
set_target_properties(
folly_base
PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:folly_base,INTERFACE_INCLUDE_DIRECTORIES>)

if(${gflags_SOURCE} STREQUAL "BUNDLED")
add_dependencies(folly glog gflags_static fmt::fmt)
if(gflags_SOURCE STREQUAL "BUNDLED")
add_dependencies(folly glog::glog gflags::gflags fmt::fmt)
endif()
13 changes: 12 additions & 1 deletion CMake/resolve_dependency_modules/folly/folly-gflags-glog.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
--- a/CMake/FollyConfigChecks.cmake
+++ b/CMake/FollyConfigChecks.cmake
@@ -181,7 +181,7 @@ check_cxx_source_runs("
HAVE_VSNPRINTF_ERRORS
)

-if (FOLLY_HAVE_LIBGFLAGS)
+if (FOLLY_HAVE_LIBGFLAGS AND NOT FOLLY_GFLAGS_NAMESPACE)
# Older releases of gflags used the namespace "gflags"; newer releases
# use "google" but also make symbols available in the deprecated "gflags"
# namespace too. The folly code internally uses "gflags" unless we tell it
--- a/CMake/folly-deps.cmake
+++ b/CMake/folly-deps.cmake
@@ -52,19 +52,20 @@ find_package(DoubleConversion MODULE REQUIRED)
Expand Down Expand Up @@ -41,7 +52,7 @@
+set(FOLLY_HAVE_LIBGLOG ${glog_FOUND})
+list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY})
+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR})
+message(STATUS "glog_INCLUDE_DIR: ${gflags_LINRARY}")
+message(STATUS "glog_LIBRARY: ${glog_LIBRARY}")

find_package(LibEvent MODULE REQUIRED)
list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB})
31 changes: 16 additions & 15 deletions CMake/resolve_dependency_modules/gflags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,25 @@ FetchContent_Declare(
gflags
URL ${VELOX_GFLAGS_SOURCE_URL}
URL_HASH ${VELOX_GFLAGS_BUILD_SHA256_CHECKSUM}
PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/gflags/gflags-config.patch)
PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/gflags/gflags-config.patch
OVERRIDE_FIND_PACKAGE EXCLUDE_FROM_ALL SYSTEM)

set(GFLAGS_BUILD_STATIC_LIBS ON)
set(GFLAGS_BUILD_gflags_LIB ON)
set(GFLAGS_BUILD_gflags_nothreads_LIB ON)
set(GFLAGS_IS_SUBPROJECT ON)
# glog relies on the old `google` namespace
set(GFLAGS_NAMESPACE "google;gflags")

FetchContent_MakeAvailable(gflags)
set(GFLAGS_BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
set(GFLAGS_BUILD_STATIC_LIBS ${VELOX_BUILD_STATIC})

# the flag has to be added to each target we build so adjust to settings choosen
# above
target_compile_options(gflags_static PRIVATE -Wno-cast-function-type)
target_compile_options(gflags_nothreads_static PRIVATE -Wno-cast-function-type)
set(GFLAGS_BUILD_gflags_LIB ON)
set(GFLAGS_BUILD_gflags_nothreads_LIB ON)
set(GFLAGS_IS_SUBPROJECT ON)

# this causes find_package(gflags) to search in the build directory and prevents
# the system gflags from being found
set(gflags_DIR ${gflags_BINARY_DIR})
set(gflags_LIBRARY gflags_static)
set(gflags_INCLUDE_DIR ${gflags_BINARY_DIR}/include)
# Workaround for https://github.com/gflags/gflags/issues/277
unset(BUILD_SHARED_LIBS)
FetchContent_MakeAvailable(gflags)
# This causes find_package(gflags) in other dependencies to search in the build
# directory and prevents the system gflags from being found when they don't use
# the target directly (like folly).
set(gflags_FOUND TRUE)
set(gflags_LIBRARY gflags::gflags)
set(gflags_INCLUDE_DIR)
30 changes: 21 additions & 9 deletions CMake/resolve_dependency_modules/glog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,36 @@ FetchContent_Declare(
glog
URL ${VELOX_GLOG_SOURCE_URL}
URL_HASH ${VELOX_GLOG_BUILD_SHA256_CHECKSUM}
PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/glog/glog-no-export.patch
&& git apply ${CMAKE_CURRENT_LIST_DIR}/glog/glog-config.patch)
PATCH_COMMAND
git apply ${CMAKE_CURRENT_LIST_DIR}/glog/glog-no-export.patch && git apply
${CMAKE_CURRENT_LIST_DIR}/glog/glog-config.patch SYSTEM
OVERRIDE_FIND_PACKAGE EXCLUDE_FROM_ALL)

set(BUILD_SHARED_LIBS OFF)
set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
set(WITH_UNWIND OFF)
set(gflags_NAMESPACE google)
set(BUILD_TESTING OFF)
FetchContent_MakeAvailable(glog)
unset(BUILD_TESTING)
unset(BUILD_SHARED_LIBS)
add_dependencies(glog gflags_static)

list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/glog)
set(glog_INCLUDE_DIR ${glog_BINARY_DIR})
set(glog_LIBRARY ${glog_BINARY_DIR}/libglog$<$<CONFIG:Debug>:d>.a)
# Folly uses variables instead of targets
set(glog_LIBRARY glog::glog)

# These headers are missing from the include dir but adding the src dir causes
# issues with folly so we just copy it to the include dir
add_dependencies(glog gflags::gflags)

# The default target has the glog-src as an include dir but this causes issues
# with folly due to an internal glog 'demangle.h' being mistaken for a system
# header so we remove glog_SOURCE_DIR by overwriting
# INTERFACE_INCLUDE_DIRECTORIES
get_target_property(
_glog_target glog::glog ALIASED_TARGET) # Can't set properties on ALIAS
# targets
set_target_properties(
${_glog_target}
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${glog_BINARY_DIR})

# These headers are missing from glog_BINARY_DIR
file(COPY ${glog_SOURCE_DIR}/src/glog/platform.h
DESTINATION ${glog_BINARY_DIR}/glog)
file(COPY ${glog_SOURCE_DIR}/src/glog/log_severity.h
Expand Down
3 changes: 2 additions & 1 deletion CMake/resolve_dependency_modules/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ message(STATUS "Building gtest from source")
FetchContent_Declare(
gtest
URL ${VELOX_GTEST_SOURCE_URL}
URL_HASH ${VELOX_GTEST_BUILD_SHA256_CHECKSUM})
URL_HASH ${VELOX_GTEST_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE SYSTEM EXCLUDE_FROM_ALL)

FetchContent_MakeAvailable(gtest)

Expand Down
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ list(PREPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake"
# Include our ThirdPartyToolchain dependencies macros
include(ResolveDependency)
include(VeloxUtils)
include(CMakeDependentOption)

velox_set_with_default(VELOX_DEPENDENCY_SOURCE_DEFAULT VELOX_DEPENDENCY_SOURCE
AUTO)
Expand All @@ -77,6 +78,28 @@ option(
OFF)
option(VELOX_MONO_LIBRARY "Build single unified library." OFF)
option(ENABLE_ALL_WARNINGS "Enable -Wall and -Wextra compiler warnings." ON)
option(VELOX_BUILD_SHARED "Build Velox as shared libraries." OFF)
# While it's possible to build both in one go we currently want to build either
# static or shared.
cmake_dependent_option(
VELOX_BUILD_STATIC
"Build Velox as static libraries."
ON
"NOT VELOX_BUILD_SHARED"
OFF)

if(VELOX_BUILD_SHARED AND NOT VELOX_MONO_LIBRARY)
# The large number of targets currently in use within Velox make a shared
# build when not using the mono library brittle and labor intensive
set(VELOX_MONO_LIBRARY ON)
endif()

if(VELOX_BUILD_SHARED)
message(
WARNING
"When building Velox as a shared library it's recommended to build against a shared build of folly to avoid issues with linking of gflags."
"This is currently NOT being enforced so user discretion is advised.")
endif()

# option() always creates a BOOL variable so we have to use a normal cache
# variable with STRING type for this option.
Expand Down
3 changes: 3 additions & 0 deletions scripts/centos.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ FROM $image

COPY scripts/setup-helper-functions.sh /
COPY scripts/setup-centos9.sh /

# Building libvelox.so requires folly and gflags to be built shared as well for now
ENV VELOX_BUILD_SHARED=ON
# The removal of the build dir has to happen in the same layer as the build
# to minimize the image size. gh & jq are required for CI
RUN mkdir build && ( cd build && bash /setup-centos9.sh ) && rm -rf build && \
Expand Down
10 changes: 0 additions & 10 deletions scripts/setup-adapters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,7 @@ function install_azure-storage-sdk-cpp {
}

function install_hdfs_deps {
github_checkout apache/hawq master
libhdfs3_dir=hawq/depends/libhdfs3
if [[ "$OSTYPE" == darwin* ]]; then
sed -i '' -e "/FIND_PACKAGE(GoogleTest REQUIRED)/d" $DEPENDENCY_DIR/$libhdfs3_dir/CMakeLists.txt
sed -i '' -e "s/dumpversion/dumpfullversion/" $DEPENDENCY_DIR/$libhdfs3_dir/CMakeLists.txt
fi

if [[ "$OSTYPE" == linux-gnu* ]]; then
sed -i "/FIND_PACKAGE(GoogleTest REQUIRED)/d" $DEPENDENCY_DIR/$libhdfs3_dir/CMakeLists.txt
sed -i "s/dumpversion/dumpfullversion/" $DEPENDENCY_DIR/$libhdfs3_dir/CMake/Platform.cmake
# Dependencies for Hadoop testing
wget_and_untar https://archive.apache.org/dist/hadoop/common/hadoop-3.3.0/hadoop-3.3.0.tar.gz hadoop
cp -a ${DEPENDENCY_DIR}/hadoop /usr/local/
Expand All @@ -173,7 +164,6 @@ function install_hdfs_deps {
yum install -y java-1.8.0-openjdk-devel
fi
fi
cmake_install_dir $libhdfs3_dir
}

(mkdir -p "${DEPENDENCY_DIR}") || exit
Expand Down
5 changes: 3 additions & 2 deletions scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ NPROC=$(getconf _NPROCESSORS_ONLN)
export CXXFLAGS=$(get_cxx_flags) # Used by boost.
export CFLAGS=${CXXFLAGS//"-std=c++17"/} # Used by LZO.
CMAKE_BUILD_TYPE="${BUILD_TYPE:-Release}"
VELOX_BUILD_SHARED=${VELOX_BUILD_SHARED:-"OFF"} #Build folly and gflags shared for use in libvelox.so.
BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
USE_CLANG="${USE_CLANG:-false}"
export INSTALL_PREFIX=${INSTALL_PREFIX:-"/usr/local"}
Expand Down Expand Up @@ -89,7 +90,7 @@ function install_gflags {
# Remove an older version if present.
dnf remove -y gflags
wget_and_untar https://github.com/gflags/gflags/archive/v2.2.2.tar.gz gflags
cmake_install_dir gflags -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64
cmake_install_dir gflags -DBUILD_SHARED_LIBS="$VELOX_BUILD_SHARED" -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON -DLIB_SUFFIX=64
}

function install_glog {
Expand Down Expand Up @@ -153,7 +154,7 @@ function install_fizz {

function install_folly {
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly
cmake_install_dir folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
cmake_install_dir folly -DBUILD_SHARED_LIBS="$VELOX_BUILD_SHARED" -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
}

function install_wangle {
Expand Down
3 changes: 2 additions & 1 deletion scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export OS_CXXFLAGS=" -isystem $(brew --prefix)/include "
NPROC=$(getconf _NPROCESSORS_ONLN)

BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
VELOX_BUILD_SHARED=${VELOX_BUILD_SHARED:-"OFF"} #Build folly shared for use in libvelox.so.
DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
MACOS_VELOX_DEPS="bison flex gflags glog googletest icu4c libevent libsodium lz4 lzo openssl protobuf@21 snappy xz zstd"
MACOS_BUILD_DEPS="ninja cmake"
Expand Down Expand Up @@ -116,7 +117,7 @@ function install_fmt {

function install_folly {
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly
cmake_install_dir folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
cmake_install_dir folly -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS="$VELOX_BUILD_SHARED" -DFOLLY_HAVE_INT128_T=ON
}

function install_fizz {
Expand Down
3 changes: 2 additions & 1 deletion scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export COMPILER_FLAGS
NPROC=$(getconf _NPROCESSORS_ONLN)
BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
export CMAKE_BUILD_TYPE=Release
VELOX_BUILD_SHARED=${VELOX_BUILD_SHARED:-"OFF"} #Build folly shared for use in libvelox.so.
SUDO="${SUDO:-"sudo --preserve-env"}"
USE_CLANG="${USE_CLANG:-false}"
export INSTALL_PREFIX=${INSTALL_PREFIX:-"/usr/local"}
Expand Down Expand Up @@ -169,7 +170,7 @@ function install_protobuf {

function install_folly {
wget_and_untar https://github.com/facebook/folly/archive/refs/tags/${FB_OS_VERSION}.tar.gz folly
cmake_install_dir folly -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
cmake_install_dir folly -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS="$VELOX_BUILD_SHARED" -DFOLLY_HAVE_INT128_T=ON
}

function install_fizz {
Expand Down
Loading

0 comments on commit 164b4c2

Please sign in to comment.