From 7b97b155e801e84cac6401fe25c025f458677dbf Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Wed, 8 Dec 2021 10:37:37 +0800 Subject: [PATCH] Remove duplicated thirdparty (#12925) Signed-off-by: yudong.cai --- .../src/index/thirdparty/fiu/CMakeLists.txt | 4 +- .../google_benchmark/CMakeLists.txt | 20 ------ .../src/index/thirdparty/gtest/CMakeLists.txt | 66 ------------------- internal/core/thirdparty/CMakeLists.txt | 1 - internal/core/thirdparty/fiu/CMakeLists.txt | 61 ----------------- internal/core/thirdparty/fiu/fiu-local.h | 37 ----------- 6 files changed, 2 insertions(+), 187 deletions(-) delete mode 100644 internal/core/src/index/thirdparty/google_benchmark/CMakeLists.txt delete mode 100644 internal/core/src/index/thirdparty/gtest/CMakeLists.txt delete mode 100644 internal/core/thirdparty/fiu/CMakeLists.txt delete mode 100644 internal/core/thirdparty/fiu/fiu-local.h diff --git a/internal/core/src/index/thirdparty/fiu/CMakeLists.txt b/internal/core/src/index/thirdparty/fiu/CMakeLists.txt index d2a6d99eda..8099586305 100644 --- a/internal/core/src/index/thirdparty/fiu/CMakeLists.txt +++ b/internal/core/src/index/thirdparty/fiu/CMakeLists.txt @@ -14,10 +14,10 @@ if(NOT DEFINED FIU_VERSION) set(FIU_VERSION 1.00) endif() -if ( DEFINED ENV{Knowhere_FIU_URL} ) +if ( DEFINED ENV{KNOWHERE_FIU_URL} ) set( FIU_SOURCE_URL "$ENV{MILVUS_FIU_URL}" ) else () - set( FIU_SOURCE_URL "https://github.com.cnpmjs.org/albertito/libfiu/archive/${FIU_VERSION}.tar.gz" ) + set( FIU_SOURCE_URL "https://github.com/albertito/libfiu/archive/${FIU_VERSION}.tar.gz" ) endif () macro( build_fiu ) diff --git a/internal/core/src/index/thirdparty/google_benchmark/CMakeLists.txt b/internal/core/src/index/thirdparty/google_benchmark/CMakeLists.txt deleted file mode 100644 index b67e438a6f..0000000000 --- a/internal/core/src/index/thirdparty/google_benchmark/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -FetchContent_Declare(google_benchmark - URL https://github.com/google/benchmark/archive/v1.5.2.tar.gz - URL_MD5 084b34aceaeac11a6607d35220ca2efa - DOWNLOAD_DIR ${THIRDPARTY_DOWNLOAD_PATH} - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/google_benchmark - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/google_benchmark - ) - -FetchContent_GetProperties( google_benchmark ) -if ( NOT google_benchmark_POPULATED ) - - FetchContent_Populate( google_benchmark ) - - # Adding the following targets: - # gtest, gtest_main, gmock, gmock_main - message("gb=${google_benchmark_SOURCE_DIR}") - add_subdirectory( ${google_benchmark_SOURCE_DIR} - ${google_benchmark_BINARY_DIR} - EXCLUDE_FROM_ALL ) -endif() diff --git a/internal/core/src/index/thirdparty/gtest/CMakeLists.txt b/internal/core/src/index/thirdparty/gtest/CMakeLists.txt deleted file mode 100644 index 6315c59ef2..0000000000 --- a/internal/core/src/index/thirdparty/gtest/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- -set( GTEST_VERSION 1.8.1 ) - -if ( DEFINED ENV{MILVUS_GTEST_URL} ) - set( GTEST_SOURCE_URL "$ENV{MILVUS_GTEST_URL}" ) -else() - set( GTEST_SOURCE_URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.zip" ) -endif() - -message( STATUS "Building gtest-${GTEST_VERSION} from source" ) - -set( CMAKE_POLICY_DEFAULT_CMP0022 NEW ) # for googletest only - -FetchContent_Declare( - googletest - URL ${GTEST_SOURCE_URL} - URL_MD5 "ad6868782b5952b7476a7c1c72d5a714" - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-src - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build - DOWNLOAD_DIR ${THIRDPARTY_DOWNLOAD_PATH} ) - -FetchContent_GetProperties( googletest ) -if ( NOT googletest_POPULATED ) - - FetchContent_Populate( googletest ) - - # Adding the following targets: - # gtest, gtest_main, gmock, gmock_main - add_subdirectory( ${googletest_SOURCE_DIR} - ${googletest_BINARY_DIR} - EXCLUDE_FROM_ALL ) -endif() -# include(GoogleTest) - -# **************************************************************** -# Create ALIAS Target -# **************************************************************** -# if (NOT TARGET GTest:gtest) -# add_library( GTest::gtest ALIAS gtest ) -# endif() -# if (NOT TARGET GTest:main) -# add_library( GTest::main ALIAS gtest_main ) -# endif() -# if (NOT TARGET GMock:gmock) -# target_link_libraries( gmock INTERFACE GTest::gtest ) -# add_library( GMock::gmock ALIAS gmock ) -# endif() -# if (NOT TARGET GMock:main) -# target_link_libraries( gmock_main INTERFACE GTest::gtest ) -# add_library( GMock::main ALIAS gmock_main ) -# endif() - - -get_property( var DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" PROPERTY COMPILE_OPTIONS ) -message( STATUS "gtest compile options: ${var}" ) diff --git a/internal/core/thirdparty/CMakeLists.txt b/internal/core/thirdparty/CMakeLists.txt index 95f8c6c4de..60c3e47988 100644 --- a/internal/core/thirdparty/CMakeLists.txt +++ b/internal/core/thirdparty/CMakeLists.txt @@ -54,5 +54,4 @@ if ( MILVUS_WITH_OPENTRACING ) endif() add_subdirectory( protobuf ) -add_subdirectory( fiu ) add_subdirectory( boost_ext ) diff --git a/internal/core/thirdparty/fiu/CMakeLists.txt b/internal/core/thirdparty/fiu/CMakeLists.txt deleted file mode 100644 index 77cf460181..0000000000 --- a/internal/core/thirdparty/fiu/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (C) 2019-2020 Zilliz. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under the License. -#------------------------------------------------------------------------------- -if(NOT DEFINED FIU_VERSION) - set(FIU_VERSION 1.00) -endif() - -if ( DEFINED ENV{MILVUS_FIU_URL} ) - set( FIU_SOURCE_URL "$ENV{MILVUS_FIU_URL}" ) -else () - set( FIU_SOURCE_URL "https://github.com/albertito/libfiu/archive/${FIU_VERSION}.tar.gz" ) -endif () - -macro( build_fiu ) - message( STATUS "Building FIU-${FIU_VERSION} from source" ) - ExternalProject_Add( - fiu_ep - PREFIX ${CMAKE_BINARY_DIR}/3rdparty_download/fiu-subbuild - DOWNLOAD_DIR ${THIRDPARTY_DOWNLOAD_PATH} - INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR} - URL ${FIU_SOURCE_URL} - URL_MD5 "75f9d076daf964c9410611701f07c61b" - CONFIGURE_COMMAND "" - BUILD_IN_SOURCE 1 - BUILD_COMMAND ${MAKE} - INSTALL_COMMAND ${MAKE} "PREFIX=" install - ${EP_LOG_OPTIONS} - ) - - ExternalProject_Get_Property( fiu_ep INSTALL_DIR ) - if( NOT IS_DIRECTORY ${INSTALL_DIR}/include ) - file( MAKE_DIRECTORY "${INSTALL_DIR}/include" ) - endif() - add_library( fiu SHARED IMPORTED ) - set_target_properties( fiu - PROPERTIES - IMPORTED_GLOBAL TRUE - IMPORTED_LOCATION ${INSTALL_DIR}/lib/libfiu.so - INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include ) - add_dependencies(fiu fiu_ep) -endmacro() - -build_fiu() - -install( FILES ${INSTALL_DIR}/lib/libfiu.so - ${INSTALL_DIR}/lib/libfiu.so.0 - ${INSTALL_DIR}/lib/libfiu.so.1.00 - DESTINATION lib ) - -get_target_property( var fiu INTERFACE_INCLUDE_DIRECTORIES ) -message( STATUS ${var} ) -set_directory_properties( PROPERTY INCLUDE_DIRECTORIES ${var} ) diff --git a/internal/core/thirdparty/fiu/fiu-local.h b/internal/core/thirdparty/fiu/fiu-local.h deleted file mode 100644 index b68327bffd..0000000000 --- a/internal/core/thirdparty/fiu/fiu-local.h +++ /dev/null @@ -1,37 +0,0 @@ - -/* libfiu - Fault Injection in Userspace - * - * This header, part of libfiu, is meant to be included in your project to - * avoid having libfiu as a mandatory build-time dependency. - * - * You can add it to your project, and #include it instead of fiu.h. - * The real fiu.h will be used only when FIU_ENABLE is defined. - * - * This header, as the rest of libfiu, is in the public domain. - * - * You can find more information about libfiu at - * http://blitiri.com.ar/p/libfiu. - */ - -#ifndef _FIU_LOCAL_H -#define _FIU_LOCAL_H - -/* Only define the stubs when fiu is disabled, otherwise use the real fiu.h - * header */ -#ifndef FIU_ENABLE - -#define fiu_init(flags) 0 -#define fiu_fail(name) 0 -#define fiu_failinfo() NULL -#define fiu_do_on(name, action) -#define fiu_exit_on(name) -#define fiu_return_on(name, retval) - -#else - -#include - -#endif /* FIU_ENABLE */ - -#endif /* _FIU_LOCAL_H */ -