mirror of https://github.com/milvus-io/milvus.git
Merge branch 'branch-1.2' into 'branch-1.2'
MS-26 cmake: add thirparty packages See merge request megasearch/vecwise_engine!38 Former-commit-id: 74b99445d3e68c24f298a91934c4319af7901b01pull/191/head
commit
46eb246e20
|
@ -12,6 +12,8 @@ Please mark all change in change log and use the ticket from JIRA.
|
|||
|
||||
- MS-5 - Implement Auto Archive Feature
|
||||
- MS-16 - Implement metrics without prometheus
|
||||
- MS-26 - cmake. Add thirdparty packages
|
||||
|
||||
### Task
|
||||
|
||||
- MS-1 - Add CHANGELOG.md
|
||||
|
|
|
@ -4,10 +4,33 @@
|
|||
# Proprietary and confidential.
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
message(STATUS "Building using CMake version: ${CMAKE_VERSION}")
|
||||
|
||||
set(MEGASEARCH_VERSION "0.1.0")
|
||||
|
||||
string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" MEGASEARCH_BASE_VERSION "${MEGASEARCH_VERSION}")
|
||||
|
||||
project(megasearch VERSION "${MEGASEARCH_BASE_VERSION}")
|
||||
project(vecwise_engine LANGUAGES CUDA CXX)
|
||||
|
||||
set(MEGASEARCH_VERSION_MAJOR "${megasearch_VERSION_MAJOR}")
|
||||
set(MEGASEARCH_VERSION_MINOR "${megasearch_VERSION_MINOR}")
|
||||
set(MEGASEARCH_VERSION_PATCH "${megasearch_VERSION_PATCH}")
|
||||
|
||||
if(MEGASEARCH_VERSION_MAJOR STREQUAL ""
|
||||
OR MEGASEARCH_VERSION_MINOR STREQUAL ""
|
||||
OR MEGASEARCH_VERSION_PATCH STREQUAL "")
|
||||
message(FATAL_ERROR "Failed to determine MegaSearch version from '${MEGASEARCH_VERSION}'")
|
||||
endif()
|
||||
|
||||
message(STATUS "MegaSearch version: "
|
||||
"${MEGASEARCH_VERSION_MAJOR}.${MEGASEARCH_VERSION_MINOR}.${MEGASEARCH_VERSION_PATCH} "
|
||||
"(full: '${MEGASEARCH_VERSION}')")
|
||||
|
||||
set(MEGASEARCH_SOURCE_DIR ${PROJECT_SOURCE_DIR})
|
||||
set(MEGASEARCH_BINARY_DIR ${PROJECT_BINARY_DIR})
|
||||
|
||||
find_package(CUDA)
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcompiler -fPIC -std=c++11 -D_FORCE_INLINES -arch sm_60 --expt-extended-lambda")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -O0 -g")
|
||||
|
@ -19,6 +42,7 @@ if (GPU_VERSION STREQUAL "ON")
|
|||
endif ()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED on)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
|
||||
message("building vecwise_engine on x86 architecture")
|
||||
|
@ -32,43 +56,48 @@ else()
|
|||
set(VECWISE_BUILD_ARCH unknown)
|
||||
endif()
|
||||
|
||||
if(DEFINED UNIX)
|
||||
message("building vecwise on Unix")
|
||||
set(VECWISE_BUILD_SYSTEM macos)
|
||||
elseif(DEFINED APPLE)
|
||||
message("building vecwise on MacOS")
|
||||
set(VECWISE_BUILD_SYSTEM unix)
|
||||
else()
|
||||
message("unknown OS")
|
||||
set(VECWISE_BUILD_SYSTEM unknown)
|
||||
endif ()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fPIC -DELPP_THREAD_SAFE")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fPIC -DELPP_THREAD_SAFE -fopenmp")
|
||||
if (GPU_VERSION STREQUAL "ON")
|
||||
set(ENABLE_LICENSE "ON")
|
||||
add_definitions("-DENABLE_LICENSE")
|
||||
endif ()
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fPIC -DELPP_THREAD_SAFE")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fPIC -DELPP_THREAD_SAFE -fopenmp")
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH})
|
||||
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
if (BUILD_UNIT_TEST)
|
||||
option(MEGASEARCH_BUILD_TESTS "Build the megasearch test suite" ON)
|
||||
endif(BUILD_UNIT_TEST)
|
||||
|
||||
include(ExternalProject)
|
||||
include(DefineOptions)
|
||||
include(BuildUtils)
|
||||
include(ThirdPartyPackages)
|
||||
|
||||
include_directories(${MEGASEARCH_SOURCE_DIR})
|
||||
link_directories(${MEGASEARCH_BINARY_DIR})
|
||||
|
||||
## Following should be check
|
||||
|
||||
set(VECWISE_ENGINE_INCLUDE ${PROJECT_SOURCE_DIR}/include)
|
||||
set(VECWISE_ENGINE_SRC ${PROJECT_SOURCE_DIR}/src)
|
||||
set(VECWISE_THIRD_PARTY ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
|
||||
set(VECWISE_THIRD_PARTY_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/third_party/build)
|
||||
#set(VECWISE_THIRD_PARTY ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
|
||||
#set(VECWISE_THIRD_PARTY_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/third_party/build)
|
||||
|
||||
add_compile_definitions(PROFILER=${PROFILER})
|
||||
|
||||
include_directories(${VECWISE_ENGINE_INCLUDE})
|
||||
include_directories(${VECWISE_ENGINE_SRC})
|
||||
include_directories(${VECWISE_THIRD_PARTY_BUILD}/include)
|
||||
#include_directories(${VECWISE_THIRD_PARTY_BUILD}/include)
|
||||
|
||||
link_directories(${CMAKE_CURRRENT_BINARY_DIR})
|
||||
link_directories(${VECWISE_THIRD_PARTY_BUILD}/lib)
|
||||
link_directories(${VECWISE_THIRD_PARTY_BUILD}/lib64)
|
||||
#link_directories(${VECWISE_THIRD_PARTY_BUILD}/lib)
|
||||
#link_directories(${VECWISE_THIRD_PARTY_BUILD}/lib64)
|
||||
#execute_process(COMMAND bash build.sh
|
||||
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
|
||||
|
||||
|
@ -91,3 +120,5 @@ install(FILES
|
|||
conf/vecwise_engine_log.conf
|
||||
DESTINATION
|
||||
conf)
|
||||
|
||||
config_summary()
|
||||
|
|
|
@ -72,7 +72,7 @@ if [[ ${MAKE_CLEAN} = "ON" ]]; then
|
|||
make clean
|
||||
fi
|
||||
|
||||
make -j || exit 1
|
||||
make -j 1 || exit 1
|
||||
|
||||
if [[ ${BUILD_TYPE} != "Debug" ]]; then
|
||||
strip src/vecwise_server
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
function(ADD_THIRDPARTY_LIB LIB_NAME)
|
||||
set(options)
|
||||
set(one_value_args SHARED_LIB STATIC_LIB)
|
||||
set(multi_value_args DEPS INCLUDE_DIRECTORIES)
|
||||
cmake_parse_arguments(ARG
|
||||
"${options}"
|
||||
"${one_value_args}"
|
||||
"${multi_value_args}"
|
||||
${ARGN})
|
||||
if(ARG_UNPARSED_ARGUMENTS)
|
||||
message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
|
||||
if(ARG_STATIC_LIB AND ARG_SHARED_LIB)
|
||||
if(NOT ARG_STATIC_LIB)
|
||||
message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}")
|
||||
endif()
|
||||
|
||||
set(AUG_LIB_NAME "${LIB_NAME}_static")
|
||||
add_library(${AUG_LIB_NAME} STATIC IMPORTED)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}")
|
||||
if(ARG_DEPS)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
|
||||
endif()
|
||||
message(STATUS "Added static library dependency ${AUG_LIB_NAME}: ${ARG_STATIC_LIB}")
|
||||
if(ARG_INCLUDE_DIRECTORIES)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${ARG_INCLUDE_DIRECTORIES}")
|
||||
endif()
|
||||
|
||||
set(AUG_LIB_NAME "${LIB_NAME}_shared")
|
||||
add_library(${AUG_LIB_NAME} SHARED IMPORTED)
|
||||
|
||||
if(WIN32)
|
||||
# Mark the ".lib" location as part of a Windows DLL
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES IMPORTED_IMPLIB "${ARG_SHARED_LIB}")
|
||||
else()
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}")
|
||||
endif()
|
||||
if(ARG_DEPS)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
|
||||
endif()
|
||||
message(STATUS "Added shared library dependency ${AUG_LIB_NAME}: ${ARG_SHARED_LIB}")
|
||||
if(ARG_INCLUDE_DIRECTORIES)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${ARG_INCLUDE_DIRECTORIES}")
|
||||
endif()
|
||||
elseif(ARG_STATIC_LIB)
|
||||
set(AUG_LIB_NAME "${LIB_NAME}_static")
|
||||
add_library(${AUG_LIB_NAME} STATIC IMPORTED)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}")
|
||||
if(ARG_DEPS)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
|
||||
endif()
|
||||
message(STATUS "Added static library dependency ${AUG_LIB_NAME}: ${ARG_STATIC_LIB}")
|
||||
if(ARG_INCLUDE_DIRECTORIES)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${ARG_INCLUDE_DIRECTORIES}")
|
||||
endif()
|
||||
elseif(ARG_SHARED_LIB)
|
||||
set(AUG_LIB_NAME "${LIB_NAME}_shared")
|
||||
add_library(${AUG_LIB_NAME} SHARED IMPORTED)
|
||||
|
||||
if(WIN32)
|
||||
# Mark the ".lib" location as part of a Windows DLL
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES IMPORTED_IMPLIB "${ARG_SHARED_LIB}")
|
||||
else()
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}")
|
||||
endif()
|
||||
message(STATUS "Added shared library dependency ${AUG_LIB_NAME}: ${ARG_SHARED_LIB}")
|
||||
if(ARG_DEPS)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
|
||||
endif()
|
||||
if(ARG_INCLUDE_DIRECTORIES)
|
||||
set_target_properties(${AUG_LIB_NAME}
|
||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
||||
"${ARG_INCLUDE_DIRECTORIES}")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}")
|
||||
endif()
|
||||
endfunction()
|
|
@ -0,0 +1,190 @@
|
|||
|
||||
macro(set_option_category name)
|
||||
set(MEGASEARCH_OPTION_CATEGORY ${name})
|
||||
list(APPEND "MEGASEARCH_OPTION_CATEGORIES" ${name})
|
||||
endmacro()
|
||||
|
||||
macro(define_option name description default)
|
||||
option(${name} ${description} ${default})
|
||||
list(APPEND "MEGASEARCH_${MEGASEARCH_OPTION_CATEGORY}_OPTION_NAMES" ${name})
|
||||
set("${name}_OPTION_DESCRIPTION" ${description})
|
||||
set("${name}_OPTION_DEFAULT" ${default})
|
||||
set("${name}_OPTION_TYPE" "bool")
|
||||
endmacro()
|
||||
|
||||
function(list_join lst glue out)
|
||||
if("${${lst}}" STREQUAL "")
|
||||
set(${out} "" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
list(GET ${lst} 0 joined)
|
||||
list(REMOVE_AT ${lst} 0)
|
||||
foreach(item ${${lst}})
|
||||
set(joined "${joined}${glue}${item}")
|
||||
endforeach()
|
||||
set(${out} ${joined} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(define_option_string name description default)
|
||||
set(${name} ${default} CACHE STRING ${description})
|
||||
list(APPEND "MEGASEARCH_${MEGASEARCH_OPTION_CATEGORY}_OPTION_NAMES" ${name})
|
||||
set("${name}_OPTION_DESCRIPTION" ${description})
|
||||
set("${name}_OPTION_DEFAULT" "\"${default}\"")
|
||||
set("${name}_OPTION_TYPE" "string")
|
||||
|
||||
set("${name}_OPTION_ENUM" ${ARGN})
|
||||
list_join("${name}_OPTION_ENUM" "|" "${name}_OPTION_ENUM")
|
||||
if(NOT ("${${name}_OPTION_ENUM}" STREQUAL ""))
|
||||
set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
set_option_category("Thirdparty")
|
||||
|
||||
set(MEGASEARCH_DEPENDENCY_SOURCE_DEFAULT "AUTO")
|
||||
|
||||
define_option_string(MEGASEARCH_DEPENDENCY_SOURCE
|
||||
"Method to use for acquiring MEGASEARCH's build dependencies"
|
||||
"${MEGASEARCH_DEPENDENCY_SOURCE_DEFAULT}"
|
||||
"AUTO"
|
||||
"BUNDLED"
|
||||
"SYSTEM")
|
||||
|
||||
define_option(MEGASEARCH_VERBOSE_THIRDPARTY_BUILD
|
||||
"Show output from ExternalProjects rather than just logging to files" OFF)
|
||||
|
||||
define_option(MEGASEARCH_BOOST_USE_SHARED "Rely on boost shared libraries where relevant" OFF)
|
||||
|
||||
define_option(MEGASEARCH_BOOST_VENDORED "Use vendored Boost instead of existing Boost. \
|
||||
Note that this requires linking Boost statically" ON)
|
||||
|
||||
define_option(MEGASEARCH_BOOST_HEADER_ONLY "Use only BOOST headers" OFF)
|
||||
|
||||
define_option(MEGASEARCH_WITH_BZ2 "Build with BZ2 compression" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_EASYLOGGINGPP "Build with Easylogging++ library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_FAISS "Build with FAISS library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_FAISS_GPU_VERSION "Build with FAISS GPU version" ON)
|
||||
|
||||
define_option_string(MEGASEARCH_FAISS_GPU_ARCH "Specifying which GPU architectures to build against"
|
||||
"-gencode=arch=compute_61,code=sm_61")
|
||||
|
||||
define_option(MEGASEARCH_WITH_LAPACK "Build with LAPACK library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_LZ4 "Build with lz4 compression" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_OPENBLAS "Build with OpenBLAS library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_ROCKSDB "Build with RocksDB library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_SNAPPY "Build with Snappy compression" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_SQLITE "Build with SQLite library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_SQLITE_ORM "Build with SQLite ORM library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_THRIFT "Build with Apache Thrift library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_YAMLCPP "Build with yaml-cpp library" ON)
|
||||
|
||||
define_option(MEGASEARCH_WITH_ZLIB "Build with zlib compression" ON)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.7)
|
||||
set(MEGASEARCH_WITH_ZSTD_DEFAULT OFF)
|
||||
else()
|
||||
# ExternalProject_Add(SOURCE_SUBDIR) is available since CMake 3.7.
|
||||
set(MEGASEARCH_WITH_ZSTD_DEFAULT ON)
|
||||
endif()
|
||||
define_option(MEGASEARCH_WITH_ZSTD "Build with zstd compression" ${MEGASEARCH_WITH_ZSTD_DEFAULT})
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
if(MSVC)
|
||||
set_option_category("MSVC")
|
||||
|
||||
define_option(MSVC_LINK_VERBOSE
|
||||
"Pass verbose linking options when linking libraries and executables"
|
||||
OFF)
|
||||
|
||||
define_option(MEGASEARCH_USE_STATIC_CRT "Build MEGASEARCH with statically linked CRT" OFF)
|
||||
endif()
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
#set_option_category("Test and benchmark")
|
||||
#
|
||||
#define_option(MEGASEARCH_BUILD_TESTS "Build the MEGASEARCH googletest unit tests" ON)
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
macro(config_summary)
|
||||
message(STATUS "---------------------------------------------------------------------")
|
||||
message(STATUS "MEGASEARCH version: ${MEGASEARCH_VERSION}")
|
||||
message(STATUS)
|
||||
message(STATUS "Build configuration summary:")
|
||||
|
||||
message(STATUS " Generator: ${CMAKE_GENERATOR}")
|
||||
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
|
||||
message(STATUS " Source directory: ${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
if(${CMAKE_EXPORT_COMPILE_COMMANDS})
|
||||
message(
|
||||
STATUS " Compile commands: ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json")
|
||||
endif()
|
||||
|
||||
foreach(category ${MEGASEARCH_OPTION_CATEGORIES})
|
||||
|
||||
message(STATUS)
|
||||
message(STATUS "${category} options:")
|
||||
|
||||
set(option_names ${MEGASEARCH_${category}_OPTION_NAMES})
|
||||
|
||||
set(max_value_length 0)
|
||||
foreach(name ${option_names})
|
||||
string(LENGTH "\"${${name}}\"" value_length)
|
||||
if(${max_value_length} LESS ${value_length})
|
||||
set(max_value_length ${value_length})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(name ${option_names})
|
||||
if("${${name}_OPTION_TYPE}" STREQUAL "string")
|
||||
set(value "\"${${name}}\"")
|
||||
else()
|
||||
set(value "${${name}}")
|
||||
endif()
|
||||
|
||||
set(default ${${name}_OPTION_DEFAULT})
|
||||
set(description ${${name}_OPTION_DESCRIPTION})
|
||||
string(LENGTH ${description} description_length)
|
||||
if(${description_length} LESS 70)
|
||||
string(
|
||||
SUBSTRING
|
||||
" "
|
||||
${description_length} -1 description_padding)
|
||||
else()
|
||||
set(description_padding "
|
||||
")
|
||||
endif()
|
||||
|
||||
set(comment "[${name}]")
|
||||
|
||||
if("${value}" STREQUAL "${default}")
|
||||
set(comment "[default] ${comment}")
|
||||
endif()
|
||||
|
||||
if(NOT ("${${name}_OPTION_ENUM}" STREQUAL ""))
|
||||
set(comment "${comment} [${${name}_OPTION_ENUM}]")
|
||||
endif()
|
||||
|
||||
string(
|
||||
SUBSTRING "${value} "
|
||||
0 ${max_value_length} value)
|
||||
|
||||
message(STATUS " ${description} ${description_padding} ${value} ${comment}")
|
||||
endforeach()
|
||||
|
||||
endforeach()
|
||||
|
||||
endmacro()
|
File diff suppressed because it is too large
Load Diff
|
@ -47,11 +47,52 @@ set(vecwise_engine_files
|
|||
set(get_sys_info_files
|
||||
license/GetSysInfo.cpp)
|
||||
|
||||
|
||||
include_directories(/usr/include)
|
||||
include_directories(/usr/local/cuda/include)
|
||||
include_directories(thrift/gen-cpp)
|
||||
|
||||
#target_link_libraries(megasearch boost_system_static)
|
||||
#target_link_libraries(megasearch boost_filesystem_static)
|
||||
#target_link_libraries(megasearch boost_serialization_static)
|
||||
#target_link_libraries(megasearch bzip2)
|
||||
#target_link_libraries(megasearch easyloggingpp)
|
||||
#target_link_libraries(megasearch faiss)
|
||||
#target_link_libraries(megasearch gtest)
|
||||
#target_link_libraries(megasearch lapack)
|
||||
#target_link_libraries(megasearch lz4)
|
||||
#target_link_libraries(megasearch openblas)
|
||||
#target_link_libraries(megasearch rocksdb)
|
||||
#target_link_libraries(megasearch snappy)
|
||||
#target_link_libraries(megasearch sqlite)
|
||||
#target_link_libraries(megasearch sqlite_orm)
|
||||
#target_link_libraries(megasearch thrift)
|
||||
#target_link_libraries(megasearch yaml-cpp)
|
||||
#target_link_libraries(megasearch zlib)
|
||||
#target_link_libraries(megasearch zstd)
|
||||
|
||||
set(third_party_libs
|
||||
boost_system_static
|
||||
boost_filesystem_static
|
||||
boost_serialization_static
|
||||
bzip2
|
||||
easyloggingpp
|
||||
faiss
|
||||
gtest
|
||||
gtest_main
|
||||
gmock
|
||||
lapack
|
||||
lz4
|
||||
openblas
|
||||
rocksdb
|
||||
snappy
|
||||
sqlite
|
||||
# sqlite_orm
|
||||
thrift
|
||||
yaml-cpp
|
||||
zlib
|
||||
zstd
|
||||
)
|
||||
|
||||
if (GPU_VERSION STREQUAL "ON")
|
||||
link_directories(/usr/local/cuda/lib64)
|
||||
set(engine_libs
|
||||
|
@ -100,13 +141,13 @@ endif ()
|
|||
|
||||
|
||||
cuda_add_library(vecwise_engine STATIC ${vecwise_engine_files})
|
||||
target_link_libraries(vecwise_engine ${engine_libs})
|
||||
target_link_libraries(vecwise_engine ${engine_libs} ${third_party_libs})
|
||||
|
||||
add_library(metrics STATIC ${metrics_files})
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
add_library(vecwise_license STATIC ${license_check_files})
|
||||
target_link_libraries(vecwise_license ${license_libs})
|
||||
target_link_libraries(vecwise_license ${license_libs} ${third_party_libs})
|
||||
endif ()
|
||||
|
||||
#set(metrics_lib
|
||||
|
@ -118,17 +159,6 @@ endif ()
|
|||
#add_library(vecwise_engine STATIC ${metrics_files} )
|
||||
#target_link_libraries(metrics ${metrics_lib})
|
||||
|
||||
add_executable(vecwise_server
|
||||
${config_files}
|
||||
${server_files}
|
||||
${utils_files}
|
||||
${service_files}
|
||||
${metrics_files}
|
||||
${VECWISE_THIRD_PARTY_BUILD}/include/easylogging++.cc
|
||||
)
|
||||
|
||||
|
||||
|
||||
set(server_libs
|
||||
vecwise_engine
|
||||
librocksdb.a
|
||||
|
@ -145,16 +175,30 @@ set(server_libs
|
|||
dl
|
||||
)
|
||||
|
||||
add_executable(vecwise_server
|
||||
${config_files}
|
||||
${server_files}
|
||||
${utils_files}
|
||||
${service_files}
|
||||
${metrics_files}
|
||||
#${EASYLOGGINGPP_INCLUDE_DIR}/easylogging++.cc
|
||||
)
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
target_link_libraries(vecwise_server ${server_libs} vecwise_license)
|
||||
target_link_libraries(vecwise_server ${server_libs} vecwise_license ${third_party_libs})
|
||||
else ()
|
||||
target_link_libraries(vecwise_server ${server_libs})
|
||||
target_link_libraries(vecwise_server ${server_libs} ${third_party_libs})
|
||||
endif()
|
||||
|
||||
if (ENABLE_LICENSE STREQUAL "ON")
|
||||
add_executable(get_sys_info ${get_sys_info_files})
|
||||
add_executable(license_generator ${license_generator_files})
|
||||
target_link_libraries(get_sys_info ${license_libs} vecwise_license)
|
||||
target_link_libraries(license_generator ${license_libs})
|
||||
|
||||
target_link_libraries(get_sys_info ${license_libs} vecwise_license ${third_party_libs})
|
||||
target_link_libraries(license_generator ${license_libs} ${third_party_libs})
|
||||
|
||||
install(TARGETS get_sys_info DESTINATION bin)
|
||||
install(TARGETS license_generator DESTINATION bin)
|
||||
endif ()
|
||||
|
||||
install(TARGETS vecwise_server DESTINATION bin)
|
||||
|
|
|
@ -28,8 +28,7 @@ add_library(megasearch_sdk STATIC
|
|||
|
||||
link_directories(../../third_party/build/lib)
|
||||
target_link_libraries(megasearch_sdk
|
||||
libthrift.a
|
||||
pthread
|
||||
${third_party_libs}
|
||||
)
|
||||
|
||||
add_subdirectory(examples)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "utils/Error.h"
|
||||
#include "config/ConfigNode.h"
|
||||
|
||||
#include <yaml-cpp/yaml.h>
|
||||
#include "yaml-cpp/yaml.h"
|
||||
|
||||
namespace zilliz {
|
||||
namespace vecwise {
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
# Toolchain library versions
|
||||
#
|
||||
# This file is used by `download_dependencies.sh` and cmake to figure out which
|
||||
# version of a dependency to fetch. In order to add a new dependency, add a
|
||||
# version variable, e.g. MY_DEP_VERSION and append an entry in the
|
||||
# `DEPENDENCIES` array (see the comment on top of the declaration for the
|
||||
# format).
|
||||
|
||||
BOOST_VERSION=1.70.0
|
||||
BZIP2_VERSION=1.0.6
|
||||
EASYLOGGINGPP_VERSION=v9.96.7
|
||||
FAISS_VERSION=master
|
||||
GTEST_VERSION=1.8.1
|
||||
LAPACK_VERSION=v3.8.0
|
||||
LZ4_VERSION=v1.9.1
|
||||
OPENBLAS_VERSION=v0.3.6
|
||||
ROCKSDB_VERSION=v6.0.2
|
||||
SNAPPY_VERSION=1.1.7
|
||||
SQLITE_VERSION=3280000
|
||||
SQLITE_ORM_VERSION=master
|
||||
THRIFT_VERSION=0.12.0
|
||||
YAMLCPP_VERSION=0.6.2
|
||||
ZLIB_VERSION=v1.2.11
|
||||
ZSTD_VERSION=v1.4.0
|
||||
|
||||
# The first field is the name of the environment variable expected by cmake.
|
||||
# This _must_ match what is defined. The second field is the name of the
|
||||
# generated archive file. The third field is the url of the project for the
|
||||
# given version.
|
||||
DEPENDENCIES=(
|
||||
"MEGASEARCH_BOOST_URL boost-${BOOST_VERSION}.tar.gz https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION//./_}.tar.gz"
|
||||
"MEGASEARCH_BZIP2_URL bzip2-${BZIP2_VERSION}.tar.gz https://fossies.org/linux/misc/bzip2-${BZIP2_VERSION}.tar.gz"
|
||||
"MEGASEARCH_EASYLOGGINGPP_URL easyloggingpp-${EASYLOGGINGPP_VERSION}.tar.gz https://github.com/zuhd-org/easyloggingpp/archive/${EASYLOGGINGPP_VERSION}.tar.gz"
|
||||
"MEGASEARCH_FAISS_URL faiss-${FAISS_VERSION}.tar.gz https://github.com/facebookresearch/faiss/archive/${FAISS_VERSION}.tar.gz"
|
||||
"MEGASEARCH_GTEST_URL gtest-${GTEST_VERSION}.tar.gz https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz"
|
||||
"MEGASEARCH_LAPACK_URL lapack-${LAPACK_VERSION}.tar.gz https://github.com/Reference-LAPACK/lapack/archive/${LAPACK_VERSION}.tar.gz
|
||||
"MEGASEARCH_LZ4_URL lz4-${LZ4_VERSION}.tar.gz https://github.com/lz4/lz4/archive/${LZ4_VERSION}.tar.gz"
|
||||
"MEGASEARCH_OPENBLAS_URL openblas-${OPENBLAS_VERSION}.tar.gz https://github.com/xianyi/OpenBLAS/archive/${OPENBLAS_VERSION}.tar.gz"
|
||||
"MEGASEARCH_ROCKSDB_URL rocksdb-${ROCKSDB_VERSION}.tar.gz https://github.com/facebook/rocksdb/archive/${ROCKSDB_VERSION}.tar.gz"
|
||||
"MEGASEARCH_SNAPPY_URL snappy-${SNAPPY_VERSION}.tar.gz https://github.com/google/snappy/archive/${SNAPPY_VERSION}.tar.gz"
|
||||
"MEGASEARCH_SQLITE_URL sqlite-autoconf-${SQLITE_VERSION}.tar.gz https://www.sqlite.org/2019/sqlite-autoconf-${SQLITE_VERSION}.tar.gz"
|
||||
"MEGASEARCH_SQLITE_ORM_URL sqlite_orm-${SQLITE_ORM_VERSION}.tar.gz https://github.com/fnc12/sqlite_orm/archive/${SQLITE_ORM_VERSION}.tar.gz"
|
||||
"MEGASEARCH_THRIFT_URL thrift-${THRIFT_VERSION}.tar.gz http://archive.apache.org/dist/thrift/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}.tar.gz"
|
||||
"MEGASEARCH_YAMLCPP_URL yaml-cpp-${YAMLCPP_VERSION}.tar.gz https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${YAMLCPP_VERSION}.tar.gz"
|
||||
"MEGASEARCH_ZLIB_URL zlib-${ZLIB_VERSION}.tar.gz https://github.com/madler/zlib/archive/${ZLIB_VERSION}.tar.gz"
|
||||
"MEGASEARCH_ZSTD_URL zstd-${ZSTD_VERSION}.tar.gz https://github.com/facebook/zstd/archive/${ZSTD_VERSION}.tar.gz"
|
||||
)
|
||||
|
||||
# vim: set filetype=sh:
|
|
@ -5,18 +5,26 @@
|
|||
#-------------------------------------------------------------------------------
|
||||
link_directories(
|
||||
"${CMAKE_BINARY_DIR}/lib"
|
||||
"${VECWISE_THIRD_PARTY_BUILD}/lib"
|
||||
#"${VECWISE_THIRD_PARTY_BUILD}/lib"
|
||||
"${GTEST_PREFIX}/lib/"
|
||||
)
|
||||
message(STATUS "GTEST LIB: ${GTEST_PREFIX}/lib")
|
||||
|
||||
set(unittest_srcs
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vecwise_test.cpp ${VECWISE_THIRD_PARTY_BUILD}/include/easylogging++.cc)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vecwise_test.cpp)
|
||||
#${EASYLOGGINGPP_INCLUDE_DIR}/easylogging++.cc)
|
||||
|
||||
set(unittest_libs
|
||||
yaml-cpp
|
||||
gtest
|
||||
gmock
|
||||
gtest_main
|
||||
gmock_main
|
||||
easyloggingpp
|
||||
pthread
|
||||
metrics)
|
||||
metrics
|
||||
openblas
|
||||
gfortran)
|
||||
|
||||
add_subdirectory(server)
|
||||
add_subdirectory(db)
|
||||
|
|
|
@ -42,4 +42,4 @@ set(db_libs
|
|||
lz4
|
||||
)
|
||||
|
||||
target_link_libraries(db_test ${unittest_libs} ${db_libs})
|
||||
target_link_libraries(db_test ${db_libs} ${unittest_libs})
|
||||
|
|
|
@ -45,7 +45,7 @@ set(wrapper_libs
|
|||
zstd
|
||||
lz4
|
||||
)
|
||||
target_link_libraries(wrapper_test ${unittest_libs} ${wrapper_libs})
|
||||
target_link_libraries(wrapper_test ${wrapper_libs} ${unittest_libs})
|
||||
|
||||
set(topk_test_src
|
||||
topk_test.cpp
|
||||
|
|
|
@ -16,6 +16,7 @@ link_directories(/usr/local/cuda/lib64)
|
|||
link_directories(/usr/lib/x86_64-linux-gnu)
|
||||
link_directories(/usr/lib/nvidia-415)
|
||||
link_directories(/usr/local/cuda/targets/x86_64-linux/lib/stubs/)
|
||||
link_directories(/usr/local/cuda/lib64/stubs/)
|
||||
|
||||
set(require_files
|
||||
../../src/license/LicenseLibrary.cpp
|
||||
|
@ -44,4 +45,4 @@ set(db_libs
|
|||
boost_serialization
|
||||
)
|
||||
|
||||
target_link_libraries(license_test ${unittest_libs} ${db_libs})
|
||||
target_link_libraries(license_test ${db_libs} ${unittest_libs})
|
||||
|
|
|
@ -57,7 +57,7 @@ set(count_test_src
|
|||
add_executable(metrics_test ${count_test_src} ${require_files} )
|
||||
|
||||
target_link_libraries(metrics_test
|
||||
${unittest_libs}
|
||||
|
||||
faiss
|
||||
cudart
|
||||
cublas
|
||||
|
@ -72,5 +72,5 @@ target_link_libraries(metrics_test
|
|||
# prometheus-cpp-core
|
||||
pthread
|
||||
z
|
||||
|
||||
${unittest_libs}
|
||||
)
|
|
@ -51,7 +51,7 @@ set(require_libs
|
|||
)
|
||||
|
||||
target_link_libraries(server_test
|
||||
${unittest_libs}
|
||||
${require_libs}
|
||||
${cuda_library}
|
||||
${unittest_libs}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue