From 6956dfaed6003adafd34c4541903155dfdecf4d0 Mon Sep 17 00:00:00 2001 From: Masajiro Iwasaki Date: Mon, 13 May 2024 10:37:35 +0900 Subject: [PATCH] fix the github issue #157 --- bin/CMakeLists.txt | 2 +- lib/NGT/CMakeLists.txt | 8 +++++--- lib/NGT/NGTQ/Quantizer.h | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 4650d6c..fc8694e 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -2,7 +2,7 @@ if(${UNIX}) include_directories("${PROJECT_SOURCE_DIR}/lib" "${PROJECT_BINARY_DIR}/lib/") link_directories("${PROJECT_BINARY_DIR}/lib/NGT") add_subdirectory("${PROJECT_SOURCE_DIR}/bin/ngt") - if(NOT DEFINED NGT_SHARED_MEMORY_ALLOCATOR OR (NOT ${NGT_SHARED_MEMORY_ALLOCATOR})) + if(NOT DEFINED NGT_QBG_DISABLED OR (NOT ${NGT_QBG_DISABLED})) add_subdirectory("${PROJECT_SOURCE_DIR}/bin/qbg") endif() endif() diff --git a/lib/NGT/CMakeLists.txt b/lib/NGT/CMakeLists.txt index a27452d..681990b 100644 --- a/lib/NGT/CMakeLists.txt +++ b/lib/NGT/CMakeLists.txt @@ -3,7 +3,11 @@ if( ${UNIX} ) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/defines.h.in ${CMAKE_CURRENT_BINARY_DIR}/defines.h) include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/lib" "${PROJECT_BINARY_DIR}/lib/") - file(GLOB NGT_SOURCES *.cpp NGTQ/*.cpp) + if(${NGT_QBG_DISABLED}) + file(GLOB NGT_SOURCES *.cpp) + else() + file(GLOB NGT_SOURCES *.cpp NGTQ/*.cpp) + endif() file(GLOB HEADER_FILES *.h *.hpp) file(GLOB NGTQ_HEADER_FILES NGTQ/*.h NGTQ/*.hpp) @@ -35,8 +39,6 @@ if( ${UNIX} ) add_custom_command(OUTPUT command DEPENDS ${NGT_SOURCES} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND sh ${PROJECT_SOURCE_DIR}/utils/mk_version_defs_h.sh ${PROJECT_SOURCE_DIR} version_defs.h) add_custom_target(versiondef DEPENDS command) add_dependencies(ngtstatic versiondef) - - install(TARGETS ngt ngtstatic diff --git a/lib/NGT/NGTQ/Quantizer.h b/lib/NGT/NGTQ/Quantizer.h index 2319b30..66dfa49 100644 --- a/lib/NGT/NGTQ/Quantizer.h +++ b/lib/NGT/NGTQ/Quantizer.h @@ -2558,6 +2558,7 @@ class QuantizedObjectProcessingStream { } } +#ifdef NGTQ_QBG void restoreToInvertedIndex(NGTQ::InvertedIndexEntry &invertedIndexObjects) { #if defined(NGT_SHARED_MEMORY_ALLOCATOR) std::cerr << "Not implemented." << std::endl; @@ -2572,6 +2573,7 @@ class QuantizedObjectProcessingStream { invertedIndexObjects.resize(numOfObjects); #endif } +#endif uint8_t* getStream() { auto s = stream;