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

cambyzju pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 743fb62a2c4 [fix](compile) fix two compile errors on MacOS (#33834) 
(#34005)
743fb62a2c4 is described below

commit 743fb62a2c42cc5cc662583c235f7336d5e6ddef
Author: camby <camby...@tencent.com>
AuthorDate: Thu Apr 25 19:39:35 2024 +0800

    [fix](compile) fix two compile errors on MacOS (#33834) (#34005)
---
 be/CMakeLists.txt                                                 | 5 +++++
 be/src/runtime/CMakeLists.txt                                     | 2 +-
 .../aggregate_function_group_array_intersect.h                    | 8 ++++----
 build.sh                                                          | 5 +++++
 regression-test/pipeline/performance/compile.sh                   | 1 +
 5 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index f5d99c69962..2082aa8def8 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -72,6 +72,7 @@ option(USE_LIBCPP "Use libc++" OFF)
 option(USE_MEM_TRACKER, "Use memory tracker" ON)
 option(USE_UNWIND "Use libunwind" ON)
 option(USE_JEMALLOC "Use jemalloc" ON)
+option(USE_JEMALLOC_HOOK "Use jemalloc hook" ON)
 if (OS_MACOSX)
     set(GLIBC_COMPATIBILITY OFF)
     set(USE_LIBCPP ON)
@@ -87,6 +88,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 "USE_JEMALLOC_HOOK is ${USE_JEMALLOC_HOOK}")
 message(STATUS "USE_UNWIND is ${USE_UNWIND}")
 message(STATUS "ENABLE_PCH is ${ENABLE_PCH}")
 
@@ -341,6 +343,9 @@ endif()
 if (USE_JEMALLOC)
     add_compile_options(-DUSE_JEMALLOC)
 endif()
+if (USE_JEMALLOC_HOOK)
+    add_definitions(-DUSE_JEMALLOC_HOOK)
+endif()
 
 # Compile with libunwind
 if (USE_UNWIND)
diff --git a/be/src/runtime/CMakeLists.txt b/be/src/runtime/CMakeLists.txt
index a0b3b799a76..3bfec93edfc 100644
--- a/be/src/runtime/CMakeLists.txt
+++ b/be/src/runtime/CMakeLists.txt
@@ -25,7 +25,7 @@ set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/src/runtime")
 
 file(GLOB_RECURSE RUNTIME_FILES CONFIGURE_DEPENDS *.cpp *.cc)
 
-if (NOT USE_JEMALLOC OR NOT USE_MEM_TRACKER)
+if (NOT USE_JEMALLOC OR NOT USE_MEM_TRACKER OR NOT USE_JEMALLOC_HOOK)
     list(REMOVE_ITEM RUNTIME_FILES 
${CMAKE_CURRENT_SOURCE_DIR}/memory/jemalloc_hook.cpp)
 endif()
 
diff --git 
a/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h 
b/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h
index 03c1639c45a..5d627782f25 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_group_array_intersect.h
@@ -256,11 +256,11 @@ public:
         read_pod_binary(is_set_contains_null, buf);
         data.value->change_contains_null_value(is_set_contains_null);
         read_pod_binary(data.init, buf);
-        size_t size;
+        UInt64 size;
         read_var_uint(size, buf);
 
         T element;
-        for (size_t i = 0; i < size; ++i) {
+        for (UInt64 i = 0; i < size; ++i) {
             read_int_binary(element, buf);
             data.value->insert(static_cast<void*>(&element));
         }
@@ -484,11 +484,11 @@ public:
         read_pod_binary(is_set_contains_null, buf);
         data.value->change_contains_null_value(is_set_contains_null);
         read_pod_binary(data.init, buf);
-        size_t size;
+        UInt64 size;
         read_var_uint(size, buf);
 
         StringRef element;
-        for (size_t i = 0; i < size; ++i) {
+        for (UInt64 i = 0; i < size; ++i) {
             element = read_string_binary_into(*arena, buf);
             data.value->insert((void*)element.data, element.size);
         }
diff --git a/build.sh b/build.sh
index efa808652b6..99de71173ac 100755
--- a/build.sh
+++ b/build.sh
@@ -346,6 +346,9 @@ fi
 if [[ -z "${USE_JEMALLOC}" ]]; then
     USE_JEMALLOC='ON'
 fi
+if [[ -z "${USE_JEMALLOC_HOOK}" ]]; then
+    USE_JEMALLOC_HOOK='OFF'
+fi
 if [[ -z "${USE_BTHREAD_SCANNER}" ]]; then
     USE_BTHREAD_SCANNER='OFF'
 fi
@@ -446,6 +449,7 @@ echo "Get params:
     STRIP_DEBUG_INFO            -- ${STRIP_DEBUG_INFO}
     USE_MEM_TRACKER             -- ${USE_MEM_TRACKER}
     USE_JEMALLOC                -- ${USE_JEMALLOC}
+    USE_JEMALLOC_HOOK           -- ${USE_JEMALLOC_HOOK}
     USE_BTHREAD_SCANNER         -- ${USE_BTHREAD_SCANNER}
     ENABLE_STACKTRACE           -- ${ENABLE_STACKTRACE}
     DENABLE_CLANG_COVERAGE      -- ${DENABLE_CLANG_COVERAGE}
@@ -544,6 +548,7 @@ if [[ "${BUILD_BE}" -eq 1 ]]; then
         -DENABLE_PCH="${ENABLE_PCH}" \
         -DUSE_MEM_TRACKER="${USE_MEM_TRACKER}" \
         -DUSE_JEMALLOC="${USE_JEMALLOC}" \
+        -DUSE_JEMALLOC_HOOK="${USE_JEMALLOC_HOOK}" \
         -DENABLE_STACKTRACE="${ENABLE_STACKTRACE}" \
         -DUSE_AVX2="${USE_AVX2}" \
         -DGLIBC_COMPATIBILITY="${GLIBC_COMPATIBILITY}" \
diff --git a/regression-test/pipeline/performance/compile.sh 
b/regression-test/pipeline/performance/compile.sh
index cf4320f23b1..e0e40a71770 100644
--- a/regression-test/pipeline/performance/compile.sh
+++ b/regression-test/pipeline/performance/compile.sh
@@ -133,6 +133,7 @@ sudo docker run -i --rm \
                     && export EXTRA_CXX_FLAGS=-O3 \
                     && export USE_JEMALLOC='ON' \
                                        && export ENABLE_PCH=OFF \
+                    && export USE_JEMALLOC_HOOK='OFF' \
                     && export CUSTOM_NPM_REGISTRY=https://registry.npmjs.org \
                     && bash build.sh --fe --be --clean 2>&1 | tee build.log"
 set +x


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

Reply via email to