diff --git a/CMakeLists.txt b/CMakeLists.txt index 84bf26e88..9235e6e92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,8 @@ knowhere_option(WITH_LIGHT "Build with light weight version" OFF) # cardinal is an enterprise vector search engine and can only be enabled for # cloud environment knowhere_option(WITH_CARDINAL "Build with cardinal" OFF) -knowhere_option(CARDINAL_VERSION_FORCE_CHECKOUT "Force checkout cardinal version" OFF) +knowhere_option(CARDINAL_VERSION_FORCE_CHECKOUT + "Force checkout cardinal version" OFF) # this is needed for clang on ubuntu:20.04, otherwise the linked fails with # 'undefined reference' error. fmt v9 was used by the time the error was # encountered. clang on ubuntu:22.04 seems to be unaffected. gcc seems to be @@ -97,10 +98,10 @@ find_package(nlohmann_json REQUIRED) find_package(glog REQUIRED) find_package(prometheus-cpp REQUIRED) if(NOT WITH_RAFT) - find_package(fmt REQUIRED) + find_package(fmt REQUIRED) endif() if(NOT WITH_LIGHT) - find_package(opentelemetry-cpp REQUIRED) + find_package(opentelemetry-cpp REQUIRED) endif() set(CMAKE_CXX_STANDARD 17) set(CMAKE_OSX_DEPLOYMENT_TARGET @@ -131,8 +132,18 @@ if(NOT WITH_LIGHT) endif() if(WITH_LIGHT) - knowhere_file_glob(GLOB_RECURSE KNOWHERE_SRCS src/common/*.cc - src/index/hnsw/hnsw.cc src/io/*.cc src/index/index_factory.cc) + knowhere_file_glob( + GLOB_RECURSE + KNOWHERE_SRCS + src/common/*.cc + src/index/ivf/ivf.cc + src/index/index_node_data_mock_wrapper.cc + src/index/index_static.cc + src/index/index.cc + src/index/interrupt.cc + src/index/sparse/*.cc + src/io/*.cc + src/index/index_factory.cc) knowhere_file_glob(GLOB_RECURSE KNOWHERE_TRACER_SRCS src/common/tracer.cc src/common/prometheus_client.cc) list(REMOVE_ITEM KNOWHERE_SRCS ${KNOWHERE_TRACER_SRCS}) diff --git a/conanfile.py b/conanfile.py index 3de79f9e4..094d733b3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -33,6 +33,7 @@ class KnowhereConan(ConanFile): "with_benchmark": [True, False], "with_coverage": [True, False], "with_faiss_tests": [True, False], + "with_light": [True, False], } default_options = { "shared": True, @@ -50,6 +51,7 @@ class KnowhereConan(ConanFile): "boost:without_test": True, "fmt:header_only": True, "with_faiss_tests": False, + "with_light": False, } exports_sources = ( @@ -95,7 +97,8 @@ def requirements(self): self.requires("fmt/9.1.0") self.requires("folly/2023.10.30.08@milvus/dev") self.requires("libcurl/8.2.1") - self.requires("opentelemetry-cpp/1.8.1.1@milvus/dev") + if not self.options.with_light: + self.requires("opentelemetry-cpp/1.8.1.1@milvus/dev") if self.settings.os != "Macos": self.requires("libunwind/1.7.2") if self.options.with_ut: @@ -164,6 +167,7 @@ def generate(self): tc.variables["WITH_BENCHMARK"] = self.options.with_benchmark tc.variables["WITH_COVERAGE"] = self.options.with_coverage tc.variables["WITH_FAISS_TESTS"] = self.options.with_faiss_tests + tc.variables["WITH_LIGHT"] = self.options.with_light tc.generate() deps = CMakeDeps(self) diff --git a/src/common/comp/brute_force.cc b/src/common/comp/brute_force.cc index 7d29e37a4..80ee7154f 100644 --- a/src/common/comp/brute_force.cc +++ b/src/common/comp/brute_force.cc @@ -539,7 +539,6 @@ BruteForce::SearchSparseWithBuf(const DataSetPtr base_dataset, const DataSetPtr float* distances, const Json& config, const BitsetView& bitset) { auto base = static_cast*>(base_dataset->GetTensor()); auto rows = base_dataset->GetRows(); - auto dim = base_dataset->GetDim(); auto xb_id_offset = base_dataset->GetTensorBeginId(); auto xq = static_cast*>(query_dataset->GetTensor()); @@ -555,6 +554,7 @@ BruteForce::SearchSparseWithBuf(const DataSetPtr base_dataset, const DataSetPtr #if defined(NOT_COMPILE_FOR_SWIG) && !defined(KNOWHERE_WITH_LIGHT) // LCOV_EXCL_START + auto dim = base_dataset->GetDim(); std::shared_ptr span = nullptr; if (cfg.trace_id.has_value()) { auto trace_id_str = tracer::GetIDFromHexStr(cfg.trace_id.value()); @@ -776,7 +776,6 @@ BruteForce::AnnIterator>(const DataSetPtr bas const BitsetView& bitset) { auto base = static_cast*>(base_dataset->GetTensor()); auto rows = base_dataset->GetRows(); - auto dim = base_dataset->GetDim(); auto xb_id_offset = base_dataset->GetTensorBeginId(); auto xq = static_cast*>(query_dataset->GetTensor()); @@ -795,6 +794,7 @@ BruteForce::AnnIterator>(const DataSetPtr bas #if defined(NOT_COMPILE_FOR_SWIG) && !defined(KNOWHERE_WITH_LIGHT) // LCOV_EXCL_START + auto dim = base_dataset->GetDim(); std::shared_ptr span = nullptr; if (cfg.trace_id.has_value()) { auto trace_id_str = tracer::GetIDFromHexStr(cfg.trace_id.value());