From 1ae249adb551a05f258bf84128ff4619c25a05ad Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Wed, 8 Dec 2021 23:23:06 +0800 Subject: [PATCH] Update profiler CMakeLists.txt (#13001) Signed-off-by: yudong.cai --- internal/core/src/segcore/CMakeLists.txt | 1 + internal/core/thirdparty/CMakeLists.txt | 2 +- .../thirdparty/{profilers => profiler}/CMakeLists.txt | 9 ++++++--- internal/core/unittest/CMakeLists.txt | 2 -- 4 files changed, 8 insertions(+), 6 deletions(-) rename internal/core/thirdparty/{profilers => profiler}/CMakeLists.txt (95%) diff --git a/internal/core/src/segcore/CMakeLists.txt b/internal/core/src/segcore/CMakeLists.txt index fc6b493c52..d054594420 100644 --- a/internal/core/src/segcore/CMakeLists.txt +++ b/internal/core/src/segcore/CMakeLists.txt @@ -44,5 +44,6 @@ target_link_libraries(milvus_segcore milvus_proto milvus_query milvus_utils +# gperftools ) diff --git a/internal/core/thirdparty/CMakeLists.txt b/internal/core/thirdparty/CMakeLists.txt index 9241a75d90..c58eb6d7f8 100644 --- a/internal/core/thirdparty/CMakeLists.txt +++ b/internal/core/thirdparty/CMakeLists.txt @@ -42,7 +42,7 @@ find_package( Threads REQUIRED ) if ( MILVUS_BUILD_TESTS ) add_subdirectory( gtest ) add_subdirectory( google_benchmark ) - add_subdirectory( profilers ) + add_subdirectory( profiler ) endif() diff --git a/internal/core/thirdparty/profilers/CMakeLists.txt b/internal/core/thirdparty/profiler/CMakeLists.txt similarity index 95% rename from internal/core/thirdparty/profilers/CMakeLists.txt rename to internal/core/thirdparty/profiler/CMakeLists.txt index 062ee5fac5..afbca20891 100644 --- a/internal/core/thirdparty/profilers/CMakeLists.txt +++ b/internal/core/thirdparty/profiler/CMakeLists.txt @@ -85,12 +85,12 @@ macro( build_gperftools ) ExternalProject_Get_Property( gperftools_ep INSTALL_DIR ) file(MAKE_DIRECTORY ${INSTALL_DIR}/include) - # libprofiler.a - add_library( gperftools STATIC IMPORTED ) + # libprofiler.so + add_library( gperftools SHARED IMPORTED ) set_target_properties( gperftools PROPERTIES IMPORTED_GLOBAL TRUE - IMPORTED_LOCATION "${INSTALL_DIR}/lib/libtcmalloc_and_profiler.a" + IMPORTED_LOCATION "${INSTALL_DIR}/lib/libtcmalloc_and_profiler.so" INTERFACE_INCLUDE_DIRECTORIES "${INSTALL_DIR}/include" INTERFACE_LINK_LIBRARIES libunwind ) @@ -100,3 +100,6 @@ endmacro() build_libunwind() build_gperftools() +get_target_property( GPERFTOOLS_LIB gperftools LOCATION ) +install(FILES ${GPERFTOOLS_LIB} DESTINATION ${CMAKE_INSTALL_PREFIX}) + diff --git a/internal/core/unittest/CMakeLists.txt b/internal/core/unittest/CMakeLists.txt index 04edfa565b..f14aea76e3 100644 --- a/internal/core/unittest/CMakeLists.txt +++ b/internal/core/unittest/CMakeLists.txt @@ -60,7 +60,6 @@ target_link_libraries(index_builder_test milvus_indexbuilder log pthread - gperftools ) target_link_libraries(all_tests @@ -69,7 +68,6 @@ target_link_libraries(all_tests milvus_indexbuilder log pthread - gperftools ) install(TARGETS all_tests DESTINATION unittest)