Skip to content

Commit

Permalink
Fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Jun 28, 2024
1 parent f19e018 commit c47c6fa
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 341 deletions.
1 change: 0 additions & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
source scripts/setup-centos9.sh
install_cuda ${CUDA_VERSION}
fi
source scripts/setup-centos9.sh && install_grpc
- uses: assignUser/stash/restore@v1
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ jobs:
env:
EXTRA_CMAKE_FLAGS: "-DVELOX_ENABLE_ARROW=ON -DVELOX_BUILD_PYTHON_PACKAGE=ON ${{ inputs.extraCMakeFlags }}"
run: |
source scripts/setup-centos9.sh && install_grpc
EXTRA_CMAKE_FLAGS="-DPYTHON_EXECUTABLE=$(which python3) $EXTRA_CMAKE_FLAGS"
make debug
Expand Down
97 changes: 0 additions & 97 deletions CMake/Findgrpc.cmake

This file was deleted.

36 changes: 36 additions & 0 deletions CMake/resolve_dependency_modules/boringssl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
include_guard(GLOBAL)

set(VELOX_BORINGSSL_BUILD_VERSION fips-20220613)
set(VELOX_BORINGSSL_BUILD_SHA256_CHECKSUM
a343962da2fbb10d8fa2cd9a2832839a23045a197c0ff306dc0fa0abb85759b3)
string(CONCAT VELOX_BORINGSSL_SOURCE_URL
"https://github.com/google/boringssl/archive/refs/tags/"
"${VELOX_BORINGSSL_BUILD_VERSION}.tar.gz")

resolve_dependency_url(BORINGSSL)

message(STATUS "Building BoringSSL from source")

FetchContent_Declare(
boringssl
URL ${VELOX_BORINGSSL_SOURCE_URL}
URL_HASH ${VELOX_BORINGSSL_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE EXCLUDE_FROM_ALL SYSTEM)

set(CMAKE_BUILD_TYPE Release)
FetchContent_MakeAvailable(boringssl)
add_library(boringssl::ssl ALIAS ssl)
add_library(boringssl::crypto ALIAS crypto)
37 changes: 37 additions & 0 deletions CMake/resolve_dependency_modules/cares.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
include_guard(GLOBAL)

set(VELOX_CARES_BUILD_VERSION cares-1_17_2)
set(VELOX_CARES_BUILD_SHA256_CHECKSUM
444b7dbf33cb6e8a764d069e3485cbaaa28386d60eace6988275c3cb9534d300)
string(CONCAT VELOX_CARES_SOURCE_URL
"https://github.com/c-ares/c-ares/archive/refs/tags/"
"${VELOX_CARES_BUILD_VERSION}.tar.gz")

resolve_dependency_url(CARES)

message(STATUS "Building C-ARES from source")

FetchContent_Declare(
cares
URL ${VELOX_CARES_SOURCE_URL}
URL_HASH ${VELOX_CARES_BUILD_SHA256_CHECKSUM}
OVERRIDE_FIND_PACKAGE EXCLUDE_FROM_ALL SYSTEM)

set(CARES_STATIC ON)
set(CARES_INSTALL ON)
set(CARES_SHARED OFF)
FetchContent_MakeAvailable(cares)
add_library(cares::cares ALIAS c-ares)
5 changes: 4 additions & 1 deletion CMake/resolve_dependency_modules/grpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ string(CONCAT VELOX_GRPC_SOURCE_URL

resolve_dependency_url(GRPC)

message(STATUS "Building Google Cloud CPP from source")
message(STATUS "Building gRPC from source")

FetchContent_Declare(
gRPC
Expand Down Expand Up @@ -54,4 +54,7 @@ set(gRPC_INSTALL
FetchContent_MakeAvailable(gRPC)
add_library(gRPC::grpc ALIAS grpc)
add_library(gRPC::grpc++ ALIAS grpc++)
add_library(gRPC::gpr ALIAS gpr)
add_library(gRPC::address_sorting ALIAS address_sorting)
add_library(gRPC::upb ALIAS upb)
add_executable(gRPC::grpc_cpp_plugin ALIAS grpc_cpp_plugin)
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,19 @@ add_compile_definitions(FOLLY_HAVE_INT128_T=1)
set_source(folly)
resolve_dependency(folly)

# Spark qury runner depends on absl, c-ares, grpc and boringssl.
set_source(absl)
resolve_dependency(absl 20240116 EXACT)

set_source(cares)
resolve_dependency(cares 1.17.2 EXACT)

set_source(gRPC)
resolve_dependency(gRPC 1.48.1 EXACT)

set_source(boringssl)
resolve_dependency(boringssl)

if(VELOX_ENABLE_REMOTE_FUNCTIONS)
# TODO: Move this to use resolve_dependency(). For some reason, FBThrift
# requires clients to explicitly install fizz and wangle.
Expand Down
54 changes: 0 additions & 54 deletions scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,60 +231,6 @@ function install_velox_deps {
run_and_time install_duckdb
}

function install_grpc {
# abseil-cpp
github_checkout abseil/abseil-cpp 20240116.2 --depth 1
cmake_install \
-DABSL_BUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=17 \
-DABSL_PROPAGATE_CXX_STD=ON \
-DABSL_ENABLE_INSTALL=ON

# protobuf
github_checkout protocolbuffers/protobuf v21.8 --depth 1
cmake_install \
-Dprotobuf_BUILD_TESTS=OFF

# c-ares
github_checkout c-ares/c-ares cares-1_17_2 --depth 1
cmake_install \
-DCMAKE_BUILD_TYPE=Release \
-DCARES_STATIC=ON \
-DCARES_INSTALL=ON

# grpc
github_checkout grpc/grpc v1.48.1 --depth 1
cmake_install \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_INSTALL=ON
}

# function install_grpc {
# git clone https://github.com/grpc/grpc.git --branch v1.50.0 --single-branch
# (
# cd grpc
# git submodule update --init
# mkdir -p cmake/build
# cd cmake/build
# cmake ../.. -DgRPC_INSTALL=ON \
# -DCMAKE_BUILD_TYPE=Release \
# -DgRPC_ABSL_PROVIDER=module \
# -DgRPC_CARES_PROVIDER=module \
# -DgRPC_PROTOBUF_PROVIDER=module \
# -DgRPC_RE2_PROVIDER=package \
# -DgRPC_SSL_PROVIDER=package \
# -DgRPC_ZLIB_PROVIDER=package
# make "-j$(nproc)"
# $SUDO make install
# )
# }

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

(
Expand Down
55 changes: 0 additions & 55 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,60 +168,6 @@ function install_cuda {
$SUDO apt install -y cuda-nvcc-$(echo $1 | tr '.' '-') cuda-cudart-dev-$(echo $1 | tr '.' '-')
}

function install_grpc {
# abseil-cpp
github_checkout abseil/abseil-cpp 20240116.2 --depth 1
cmake_install \
-DABSL_BUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=17 \
-DABSL_PROPAGATE_CXX_STD=ON \
-DABSL_ENABLE_INSTALL=ON

# protobuf
github_checkout protocolbuffers/protobuf v21.8 --depth 1
cmake_install \
-Dprotobuf_BUILD_TESTS=OFF

# c-ares
github_checkout c-ares/c-ares cares-1_17_2 --depth 1
cmake_install \
-DCMAKE_BUILD_TYPE=Release \
-DCARES_STATIC=ON \
-DCARES_INSTALL=ON

# grpc
github_checkout grpc/grpc v1.48.1 --depth 1
cmake_install \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_INSTALL=ON
}

# function install_grpc {
# git clone https://github.com/grpc/grpc.git --branch v1.50.0 --single-branch
# (
# cd grpc
# git submodule update --init
# mkdir -p cmake/build
# cd cmake/build
# cmake ../.. -DgRPC_INSTALL=ON \
# -DCMAKE_BUILD_TYPE=Release \
# -DgRPC_ABSL_PROVIDER=module \
# -DgRPC_CARES_PROVIDER=module \
# -DgRPC_PROTOBUF_PROVIDER=module \
# -DgRPC_RE2_PROVIDER=package \
# -DgRPC_SSL_PROVIDER=package \
# -DgRPC_ZLIB_PROVIDER=package
# make "-j$(nproc)"
# $SUDO make install
# )
# }

function install_velox_deps {
run_and_time install_velox_deps_from_apt
run_and_time install_fmt
Expand All @@ -238,7 +184,6 @@ function install_velox_deps {
function install_apt_deps {
install_build_prerequisites
install_velox_deps_from_apt
run_and_time install_grpc
}

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

0 comments on commit c47c6fa

Please sign in to comment.