Enable marisa trie ut on MacOS (#17316)

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
This commit is contained in:
Jiquan Long 2022-06-02 10:48:03 +08:00 committed by GitHub
parent 7527285ec4
commit e88ffb8a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 12 deletions

View File

@ -13,9 +13,9 @@ aux_source_directory( ${MILVUS_ENGINE_SRC}/index INDEX_FILES )
add_library( milvus_index SHARED ${INDEX_FILES} ) add_library( milvus_index SHARED ${INDEX_FILES} )
# TODO: support compile marisa on windows and mac. # TODO: support compile marisa on windows.
set(PLATFORM_LIBS ) set(PLATFORM_LIBS )
if ( LINUX ) if ( LINUX OR APPLE )
set(PLATFORM_LIBS marisa) set(PLATFORM_LIBS marisa)
endif() endif()
if (MSYS) if (MSYS)

View File

@ -32,7 +32,7 @@ IndexFactory::CreateIndex(const std::string& index_type) {
template <> template <>
inline ScalarIndexPtr<std::string> inline ScalarIndexPtr<std::string>
IndexFactory::CreateIndex(const std::string& index_type) { IndexFactory::CreateIndex(const std::string& index_type) {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
return CreateStringIndexMarisa(); return CreateStringIndexMarisa();
#else #else
throw std::runtime_error("unsupported platform"); throw std::runtime_error("unsupported platform");

View File

@ -24,7 +24,7 @@
namespace milvus::scalar { namespace milvus::scalar {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
int64_t int64_t
StringIndexMarisa::Size() { StringIndexMarisa::Size() {

View File

@ -11,7 +11,7 @@
#pragma once #pragma once
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#include <marisa.h> #include <marisa.h>
#include "index/StringIndex.h" #include "index/StringIndex.h"

View File

@ -16,7 +16,7 @@ macro(build_marisa)
if ( LINUX ) if ( LINUX )
set (MARISA_CONFIGURE_COMMAND cd ${MARISA_DIR} && libtoolize && autoreconf -i && ./configure --prefix=${MARISA_INSTALL_PREFIX}) set (MARISA_CONFIGURE_COMMAND cd ${MARISA_DIR} && libtoolize && autoreconf -i && ./configure --prefix=${MARISA_INSTALL_PREFIX})
else() else()
set (MARISA_CONFIGURE_COMMAND brew install automake && cd ${MARISA_DIR} && glibtoolize && autoreconf -i && ./configure --prefix=${MARISA_INSTALL_PREFIX}) set (MARISA_CONFIGURE_COMMAND brew install automake libtool && cd ${MARISA_DIR} && glibtoolize && autoreconf -i && ./configure --prefix=${MARISA_INSTALL_PREFIX})
endif() endif()
set (MARISA_BUILD_COMMAND make -j) set (MARISA_BUILD_COMMAND make -j)

View File

@ -45,8 +45,7 @@ set(MILVUS_TEST_FILES
test_utils.cpp test_utils.cpp
) )
# These 2 cases cannot run in mac because of tbb build error if (LINUX OR APPLE)
if (LINUX)
set(MILVUS_TEST_FILES set(MILVUS_TEST_FILES
${MILVUS_TEST_FILES} ${MILVUS_TEST_FILES}
test_scalar_index_creator.cpp test_scalar_index_creator.cpp

View File

@ -15,11 +15,11 @@
#include <knowhere/index/vector_index/ConfAdapterMgr.h> #include <knowhere/index/vector_index/ConfAdapterMgr.h>
#include <knowhere/archive/KnowhereConfig.h> #include <knowhere/archive/KnowhereConfig.h>
#define private public
#include "indexbuilder/index_c.h" #include "indexbuilder/index_c.h"
#include "test_utils/DataGen.h" #include "test_utils/DataGen.h"
#include "test_utils/indexbuilder_test_utils.h" #include "test_utils/indexbuilder_test_utils.h"
#define private public
#include "indexbuilder/ScalarIndexCreator.h" #include "indexbuilder/ScalarIndexCreator.h"
#include "indexbuilder/IndexFactory.h" #include "indexbuilder/IndexFactory.h"

View File

@ -14,12 +14,13 @@
#include <knowhere/index/vector_index/adapter/VectorAdapter.h> #include <knowhere/index/vector_index/adapter/VectorAdapter.h>
#include <knowhere/archive/KnowhereConfig.h> #include <knowhere/archive/KnowhereConfig.h>
#define private public
#include "index/Index.h" #include "index/Index.h"
#include "index/ScalarIndex.h" #include "index/ScalarIndex.h"
#define private public
#include "index/StringIndex.h" #include "index/StringIndex.h"
#include "index/StringIndexMarisa.h" #include "index/StringIndexMarisa.h"
#include "index/IndexFactory.h" #include "index/IndexFactory.h"
#include "test_utils/indexbuilder_test_utils.h" #include "test_utils/indexbuilder_test_utils.h"
#include "test_utils/AssertUtils.h" #include "test_utils/AssertUtils.h"