mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 19:08:30 +08:00
Enable marisa trie ut on MacOS (#17316)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
This commit is contained in:
parent
7527285ec4
commit
e88ffb8a57
@ -13,9 +13,9 @@ aux_source_directory( ${MILVUS_ENGINE_SRC}/index 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 )
|
||||
if ( LINUX )
|
||||
if ( LINUX OR APPLE )
|
||||
set(PLATFORM_LIBS marisa)
|
||||
endif()
|
||||
if (MSYS)
|
||||
|
@ -32,7 +32,7 @@ IndexFactory::CreateIndex(const std::string& index_type) {
|
||||
template <>
|
||||
inline ScalarIndexPtr<std::string>
|
||||
IndexFactory::CreateIndex(const std::string& index_type) {
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
return CreateStringIndexMarisa();
|
||||
#else
|
||||
throw std::runtime_error("unsupported platform");
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
namespace milvus::scalar {
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
|
||||
int64_t
|
||||
StringIndexMarisa::Size() {
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
|
||||
#include <marisa.h>
|
||||
#include "index/StringIndex.h"
|
||||
|
@ -16,7 +16,7 @@ macro(build_marisa)
|
||||
if ( LINUX )
|
||||
set (MARISA_CONFIGURE_COMMAND cd ${MARISA_DIR} && libtoolize && autoreconf -i && ./configure --prefix=${MARISA_INSTALL_PREFIX})
|
||||
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()
|
||||
|
||||
set (MARISA_BUILD_COMMAND make -j)
|
||||
|
@ -45,8 +45,7 @@ set(MILVUS_TEST_FILES
|
||||
test_utils.cpp
|
||||
)
|
||||
|
||||
# These 2 cases cannot run in mac because of tbb build error
|
||||
if (LINUX)
|
||||
if (LINUX OR APPLE)
|
||||
set(MILVUS_TEST_FILES
|
||||
${MILVUS_TEST_FILES}
|
||||
test_scalar_index_creator.cpp
|
||||
|
@ -15,11 +15,11 @@
|
||||
#include <knowhere/index/vector_index/ConfAdapterMgr.h>
|
||||
#include <knowhere/archive/KnowhereConfig.h>
|
||||
|
||||
#define private public
|
||||
|
||||
#include "indexbuilder/index_c.h"
|
||||
#include "test_utils/DataGen.h"
|
||||
#include "test_utils/indexbuilder_test_utils.h"
|
||||
|
||||
#define private public
|
||||
#include "indexbuilder/ScalarIndexCreator.h"
|
||||
#include "indexbuilder/IndexFactory.h"
|
||||
|
||||
|
@ -14,12 +14,13 @@
|
||||
#include <knowhere/index/vector_index/adapter/VectorAdapter.h>
|
||||
#include <knowhere/archive/KnowhereConfig.h>
|
||||
|
||||
#define private public
|
||||
|
||||
#include "index/Index.h"
|
||||
#include "index/ScalarIndex.h"
|
||||
|
||||
#define private public
|
||||
#include "index/StringIndex.h"
|
||||
#include "index/StringIndexMarisa.h"
|
||||
|
||||
#include "index/IndexFactory.h"
|
||||
#include "test_utils/indexbuilder_test_utils.h"
|
||||
#include "test_utils/AssertUtils.h"
|
||||
|
Loading…
Reference in New Issue
Block a user