This repository was archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathintegrate-presto-bdtk.sh
More file actions
executable file
·61 lines (50 loc) · 2.8 KB
/
integrate-presto-bdtk.sh
File metadata and controls
executable file
·61 lines (50 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Copyright(c) 2022-2023 Intel Corporation.
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
set -e
VELOX_PLUGIN_MODE=Debug
PRESTO_CPP_MODE=debug
if [ "$1" = "release" ] || [ "$1" = "Release" ]
then
echo "Integration under Release mode"
VELOX_PLUGIN_MODE=Release
PRESTO_CPP_MODE=release
fi
git clone https://github.com/intel/BDTK.git ${WORKER_DIR}/BDTK
pushd ${WORKER_DIR}/BDTK
git submodule update --init --recursive
# run the build script
make ${PRESTO_CPP_MODE}
popd
pushd ${WORKER_DIR}
# copy the cider lib to presto_cpp
cp -r ${WORKER_DIR}/BDTK/thirdparty/velox/ .
sed -i 's/\"planTransformer\/PlanTransformer\.h\"/\"..\/planTransformer\/PlanTransformer\.h\"/' ${WORKER_DIR}/BDTK/cider-velox/src/ciderTransformer/CiderPlanTransformerFactory.h
rm -rf ${WORKER_DIR}/presto_cpp/main/lib
mkdir -p ${WORKER_DIR}/presto_cpp/main/lib
cp ${WORKER_DIR}/BDTK/build-${VELOX_PLUGIN_MODE}/cpp/thirdparty/velox/velox/substrait/libvelox_substrait_plan_converter.a ${WORKER_DIR}/presto_cpp/main/lib
cp ${WORKER_DIR}/BDTK/build-${VELOX_PLUGIN_MODE}/cpp/src/cider/function/libcider_function.so ${WORKER_DIR}/presto_cpp/main/lib
cp ${WORKER_DIR}/BDTK/build-${VELOX_PLUGIN_MODE}/cpp/src/cider/function/libcider_runtime_function.so ${WORKER_DIR}/presto_cpp/main/lib
cp ${WORKER_DIR}/BDTK/build-${VELOX_PLUGIN_MODE}/cpp/libcider_static.a ${WORKER_DIR}/presto_cpp/main/lib
cp ${WORKER_DIR}/BDTK/build-${VELOX_PLUGIN_MODE}/cpp/libcider_velox_static.a ${WORKER_DIR}/presto_cpp/main/lib
# copy libvelox_functions_spark to lib dir. Due to presto cpp build velox will set conf VELOX_ENABLE_SPARK_FUNCTIONS to OFF
cp ${WORKER_DIR}/BDTK/build-${VELOX_PLUGIN_MODE}/cpp/thirdparty/velox/velox/functions/sparksql/libvelox_functions_spark.a ${WORKER_DIR}/presto_cpp/main/lib
make -j ${CPU_COUNT:-`nproc`} PRESTO_ENABLE_PARQUET=ON ${PRESTO_CPP_MODE}
rm -rf ${WORKER_DIR}/_build/${PRESTO_CPP_MODE}/presto_cpp/function
mkdir ${WORKER_DIR}/_build/${PRESTO_CPP_MODE}/presto_cpp/function
cp ${WORKER_DIR}/BDTK/build-${VELOX_PLUGIN_MODE}/cider/function/RuntimeFunctions.bc ${WORKER_DIR}/_build/${PRESTO_CPP_MODE}/presto_cpp/function/