From 8fdef361b13db3c34f6a71bd0d78734279a443a2 Mon Sep 17 00:00:00 2001 From: Heisenberg Date: Mon, 16 Sep 2019 20:18:18 +0800 Subject: [PATCH] change cmakelist Former-commit-id: 9a60b9fb71226b5b15e7bb2b755ff2ad53e6d922 --- cpp/cmake/ThirdPartyPackages.cmake | 88 ------------------------------ cpp/src/CMakeLists.txt | 2 - cpp/src/utils/LogUtil.cpp | 20 +++---- cpp/unittest/CMakeLists.txt | 1 - 4 files changed, 7 insertions(+), 104 deletions(-) diff --git a/cpp/cmake/ThirdPartyPackages.cmake b/cpp/cmake/ThirdPartyPackages.cmake index 933d470247..fa61da180a 100644 --- a/cpp/cmake/ThirdPartyPackages.cmake +++ b/cpp/cmake/ThirdPartyPackages.cmake @@ -19,7 +19,6 @@ set(MILVUS_THIRDPARTY_DEPENDENCIES ARROW BOOST BZip2 -# Easylogging++ FAISS GTest Knowhere @@ -56,8 +55,6 @@ macro(build_dependency DEPENDENCY_NAME) build_arrow() elseif("${DEPENDENCY_NAME}" STREQUAL "BZip2") build_bzip2() -# elseif("${DEPENDENCY_NAME}" STREQUAL "Easylogging++") -# build_easyloggingpp() elseif("${DEPENDENCY_NAME}" STREQUAL "FAISS") build_faiss() elseif ("${DEPENDENCY_NAME}" STREQUAL "GTest") @@ -295,13 +292,6 @@ else() endif() set(BZIP2_MD5 "00b516f4704d4a7cb50a1d97e6e8e15b") -#if(DEFINED ENV{MILVUS_EASYLOGGINGPP_URL}) -# set(EASYLOGGINGPP_SOURCE_URL "$ENV{MILVUS_EASYLOGGINGPP_URL}") -#else() -# set(EASYLOGGINGPP_SOURCE_URL "https://github.com/zuhd-org/easyloggingpp/archive/${EASYLOGGINGPP_VERSION}.tar.gz") -#endif() -#set(EASYLOGGINGPP_MD5 "b78cd319db4be9b639927657b8aa7732") - if(DEFINED ENV{MILVUS_FAISS_URL}) set(FAISS_SOURCE_URL "$ENV{MILVUS_FAISS_URL}") else() @@ -814,84 +804,6 @@ if(MILVUS_WITH_KNOWHERE) include_directories(SYSTEM "${KNOWHERE_INCLUDE_DIR}/SPTAG/AnnService") endif() -# ---------------------------------------------------------------------- -# Easylogging++ - -#macro(build_easyloggingpp) -# message(STATUS "Building Easylogging++-${EASYLOGGINGPP_VERSION} from source") -# set(EASYLOGGINGPP_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/easyloggingpp_ep-prefix/src/easyloggingpp_ep") -# set(EASYLOGGINGPP_INCLUDE_DIR "${EASYLOGGINGPP_PREFIX}/include") -# set(EASYLOGGINGPP_STATIC_LIB -# "${EASYLOGGINGPP_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}easyloggingpp${CMAKE_STATIC_LIBRARY_SUFFIX}") -# -# set(EASYLOGGINGPP_CMAKE_ARGS -# ${EP_COMMON_CMAKE_ARGS} -# "-DCMAKE_INSTALL_PREFIX=${EASYLOGGINGPP_PREFIX}" -# -DCMAKE_INSTALL_LIBDIR=lib -# -Dtest=OFF -# -Dbuild_static_lib=ON) -# -# if(USE_JFROG_CACHE STREQUAL "ON") -# set(EASYLOGGINGPP_CACHE_PACKAGE_NAME "easyloggingpp_${EASYLOGGINGPP_MD5}.tar.gz") -# set(EASYLOGGINGPP_CACHE_URL "${JFROG_ARTFACTORY_CACHE_URL}/${EASYLOGGINGPP_CACHE_PACKAGE_NAME}") -# set(EASYLOGGINGPP_CACHE_PACKAGE_PATH "${THIRDPARTY_PACKAGE_CACHE}/${EASYLOGGINGPP_CACHE_PACKAGE_NAME}") -# -# execute_process(COMMAND wget -q --method HEAD ${EASYLOGGINGPP_CACHE_URL} RESULT_VARIABLE return_code) -# message(STATUS "Check the remote cache file ${EASYLOGGINGPP_CACHE_URL}. return code = ${return_code}") -# if (NOT return_code EQUAL 0) -# externalproject_add(easyloggingpp_ep -# URL -# ${EASYLOGGINGPP_SOURCE_URL} -# ${EP_LOG_OPTIONS} -# CMAKE_ARGS -# ${EASYLOGGINGPP_CMAKE_ARGS} -# BUILD_COMMAND -# ${MAKE} -# ${MAKE_BUILD_ARGS} -# BUILD_BYPRODUCTS -# ${EASYLOGGINGPP_STATIC_LIB}) -# -# ExternalProject_Create_Cache(easyloggingpp_ep ${EASYLOGGINGPP_CACHE_PACKAGE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/easyloggingpp_ep-prefix" ${JFROG_USER_NAME} ${JFROG_PASSWORD} ${EASYLOGGINGPP_CACHE_URL}) -# else() -# file(DOWNLOAD ${EASYLOGGINGPP_CACHE_URL} ${EASYLOGGINGPP_CACHE_PACKAGE_PATH} STATUS status) -# list(GET status 0 status_code) -# message(STATUS "DOWNLOADING FROM ${EASYLOGGINGPP_CACHE_URL} TO ${EASYLOGGINGPP_CACHE_PACKAGE_PATH}. STATUS = ${status_code}") -# if (status_code EQUAL 0) -# ExternalProject_Use_Cache(easyloggingpp_ep ${EASYLOGGINGPP_CACHE_PACKAGE_PATH} ${CMAKE_CURRENT_BINARY_DIR}) -# endif() -# endif() -# else() -# externalproject_add(easyloggingpp_ep -# URL -# ${EASYLOGGINGPP_SOURCE_URL} -# ${EP_LOG_OPTIONS} -# CMAKE_ARGS -# ${EASYLOGGINGPP_CMAKE_ARGS} -# BUILD_COMMAND -# ${MAKE} -# ${MAKE_BUILD_ARGS} -# BUILD_BYPRODUCTS -# ${EASYLOGGINGPP_STATIC_LIB}) -# endif() -# -# file(MAKE_DIRECTORY "${EASYLOGGINGPP_INCLUDE_DIR}") -# add_library(easyloggingpp STATIC IMPORTED) -# set_target_properties( -# easyloggingpp -# PROPERTIES IMPORTED_LOCATION "${EASYLOGGINGPP_STATIC_LIB}" -# INTERFACE_INCLUDE_DIRECTORIES "${EASYLOGGINGPP_INCLUDE_DIR}") -# -# add_dependencies(easyloggingpp easyloggingpp_ep) -#endmacro() -# -#if(MILVUS_WITH_EASYLOGGINGPP) -# resolve_dependency(Easylogging++) -# -# get_target_property(EASYLOGGINGPP_INCLUDE_DIR easyloggingpp INTERFACE_INCLUDE_DIRECTORIES) -# link_directories(SYSTEM "${EASYLOGGINGPP_PREFIX}/lib") -# include_directories(SYSTEM "${EASYLOGGINGPP_INCLUDE_DIR}") -#endif() - # ---------------------------------------------------------------------- # OpenBLAS diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index 733c493b59..3dc838c19e 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -95,7 +95,6 @@ set(client_grpc_lib set(third_party_libs knowhere -# easyloggingpp sqlite ${client_grpc_lib} yaml-cpp @@ -146,7 +145,6 @@ target_link_libraries(milvus_engine ${engine_libs} ${third_party_libs}) add_library(metrics STATIC ${metrics_files}) set(metrics_lib -# easyloggingpp yaml-cpp prometheus-cpp-push prometheus-cpp-pull diff --git a/cpp/src/utils/LogUtil.cpp b/cpp/src/utils/LogUtil.cpp index 5f0573cce8..35ff862d50 100644 --- a/cpp/src/utils/LogUtil.cpp +++ b/cpp/src/utils/LogUtil.cpp @@ -48,31 +48,25 @@ void RolloutHandler(const char *filename, std::size_t size, el::Level level) { int ret; std::string m(std::string(dir) + "/" + s); s = m; - if(level == el::Level::Global){ + if (level == el::Level::Global) { s.append("." + std::to_string(++global_idx)); ret = rename(m.c_str(), s.c_str()); - } - else if(level == el::Level::Debug){ + } else if (level == el::Level::Debug) { s.append("." + std::to_string(++debug_idx)); ret = rename(m.c_str(), s.c_str()); - } - else if(level == el::Level::Warning){ + } else if (level == el::Level::Warning) { s.append("." + std::to_string(++warning_idx)); ret = rename(m.c_str(), s.c_str()); - } - else if(level == el::Level::Trace){ + } else if (level == el::Level::Trace) { s.append("." + std::to_string(++trace_idx)); ret = rename(m.c_str(), s.c_str()); - } - else if(level == el::Level::Error){ + } else if (level == el::Level::Error) { s.append("." + std::to_string(++error_idx)); ret = rename(m.c_str(), s.c_str()); - } - else if(level == el::Level::Fatal){ + } else if (level == el::Level::Fatal) { s.append("." + std::to_string(++fatal_idx)); ret = rename(m.c_str(), s.c_str()); - } - else{ + } else { s.append("." + std::to_string(++global_idx)); ret = rename(m.c_str(), s.c_str()); } diff --git a/cpp/unittest/CMakeLists.txt b/cpp/unittest/CMakeLists.txt index 978ca69ff6..69ea8f4ea1 100644 --- a/cpp/unittest/CMakeLists.txt +++ b/cpp/unittest/CMakeLists.txt @@ -25,7 +25,6 @@ set(unittest_libs gmock gtest_main gmock_main -# easyloggingpp pthread metrics gfortran