This commit is contained in:
Vladimir Makarov 2022-05-15 08:57:57 +00:00
parent e502ab2f55
commit d6512d257f
3 changed files with 5 additions and 9 deletions

View File

@ -2,16 +2,12 @@ set(SPOTIFY_ANNOY_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/spotify-annoy")
set(SPOTIFY_ANNOY_SOURCE_DIR "${SPOTIFY_ANNOY_PROJECT_DIR}/src")
set(SPOTIFY_ANNOY_INCLUDE_DIR "${SPOTIFY_ANNOY_PROJECT_DIR}/src")
set(SPOTIFY_ANNOY_HEADERS
${SPOTIFY_ANNOY_SOURCE_DIR}/annoylib.h
${SPOTIFY_ANNOY_SOURCE_DIR}/kissrandom.h
)
set(SPOTIFY_ANNOY_SRC
${SPOTIFY_ANNOY_SOURCE_DIR}/mman.h
)
add_library(_spotify_annoy ${SPOTIFY_ANNOY_SRC})
target_include_directories(_spotify_annoy SYSTEM PUBLIC ${SPOTIFY_ANNOY_SOURCE_DIR})
target_include_directories(_spotify_annoy SYSTEM PUBLIC ${SPOTIFY_ANNOY_INCLUDE_DIR})
set_target_properties(_spotify_annoy PROPERTIES LINKER_LANGUAGE CXX)
add_library(ch_contrib::spotify-annoy ALIAS _spotify_annoy)

View File

@ -59,10 +59,10 @@ float AnnoyIndexSerialize<Dist>::getSpaceDim() const
}
template<typename Dist>
void AnnoyIndexSerialize<Dist>::build(int num_of_trees)
bool AnnoyIndexSerialize<Dist>::build(int num_of_trees)
{
Base::_verbose = false;
Base::build(num_of_trees);
return Base::build(num_of_trees);
}

View File

@ -25,7 +25,7 @@ namespace Annoy
public:
AnnoyIndexSerialize() = delete;
explicit AnnoyIndexSerialize(const int dim) : Base::AnnoyIndex(dim) {}
void build(int num_of_trees);
bool build(int num_of_trees);
void serialize(WriteBuffer& ostr) const;
void deserialize(ReadBuffer& istr);
float getSpaceDim() const;