Move BLAKE3 tests away from fasttest + add USE_BLAKE3 key to CMakeLists

This commit is contained in:
BoloniniD 2022-01-09 22:52:03 +03:00
parent 450f0a53b9
commit 82027176f1
8 changed files with 22 additions and 11 deletions

View File

@ -21,8 +21,6 @@ endif()
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)
add_subdirectory (BLAKE3)
add_subdirectory (abseil-cpp-cmake)
add_subdirectory (magic-enum-cmake)
add_subdirectory (boost-cmake)
@ -40,6 +38,10 @@ add_subdirectory (replxx-cmake)
add_subdirectory (unixodbc-cmake)
add_subdirectory (nanodbc-cmake)
if (USE_BLAKE3)
add_subdirectory(BLAKE3)
endif()
if (USE_INTERNAL_CAPNP_LIBRARY AND NOT MISSING_INTERNAL_CAPNP_LIBRARY)
add_subdirectory(capnproto-cmake)
endif ()

View File

@ -67,8 +67,6 @@ RUN apt-get update \
software-properties-common \
tzdata \
unixodbc \
rustc \
cargo \
--yes --no-install-recommends
RUN pip3 install numpy scipy pandas Jinja2

View File

@ -175,7 +175,6 @@ function clone_submodules
contrib/NuRaft
contrib/jemalloc
contrib/replxx
contrib/BLAKE3
)
git submodule sync

View File

@ -32,7 +32,9 @@ RUN apt-get update -y \
wget \
mysql-client=5.7* \
postgresql-client \
sqlite3
sqlite3 \
rustc \
cargo
RUN pip3 install numpy scipy pandas Jinja2

View File

@ -23,7 +23,6 @@ target_link_libraries(clickhouse_functions
dbms
metrohash
murmurhash
blake3
PRIVATE
${ZLIB_LIBRARIES}
@ -31,6 +30,10 @@ target_link_libraries(clickhouse_functions
divide_impl
)
if (USE_BLAKE3)
target_link_libraries(clickhouse_functions PUBLIC blake3)
endif()
if (OPENSSL_CRYPTO_LIBRARY)
target_link_libraries(clickhouse_functions PUBLIC ${OPENSSL_CRYPTO_LIBRARY})
endif()

View File

@ -42,6 +42,8 @@ void registerFunctionsHashing(FunctionFactory & factory)
factory.registerFunction<FunctionXxHash64>();
#endif
#if USE_BLAKE3
factory.registerFunction<FunctionBLAKE3>();
#endif
}
}

View File

@ -9,7 +9,9 @@
#include "config_functions.h"
#include "config_core.h"
#if USE_BLAKE3
# include <blake3.h>
#endif
#include <Common/SipHash.h>
#include <Common/typeid_cast.h>
@ -596,7 +598,7 @@ struct ImplXxHash64
#endif
#if USE_BLAKE3
struct ImplBLAKE3
{
static constexpr auto name = "BLAKE3";
@ -610,6 +612,7 @@ struct ImplBLAKE3
std::memcpy(out_char_data, as_bytes_shim(&res), OUT_LEN);
}
};
#endif
template <typename Impl>
@ -1435,6 +1438,7 @@ using FunctionHiveHash = FunctionAnyHash<HiveHashImpl>;
using FunctionXxHash64 = FunctionAnyHash<ImplXxHash64>;
#endif
#if USE_BLAKE3
using FunctionBLAKE3 = FunctionStringHashFixedString<ImplBLAKE3>;
#endif
}

View File

@ -8,3 +8,4 @@
#cmakedefine01 USE_H3
#cmakedefine01 USE_S2_GEOMETRY
#cmakedefine01 USE_FASTOPS
#cmakedefine01 USE_BLAKE3