Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Aug 28, 2024
1 parent 58907cf commit 749c594
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 5 deletions.
9 changes: 5 additions & 4 deletions dev/builddeps-veloxbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ function concat_velox_param {

if [ "$ENABLE_VCPKG" = "ON" ]; then
# vcpkg will install static depends and init build environment
envs="$("$GLUTEN_DIR/dev/vcpkg/init.sh")"
eval "$envs"
bash $GLUTEN_DIR/dev/vcpkg/init.sh --build_tests=$BUILD_TESTS --enable_s3=$ENABLE_S3 \
--enable_gcs=$ENABLE_GCS --enable_hdfs=$ENABLE_HDFS \
--enable_abfs=$ENABLE_ABFS
fi

if [ "$SPARK_VERSION" = "3.2" ] || [ "$SPARK_VERSION" = "3.3" ] \
Expand All @@ -196,8 +197,8 @@ function build_velox {
cd $GLUTEN_DIR/ep/build-velox/src
# When BUILD_TESTS is on for gluten cpp, we need turn on VELOX_BUILD_TEST_UTILS via build_test_utils.
./build_velox.sh --enable_s3=$ENABLE_S3 --enable_gcs=$ENABLE_GCS --build_type=$BUILD_TYPE --enable_hdfs=$ENABLE_HDFS \
--enable_abfs=$ENABLE_ABFS --enable_ep_cache=$ENABLE_EP_CACHE --build_test_utils=$BUILD_TESTS --build_tests=$BUILD_VELOX_TESTS --build_benchmarks=$BUILD_VELOX_BENCHMARKS \
--num_threads=$NUM_THREADS
--enable_abfs=$ENABLE_ABFS --enable_ep_cache=$ENABLE_EP_CACHE --build_test_utils=$BUILD_TESTS \
--build_tests=$BUILD_VELOX_TESTS --build_benchmarks=$BUILD_VELOX_BENCHMARKS --num_threads=$NUM_THREADS
}

function build_gluten_cpp {
Expand Down
56 changes: 56 additions & 0 deletions dev/vcpkg/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ set -e

exec 3>&1 >&2

BUILD_TESTS=OFF
ENABLE_S3=OFF
ENABLE_GCS=OFF
ENABLE_HDFS=OFF
ENABLE_ABFS=OFF

for arg in "$@"; do
case $arg in
--build_tests=*)
BUILD_TESTS=("${arg#*=}")
shift # Remove argument name from processing
;;
--enable_s3=*)
ENABLE_S3=("${arg#*=}")
shift # Remove argument name from processing
;;
--enable_gcs=*)
ENABLE_GCS=("${arg#*=}")
shift # Remove argument name from processing
;;
--enable_hdfs=*)
ENABLE_HDFS=("${arg#*=}")
shift # Remove argument name from processing
;;
--enable_abfs=*)
ENABLE_ABFS=("${arg#*=}")
shift # Remove argument name from processing
;;
*)
echo "Unrecognized argument: $arg"
exit 1
;;
esac
done

SCRIPT_ROOT="$(realpath "$(dirname "$0")")"
VCPKG_ROOT="$SCRIPT_ROOT/.vcpkg"
VCPKG="$SCRIPT_ROOT/.vcpkg/vcpkg"
Expand All @@ -22,6 +57,27 @@ sed -i "s/192374a68e2971f04974a194645726196d9b8ee7abd650d1e6f65f7aa2ccc9b186c3ed
$VCPKG install --no-print-usage \
--triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}"

if [ "$BUILD_TESTS" = "ON" ]; then
$VCPKG install --no-print-usage \
--triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=duckdb
fi
if [ "$BUILD_S3" = "ON" ]; then
$VCPKG install --no-print-usage \
--triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-s3
fi
if [ "$BUILD_GCS" = "ON" ]; then
$VCPKG install --no-print-usage \
--triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-gcs
fi
if [ "$BUILD_HDFS" = "ON" ]; then
$VCPKG install --no-print-usage \
--triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-hdfs
fi
if [ "$BUILD_ABFS" = "ON" ]; then
$VCPKG install --no-print-usage \
--triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-abfs
fi

VCPKG_TRIPLET_INSTALL_DIR=${SCRIPT_ROOT}/vcpkg_installed/${VCPKG_TRIPLET}
EXPORT_TOOLS_PATH=
EXPORT_TOOLS_PATH="${VCPKG_TRIPLET_INSTALL_DIR}/tools/protobuf:${EXPORT_TOOLS_PATH}"
Expand Down
2 changes: 1 addition & 1 deletion dev/vcpkg/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"builtin-baseline": "a7b6122f6b6504d16d96117336a0562693579933",
"dependencies": ["jemalloc"],
"default-features": ["velox", "velox-s3", "velox-gcs", "velox-hdfs", "velox-abfs", "duckdb"],
"default-features": ["velox"],
"features": {
"velox": {
"description": "Velox backend",
Expand Down

0 comments on commit 749c594

Please sign in to comment.