diff --git a/cpp/.gitignore b/cpp/.gitignore index 03149cde32e944bebf4dfe4026d4870fbbb6a6d9..6c2602d341cba3f789788eb287cf62575928ff5d 100644 --- a/cpp/.gitignore +++ b/cpp/.gitignore @@ -7,4 +7,4 @@ lcov_out/ base.info output.info output_new.info -server.info \ No newline at end of file +server.info diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index 03ffe1473195fccc883685f7453148f7b546e11f..966b584694971e8dd3e88ea75e1b232e66c76097 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -11,6 +11,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-149 - Fixed searching only one index file issue in distributed mode - MS-153 - fix c_str error when connecting to MySQL - MS-157 - fix changelog +- MS-190 - use env variable to switch mem manager and fix cmake ## Improvement - MS-156 - Add unittest for merge result functions diff --git a/cpp/cmake/ThirdPartyPackages.cmake b/cpp/cmake/ThirdPartyPackages.cmake index 2c6c61dbf4dce8ffc19f91421bad7846084526f8..b4b21b8085e4a910e57bfab46d0a4c1be27b3f9a 100644 --- a/cpp/cmake/ThirdPartyPackages.cmake +++ b/cpp/cmake/ThirdPartyPackages.cmake @@ -664,7 +664,8 @@ macro(build_knowhere) ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=${KNOWHERE_PREFIX}" -DCMAKE_INSTALL_LIBDIR=lib - -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc + "-DCMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}" + "-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release) externalproject_add(knowhere_ep diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index 7a1442cbef71a3499febfb9eaf04faf9f66a57bb..81a085b153b28a6202d74c3ae5b3e60de988a0c4 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -209,6 +209,7 @@ install(TARGETS milvus_server DESTINATION bin) install(FILES ${CMAKE_BINARY_DIR}/knowhere_ep-prefix/src/knowhere_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}tbb${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/knowhere_ep-prefix/src/knowhere_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}tbb${CMAKE_SHARED_LIBRARY_SUFFIX}.2 ${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX}.3 ${CMAKE_BINARY_DIR}/mysqlpp_ep-prefix/src/mysqlpp_ep/lib/${CMAKE_SHARED_LIBRARY_PREFIX}mysqlpp${CMAKE_SHARED_LIBRARY_SUFFIX}.3.2.4 diff --git a/cpp/src/db/Factories.cpp b/cpp/src/db/Factories.cpp index 65c7484a502ae5e88ed77f9eba1ccc80890858f4..3cfb9a6eb3c6938c73cfcf232960b194a1096a3a 100644 --- a/cpp/src/db/Factories.cpp +++ b/cpp/src/db/Factories.cpp @@ -3,12 +3,14 @@ // Unauthorized copying of this file, via any medium is strictly prohibited. // Proprietary and confidential. //////////////////////////////////////////////////////////////////////////////// -#include + #include "Factories.h" #include "DBImpl.h" #include "MemManager.h" #include "NewMemManager.h" +#include "Exception.h" +#include #include #include #include @@ -16,7 +18,9 @@ #include #include #include -#include "Exception.h" +#include +#include +#include namespace zilliz { namespace milvus { @@ -101,11 +105,17 @@ DB* DBFactory::Build(const Options& options) { MemManagerAbstractPtr MemManagerFactory::Build(const std::shared_ptr& meta, const Options& options) { -#ifdef USE_NEW_MEM_MANAGER + if (const char* env = getenv("MILVUS_USE_OLD_MEM_MANAGER")) { + std::string env_str = env; + std::transform(env_str.begin(), env_str.end(), env_str.begin(), ::toupper); + if (env_str == "ON") { + return std::make_shared(meta, options); + } + else { + return std::make_shared(meta, options); + } + } return std::make_shared(meta, options); -#else - return std::make_shared(meta, options); -#endif } } // namespace engine diff --git a/cpp/thirdparty/knowhere b/cpp/thirdparty/knowhere index 3a052d063ff9b360529a4a120f9703f00c603437..c3123501d62f69f9eacaa73ee96c0daeb24620a5 160000 --- a/cpp/thirdparty/knowhere +++ b/cpp/thirdparty/knowhere @@ -1 +1 @@ -Subproject commit 3a052d063ff9b360529a4a120f9703f00c603437 +Subproject commit c3123501d62f69f9eacaa73ee96c0daeb24620a5 diff --git a/cpp/unittest/db/CMakeLists.txt b/cpp/unittest/db/CMakeLists.txt index 213eb146ed2873807be41d771b08280d133ebfea..2d360a5d62db13a902fc01e2dfc1f97ad32dac73 100644 --- a/cpp/unittest/db/CMakeLists.txt +++ b/cpp/unittest/db/CMakeLists.txt @@ -39,7 +39,7 @@ set(db_test_src cuda_add_executable(db_test ${db_test_src}) set(db_libs - sqlite3 + sqlite boost_system boost_filesystem lz4 diff --git a/cpp/unittest/metrics/CMakeLists.txt b/cpp/unittest/metrics/CMakeLists.txt index d7ae12aff85c969188a053db88a99093c1ad0a0c..e55f99eb3e4abd4b13f5f0faf4757390d86be44e 100644 --- a/cpp/unittest/metrics/CMakeLists.txt +++ b/cpp/unittest/metrics/CMakeLists.txt @@ -77,7 +77,7 @@ target_link_libraries(metrics_test ${knowhere_libs} cudart cublas - sqlite3 + sqlite boost_system boost_filesystem lz4