This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 23772a38cbf branch-4.1: [Fix](build) Manage datasketches-cpp in the BE
CMake build tree (#66511) (#66577)
23772a38cbf is described below
commit 23772a38cbfa50cbfa3ebce58aa9a2b317713427
Author: linrrarity <[email protected]>
AuthorDate: Sun Aug 9 07:27:05 2026 +0800
branch-4.1: [Fix](build) Manage datasketches-cpp in the BE CMake build tree
(#66511) (#66577)
pick: https://github.com/apache/doris/pull/66511
---
be/CMakeLists.txt | 10 ++++++++++
be/src/exprs/CMakeLists.txt | 4 +++-
.../aggregate/aggregate_function_datasketches_hll_union_agg.h | 2 +-
.../exprs/aggregate/agg_datasketches_hll_union_agg_test.cpp | 2 +-
build.sh | 7 -------
run-be-ut.sh | 7 -------
6 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 05bdc796351..fb32ae2782c 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -232,6 +232,16 @@ SET(ZSTD_HOME "$ENV{DORIS_THIRDPARTY}/installed")
SET(ZSTD_INCLUDE_DIR "$ENV{DORIS_THIRDPARTY}/installed/include/zstd")
SET(CONTRIB_PATH "${PROJECT_SOURCE_DIR}/../contrib")
+set(BUILD_TESTS OFF)
+add_subdirectory(
+ ${CONTRIB_PATH}/datasketches-cpp
+ ${PROJECT_BINARY_DIR}/datasketches-cpp
+ EXCLUDE_FROM_ALL)
+target_include_directories(
+ hll SYSTEM INTERFACE
$<BUILD_INTERFACE:${CONTRIB_PATH}/datasketches-cpp/hll/include>)
+target_include_directories(
+ common SYSTEM INTERFACE
$<BUILD_INTERFACE:${CONTRIB_PATH}/datasketches-cpp/common/include>)
+
# Out of source build need to set the binary dir
add_subdirectory(${CONTRIB_PATH}/apache-orc ${PROJECT_BINARY_DIR}/apache-orc
EXCLUDE_FROM_ALL)
target_compile_options(orc PRIVATE -fno-omit-frame-pointer
-Wno-implicit-fallthrough -w)
diff --git a/be/src/exprs/CMakeLists.txt b/be/src/exprs/CMakeLists.txt
index d8995ccd8ad..62cc03b4c5c 100644
--- a/be/src/exprs/CMakeLists.txt
+++ b/be/src/exprs/CMakeLists.txt
@@ -32,7 +32,9 @@ set(SRC_FILES ${SRC_FILES}
add_library(Exprs STATIC ${SRC_FILES})
# function_array_distance uses faiss headers (platform_macros.h, distances.h),
# which are exported by ann_index via PUBLIC linkage with faiss.
-target_link_libraries(Exprs PRIVATE ann_index)
+target_link_libraries(Exprs
+ PRIVATE ann_index
+ PUBLIC DataSketches::HLL)
pch_reuse(Exprs)
diff --git
a/be/src/exprs/aggregate/aggregate_function_datasketches_hll_union_agg.h
b/be/src/exprs/aggregate/aggregate_function_datasketches_hll_union_agg.h
index d9f82f193e8..0a4c6f9d1d5 100644
--- a/be/src/exprs/aggregate/aggregate_function_datasketches_hll_union_agg.h
+++ b/be/src/exprs/aggregate/aggregate_function_datasketches_hll_union_agg.h
@@ -18,9 +18,9 @@
#pragma once
#include <stddef.h>
-#include <DataSketches/hll.hpp>
#include <algorithm>
#include <boost/iterator/iterator_facade.hpp>
+#include <hll.hpp>
#include <memory>
#include <optional>
#include <type_traits>
diff --git a/be/test/exprs/aggregate/agg_datasketches_hll_union_agg_test.cpp
b/be/test/exprs/aggregate/agg_datasketches_hll_union_agg_test.cpp
index 7783ec89e2c..eeaeb2a45dc 100644
--- a/be/test/exprs/aggregate/agg_datasketches_hll_union_agg_test.cpp
+++ b/be/test/exprs/aggregate/agg_datasketches_hll_union_agg_test.cpp
@@ -17,7 +17,7 @@
#include <gtest/gtest.h>
-#include <DataSketches/hll.hpp>
+#include <hll.hpp>
#include "agent/be_exec_version_manager.h"
#include "common/config.h"
diff --git a/build.sh b/build.sh
index 2200aa1c71d..428633870c8 100755
--- a/build.sh
+++ b/build.sh
@@ -34,7 +34,6 @@ if [[ -z "${DORIS_THIRDPARTY}" ]]; then
export DORIS_THIRDPARTY="${DORIS_HOME}/thirdparty"
fi
export TP_INCLUDE_DIR="${DORIS_THIRDPARTY}/installed/include"
-export TP_INSTALLED_DIR="${DORIS_THIRDPARTY}/installed"
export TP_LIB_DIR="${DORIS_THIRDPARTY}/installed/lib"
HADOOP_DEPS_NAME="hadoop-deps"
. "${DORIS_HOME}/env.sh"
@@ -794,13 +793,7 @@ FE_MODULES="$(
# Clean and build Backend
if [[ "${BUILD_BE}" -eq 1 ]]; then
- echo "install datasketches-cpp to thirdparty path before build be"
update_submodule "contrib/datasketches-cpp" "datasketches-cpp"
"https://github.com/apache/datasketches-cpp/archive/refs/heads/master.tar.gz"
- cd "${DORIS_HOME}/contrib/datasketches-cpp"
- "${CMAKE_CMD}" -S . -B build/Release -DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$TP_INSTALLED_DIR -DBUILD_TESTS=OFF
- "${CMAKE_CMD}" --build build/Release -t install
- cd "${DORIS_HOME}"
-
update_submodule "contrib/apache-orc" "apache-orc"
"https://github.com/apache/doris-thirdparty/archive/refs/heads/orc.tar.gz"
update_submodule "contrib/clucene" "clucene"
"https://github.com/apache/doris-thirdparty/archive/refs/heads/clucene.tar.gz"
update_submodule "contrib/openblas" "openblas"
"https://github.com/apache/doris-thirdparty/archive/refs/heads/openblas.tar.gz"
diff --git a/run-be-ut.sh b/run-be-ut.sh
index 97e5759a9a4..ae93cd565c0 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -45,7 +45,6 @@ if [[ -z "${DORIS_THIRDPARTY}" ]]; then
export DORIS_THIRDPARTY="${DORIS_HOME}/thirdparty"
fi
export TP_INCLUDE_DIR="${DORIS_THIRDPARTY}/installed/include"
-export TP_INSTALLED_DIR="${DORIS_THIRDPARTY}/installed"
export TP_LIB_DIR="${DORIS_THIRDPARTY}/installed/lib"
. "${DORIS_HOME}/env.sh"
# shellcheck source=thirdparty/arrow-paimon-vars.sh
@@ -276,13 +275,7 @@ update_submodule() {
fi
}
-echo "install datasketches-cpp to thirdparty path before build backend ut"
update_submodule "contrib/datasketches-cpp" "datasketches-cpp"
"https://github.com/apache/datasketches-cpp/archive/refs/heads/master.tar.gz"
-cd "${DORIS_HOME}/contrib/datasketches-cpp"
-"${CMAKE_CMD}" -S . -B build/Release -DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$TP_INSTALLED_DIR -DBUILD_TESTS=OFF
-"${CMAKE_CMD}" --build build/Release -t install
-cd "${DORIS_HOME}"
-
update_submodule "contrib/apache-orc" "apache-orc"
"https://github.com/apache/doris-thirdparty/archive/refs/heads/orc.tar.gz"
update_submodule "contrib/clucene" "clucene"
"https://github.com/apache/doris-thirdparty/archive/refs/heads/clucene.tar.gz"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]