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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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