You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by pa...@apache.org on 2023/06/09 14:27:23 UTC

[doris] branch master updated: [Chore](build) adjust build script about pch setting (#20637)

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

panxiaolei 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 ab6c1f152c [Chore](build) adjust build script about pch setting (#20637)
ab6c1f152c is described below

commit ab6c1f152c5bd493f9afce45774c99310b0e8691
Author: Pxl <px...@qq.com>
AuthorDate: Fri Jun 9 22:27:13 2023 +0800

    [Chore](build) adjust build script about pch setting (#20637)
    
    try to make be-ut workflow stable
---
 be/CMakeLists.txt                                         |  3 +++
 .../en/docs/install/source-install/compilation-general.md | 14 ++------------
 .../docs/install/source-install/compilation-general.md    | 14 ++------------
 env.sh                                                    | 15 ++++++++++-----
 4 files changed, 17 insertions(+), 29 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index fde8fc9016..4da8a25b08 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -53,8 +53,10 @@ endif ()
 
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set (COMPILER_GCC 1)
+    option(ENABLE_PCH "enable pch" OFF)
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     set (COMPILER_CLANG 1)
+    option(ENABLE_PCH "enable pch" ON)
 endif ()
 
 # Set boost/stacktrace use backtrace api to unwind
@@ -84,6 +86,7 @@ message(STATUS "GLIBC_COMPATIBILITY is ${GLIBC_COMPATIBILITY}")
 message(STATUS "USE_LIBCPP is ${USE_LIBCPP}")
 message(STATUS "USE_MEM_TRACKER is ${USE_MEM_TRACKER}")
 message(STATUS "USE_JEMALLOC is ${USE_JEMALLOC}")
+message(STATUS "ENABLE_PCH is ${ENABLE_PCH}")
 
 # set CMAKE_BUILD_TYPE
 if (NOT CMAKE_BUILD_TYPE)
diff --git a/docs/en/docs/install/source-install/compilation-general.md b/docs/en/docs/install/source-install/compilation-general.md
index 5d1a88f826..3130a63490 100644
--- a/docs/en/docs/install/source-install/compilation-general.md
+++ b/docs/en/docs/install/source-install/compilation-general.md
@@ -248,19 +248,9 @@ You can compile Doris directly in your own Linux environment.
 
 4. When using Clang to compile Doris, PCH files will be used by default to speed up the compilation process. The default configuration of ccache may cause PCH files to be unable to be cached, or the cache to be unable to be hit, resulting in PCH being repeatedly compiled, slowing down the compilation speed. The following configuration is required:  
 
-   To make ccache cache PCH files:
+   To use Clang to compile, but do not want to use PCH files to speed up the compilation process, you need to add the parameter `ENABLE_PCH=OFF`
    ```shell
-   export CCACHE_PCH_EXTSUM=true
-   ccache --set-config=sloppiness=pch_defines,time_macros --set-config=pch_external_checksum=true
-   ```
-   To stop ccache from caching PCH files:
-   ```shell
-   export CCACHE_NOPCH_EXTSUM=true
-   ccache --set-config=sloppiness=default --set-config=pch_external_checksum=false
-   ```
-   To use Clang to compile, but do not want to use PCH files to speed up the compilation process, you need to add the parameter `ENABLE_PCH=0`
-   ```shell
-   DORIS_TOOLCHAIN=clang ENABLE_PCH=0 sh build.sh
+   DORIS_TOOLCHAIN=clang ENABLE_PCH=OFF sh build.sh
    ```
 
 ## Special Statement
diff --git a/docs/zh-CN/docs/install/source-install/compilation-general.md b/docs/zh-CN/docs/install/source-install/compilation-general.md
index bbda6f6e32..c895c6083f 100644
--- a/docs/zh-CN/docs/install/source-install/compilation-general.md
+++ b/docs/zh-CN/docs/install/source-install/compilation-general.md
@@ -242,19 +242,9 @@ under the License.
 
 4. 在使用Clang编译Doris时会默认使用PCH文件来加速编译过程,ccache的默认配置可能会导致PCH文件无法被缓存,或者缓存无法被命中,进而导致PCH被重复编译,拖慢编译速度,需要进行如下配置:  
 
-   如需让ccache缓存PCH文件:
+   使用Clang编译,但不想使用PCH文件来加速编译过程,则需要加上参数`ENABLE_PCH=OFF`
    ```shell
-   export CCACHE_PCH_EXTSUM=true
-   ccache --set-config=sloppiness=pch_defines,time_macros --set-config=pch_external_checksum=true
-   ```
-   不再让ccache缓存PCH文件:
-   ```shell
-   export CCACHE_NOPCH_EXTSUM=true
-   ccache --set-config=sloppiness=default --set-config=pch_external_checksum=false
-   ```
-   使用Clang编译,但不想使用PCH文件来加速编译过程,则需要加上参数`ENABLE_PCH=0`
-   ```shell
-   DORIS_TOOLCHAIN=clang ENABLE_PCH=0 sh build.sh
+   DORIS_TOOLCHAIN=clang ENABLE_PCH=OFF sh build.sh
    ```
 
 ## 特别声明
diff --git a/env.sh b/env.sh
index 76fa34681d..12a314dc3a 100755
--- a/env.sh
+++ b/env.sh
@@ -122,7 +122,7 @@ if [[ "${DORIS_TOOLCHAIN}" == "gcc" ]]; then
     fi
 
     gcc_ver="$("${DORIS_GCC_HOME}/bin/gcc" -dumpfullversion -dumpversion)"
-    required_ver="7.3.0"
+    required_ver="11.0.0"
     if [[ ! "$(printf '%s\n' "${required_ver}" "${gcc_ver}" | sort -V | head -n1)" = "${required_ver}" ]]; then
         echo "Error: GCC version (${gcc_ver}) must be greater than or equal to ${required_ver}"
         exit 1
@@ -141,7 +141,7 @@ elif [[ "${DORIS_TOOLCHAIN}" == "clang" ]]; then
     fi
 
     clang_ver="$("${DORIS_CLANG_HOME}/bin/clang" -dumpfullversion -dumpversion)"
-    required_ver="13.0.0"
+    required_ver="16.0.0"
     if [[ ! "$(printf '%s\n' "${required_ver}" "${clang_ver}" | sort -V | head -n1)" = "${required_ver}" ]]; then
         echo "Error: CLANG version (${clang_ver}) must be greater than or equal to ${required_ver}"
         exit 1
@@ -156,14 +156,20 @@ elif [[ "${DORIS_TOOLCHAIN}" == "clang" ]]; then
     fi
     if [[ -z "${ENABLE_PCH}" ]]; then
         ENABLE_PCH='ON'
-    else
-        ENABLE_PCH='OFF'
     fi
 else
     echo "Error: unknown DORIS_TOOLCHAIN=${DORIS_TOOLCHAIN}, currently only 'gcc' and 'clang' are supported"
     exit 1
 fi
 
+if [[ "${ENABLE_PCH}" == "ON" ]]; then
+    export CCACHE_PCH_EXTSUM=true
+    export CCACHE_SLOPPINESS="pch_defines,time_macros"
+else
+    export CCACHE_NOPCH_EXTSUM=true
+    export CCACHE_SLOPPINESS="default"
+fi
+
 if [[ -z "${DORIS_BIN_UTILS}" ]]; then
     export DORIS_BIN_UTILS='/usr/bin/'
 fi
@@ -265,4 +271,3 @@ export GENERATOR
 export BUILD_SYSTEM
 
 export PKG_CONFIG_PATH="${DORIS_HOME}/thirdparty/installed/lib64/pkgconfig:${PKG_CONFIG_PATH}"
-export CCACHE_SLOPPINESS="time_macros pch_defines"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org