From a219a41dde8e59b78c05f57ebdb779ea8079afa6 Mon Sep 17 00:00:00 2001 From: HappenLee Date: Wed, 14 Sep 2022 12:30:09 +0800 Subject: [PATCH] [dependency](xxhash) Add xxhash lib (#12566) Add xxhash lib for BE, which is the faster hash method by test. --- dist/LICENSE-dist.txt | 1 + dist/licenses/LICENSE-xxhash.txt | 26 ++++++++++++++++++++++++++ thirdparty/build-thirdparty.sh | 11 +++++++++++ thirdparty/vars.sh | 7 +++++++ 4 files changed, 45 insertions(+) create mode 100644 dist/licenses/LICENSE-xxhash.txt diff --git a/dist/LICENSE-dist.txt b/dist/LICENSE-dist.txt index 2932e51692..497e626196 100644 --- a/dist/LICENSE-dist.txt +++ b/dist/LICENSE-dist.txt @@ -1570,3 +1570,4 @@ Other dependencies: * pdqsort: 0.0.0+git20180419 -- license/LICENSE-pdqsort.txt * breakpad@38ee0be -- license/LICENSE-breakpod.txt * xsimd: xmid@e9234cd6 -- license/LICENSE-xsimd.txt + * xxhash: 0.8.1 -- license/LICENSE-xxhash.txt diff --git a/dist/licenses/LICENSE-xxhash.txt b/dist/licenses/LICENSE-xxhash.txt new file mode 100644 index 0000000000..e4c5da7234 --- /dev/null +++ b/dist/licenses/LICENSE-xxhash.txt @@ -0,0 +1,26 @@ +xxHash Library +Copyright (c) 2012-2021 Yann Collet +All rights reserved. + +BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index a9ceb3820c..28c2ff353d 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -1382,6 +1382,16 @@ build_sse2neon() { cp sse2neon.h "${TP_INSTALL_DIR}/include/" } +# xxhash +build_xxhash() { + check_if_source_exist "${XXHASH_SOURCE}" + cd "${TP_SOURCE_DIR}/${XXHASH_SOURCE}" + + make -j "${PARALLEL}" + cp -r ./*.h "${TP_INSTALL_DIR}/include/" + cp libxxhash.a "${TP_INSTALL_DIR}/lib64" +} + build_libunixodbc build_openssl build_libevent @@ -1434,5 +1444,6 @@ build_nlohmann_json build_opentelemetry build_libbacktrace build_sse2neon +build_xxhash echo "Finished to build all thirdparties" diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh index 96148f6628..12514e4877 100644 --- a/thirdparty/vars.sh +++ b/thirdparty/vars.sh @@ -423,6 +423,12 @@ SSE2NEON_NAME=sse2neon-1.5.1.tar.gz SSE2NEON_SOURCE=sse2neon-1.5.1 SSE2NEON_MD5SUM="9de5dc2970aa7efac7faee59e2826c51" +# xxhash +XXHASH_DOWNLOAD="https://github.com/Cyan4973/xxHash/archive/refs/tags/v0.8.1.tar.gz" +XXHASH_NAME=xxHash-0.8.1.tar.gz +XXHASH_SOURCE=xxHash-0.8.1 +XXHASH_MD5SUM="b67c587f5ff4894253da0095ba7ea393" + # all thirdparties which need to be downloaded is set in array TP_ARCHIVES export TP_ARCHIVES=( 'LIBEVENT' @@ -484,4 +490,5 @@ export TP_ARCHIVES=( 'OPENTELEMETRY' 'LIBBACKTRACE' 'SSE2NEON' + 'XXHASH' )