This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 5062c62ee1 [chore](script) add build-for-release.sh (#15545)
5062c62ee1 is described below

commit 5062c62ee12fa4efe92e46165bb732f8e1babb26
Author: Mingyu Chen <[email protected]>
AuthorDate: Mon Jan 2 22:50:36 2023 +0800

    [chore](script) add build-for-release.sh (#15545)
---
 build-for-release.sh                               | 162 +++++++++++++++++++++
 .../compilation-with-ldb-toolchain.md              |  11 ++
 .../compilation-with-ldb-toolchain.md              |  13 +-
 3 files changed, 185 insertions(+), 1 deletion(-)

diff --git a/build-for-release.sh b/build-for-release.sh
new file mode 100755
index 0000000000..869f9a6c9e
--- /dev/null
+++ b/build-for-release.sh
@@ -0,0 +1,162 @@
+#!/usr/bin/env bash
+# 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.
+
+##############################################################
+# This script is used to build for Apache Doris Release
+##############################################################
+
+set -eo pipefail
+
+ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
+
+export DORIS_HOME="${ROOT}"
+
+# Check args
+usage() {
+    echo "
+Usage: $0 --version version <options>
+  Optional options:
+     [no option]        build with avx2
+     --noavx2           build without avx2
+     --tar              pack the output
+
+  Eg.
+    $0 --version 1.2.0                      build with avx2
+    $0 --noavx2 --version 1.2.0             build without avx2
+    $0 --version 1.2.0 --tar                build with avx2 and pack the output
+  "
+    exit 1
+}
+
+if ! OPTS="$(getopt \
+    -n "$0" \
+    -o '' \
+    -l 'noavx2' \
+    -l 'tar' \
+    -l 'version:' \
+    -l 'help' \
+    -- "$@")"; then
+    usage
+fi
+
+eval set -- "${OPTS}"
+
+_USE_AVX2=1
+TAR=0
+VERSION=
+if [[ "$#" == 1 ]]; then
+    _USE_AVX2=1
+else
+    while true; do
+        case "$1" in
+        --noavx2)
+            _USE_AVX2=0
+            shift
+            ;;
+        --tar)
+            TAR=1
+            shift
+            ;;
+        --version)
+            VERSION="$2"
+            shift 2
+            ;;
+        --help)
+            HELP=1
+            shift
+            ;;
+        --)
+            shift
+            break
+            ;;
+        *)
+            echo "Internal error"
+            exit 1
+            ;;
+        esac
+    done
+fi
+
+if [[ "${HELP}" -eq 1 ]]; then
+    usage
+    exit
+fi
+
+if [[ -z ${VERSION} ]]; then
+    echo "Must specify version"
+    usage
+    exit 1
+fi
+
+echo "Get params:
+    VERSION         -- ${VERSION}
+    USE_AVX2        -- ${_USE_AVX2}
+    TAR             -- ${TAR}
+"
+
+sh build.sh --clean &&
+    USE_AVX2="${_USE_AVX2}" sh build.sh &&
+    USE_AVX2="${_USE_AVX2}" sh build.sh --be --meta-tool
+
+echo "Begin to pack"
+ORI_OUTPUT="${ROOT}/output"
+
+FE=apache-doris-fe-${VERSION}-bin-x86_64
+BE=apache-doris-be-${VERSION}-bin-x86_64
+DEPS=apache-doris-dependencies-${VERSION}-bin-x86_64
+
+OUTPUT="${ORI_OUTPUT}/apache-doris-${VERSION}-bin-x86_64"
+OUTPUT_FE="${OUTPUT}/${FE}"
+OUTPUT_DEPS="${OUTPUT}/${DEPS}"
+OUTPUT_BE="${OUTPUT}/${BE}"
+
+if [[ "${_USE_AVX2}" == "0" ]]; then
+    OUTPUT_BE="${OUTPUT_BE}-noavx2"
+fi
+
+echo "Pakage Name:"
+echo "FE:   ${OUTPUT_FE}"
+echo "BE:   ${OUTPUT_BE}"
+echo "JAR:  ${OUTPUT_DEPS}"
+
+rm -rf "${OUTPUT}"
+mkdir -p "${OUTPUT_FE}" "${OUTPUT_BE}" "${OUTPUT_DEPS}"
+
+# FE
+cp -R "${ORI_OUTPUT}"/fe/* "${OUTPUT_FE}"/
+
+# DEPS
+cp "${ORI_OUTPUT}"/be/lib/java-udf-jar-with-dependencies.jar "${OUTPUT_DEPS}"/
+cp -R "${ORI_OUTPUT}"/apache_hdfs_broker "${OUTPUT_DEPS}"/apache_hdfs_broker
+cp -R "${ORI_OUTPUT}"/audit_loader "${OUTPUT_DEPS}"/audit_loader
+
+# BE
+cp -R "${ORI_OUTPUT}"/be/* "${OUTPUT_BE}"/
+rm "${OUTPUT_BE}"/lib/java-udf-jar-with-dependencies.jar
+
+if [[ "${TAR}" -eq 1 ]]; then
+    echo "Begin to compress"
+    cd "${OUTPUT}"
+    tar -cf - "${FE}" | xz -T0 -z - >"${FE}".tar.xz
+    tar -cf - "${BE}" | xz -T0 -z - >"${BE}".tar.xz
+    tar -cf - "${DEPS}" | xz -T0 -z - >"${DEPS}".tar.xz
+    cd -
+fi
+
+echo "Output dir: ${OUTPUT}"
+exit 0
diff --git 
a/docs/en/docs/install/source-install/compilation-with-ldb-toolchain.md 
b/docs/en/docs/install/source-install/compilation-with-ldb-toolchain.md
index f9bd342b33..7ef3a6303e 100644
--- a/docs/en/docs/install/source-install/compilation-with-ldb-toolchain.md
+++ b/docs/en/docs/install/source-install/compilation-with-ldb-toolchain.md
@@ -125,3 +125,14 @@ $ USE_AVX2=0 sh build.sh
 If supported, execute `sh build.sh` directly.
 
 This script will compile the third-party libraries first and then the Doris 
components (FE, BE) later. The compiled output will be in the `output/` 
directory.
+
+## Precompile the three-party binaries
+
+The `build.sh` script will first compile the third-party dependencies. You can 
also directly download the precompiled three-party binaries:
+
+`https://github.com/apache/doris-thirdparty/releases`
+
+Here we provide precompiled third-party binaries for Linux X86(with AVX2) and 
MacOS(X86 Chip). If it is consistent with your compiling and running 
environment, you can download and use it directly.
+
+After downloading, you will get an `installed/` directory after decompression, 
copy this directory to the `thirdparty/` directory, and then run `build.sh`.
+
diff --git 
a/docs/zh-CN/docs/install/source-install/compilation-with-ldb-toolchain.md 
b/docs/zh-CN/docs/install/source-install/compilation-with-ldb-toolchain.md
index b922c179e0..117ad946d8 100644
--- a/docs/zh-CN/docs/install/source-install/compilation-with-ldb-toolchain.md
+++ b/docs/zh-CN/docs/install/source-install/compilation-with-ldb-toolchain.md
@@ -119,9 +119,20 @@ $ cat /proc/cpuinfo | grep avx2
 不支持则使用以下命令进行编译
 
 ```
-$ USE_AVX2=0  sh build.sh
+$ USE_AVX2=0 sh build.sh
 ```
 
 若支持则直接执行 `sh build.sh` 即可
 
 该脚本会先编译第三方库,之后再编译 Doris 组件(FE、BE)。编译产出在 `output/` 目录下。
+
+## 预编译三方库
+
+`build.sh` 脚本会先编译第三方库。你也可以直接下载预编译好的三方库:
+
+`https://github.com/apache/doris-thirdparty/releases`
+
+这里我们提供了 Linux X86(with AVX2) 和 MacOS(X86芯片) 的预编译三方库。如果和你的编译运行环境一致,可以直接下载使用。
+
+下载好后,解压会得到一个 `installed/` 目录,将这个目录拷贝到 `thirdparty/` 目录下,之后运行 `build.sh` 即可。
+


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to