Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
ff79e179
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff79e179
编写于
9月 03, 2019
作者:
Z
zhiru
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cmake: integerated knowhere
Former-commit-id: bd87ac66e3bc90a85a4fb6517711c4a2c36caaef
上级
01f2db33
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
443 addition
and
379 deletion
+443
-379
cpp/CMakeLists.txt
cpp/CMakeLists.txt
+17
-14
cpp/build.sh
cpp/build.sh
+3
-3
cpp/src/CMakeLists.txt
cpp/src/CMakeLists.txt
+32
-23
cpp/src/core/CMakeLists.txt
cpp/src/core/CMakeLists.txt
+16
-8
cpp/src/core/cmake/BuildUtilsCore.cmake
cpp/src/core/cmake/BuildUtilsCore.cmake
+1
-1
cpp/src/core/cmake/DefineOptionsCore.cmake
cpp/src/core/cmake/DefineOptionsCore.cmake
+1
-1
cpp/src/core/cmake/ThirdPartyPackagesCore.cmake
cpp/src/core/cmake/ThirdPartyPackagesCore.cmake
+201
-200
cpp/src/core/src/CMakeLists.txt
cpp/src/core/src/CMakeLists.txt
+41
-19
cpp/src/core/test/CMakeLists.txt
cpp/src/core/test/CMakeLists.txt
+39
-31
cpp/src/core/test/faiss_ori/CMakeLists.txt
cpp/src/core/test/faiss_ori/CMakeLists.txt
+7
-5
cpp/src/core/test/test_nsg/CMakeLists.txt
cpp/src/core/test/test_nsg/CMakeLists.txt
+17
-15
cpp/unittest/CMakeLists.txt
cpp/unittest/CMakeLists.txt
+9
-0
cpp/unittest/db/CMakeLists.txt
cpp/unittest/db/CMakeLists.txt
+14
-14
cpp/unittest/knowhere/CMakeLists.txt
cpp/unittest/knowhere/CMakeLists.txt
+7
-7
cpp/unittest/metrics/CMakeLists.txt
cpp/unittest/metrics/CMakeLists.txt
+14
-14
cpp/unittest/scheduler/CMakeLists.txt
cpp/unittest/scheduler/CMakeLists.txt
+14
-14
cpp/unittest/server/CMakeLists.txt
cpp/unittest/server/CMakeLists.txt
+10
-10
未找到文件。
cpp/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -31,6 +31,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
set
(
BUILD_TYPE
"release"
)
else
()
set
(
BUILD_TYPE
"debug"
)
SET
(
CMAKE_VERBOSE_MAKEFILE on
)
endif
()
message
(
STATUS
"Build type =
${
BUILD_TYPE
}
"
)
...
...
@@ -70,21 +71,21 @@ set(MILVUS_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"
)
message
(
"CUDA_TOOLKIT_ROOT_DIR=
${
CUDA_TOOLKIT_ROOT_DIR
}
"
)
message
(
"CUDA_NVCC_FLAGS=
${
CUDA_NVCC_FLAGS
}
"
)
message
(
STATUS
"CUDA_TOOLKIT_ROOT_DIR=
${
CUDA_TOOLKIT_ROOT_DIR
}
"
)
message
(
STATUS
"CUDA_NVCC_FLAGS=
${
CUDA_NVCC_FLAGS
}
"
)
set
(
CMAKE_CXX_STANDARD 14
)
set
(
CMAKE_CXX_STANDARD_REQUIRED on
)
if
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"(x86)|(X86)|(amd64)|(AMD64)"
)
message
(
"building milvus_engine on x86 architecture"
)
message
(
STATUS
"building milvus_engine on x86 architecture"
)
set
(
MILVUS_BUILD_ARCH x86_64
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"(ppc)"
)
message
(
"building milvus_engine on ppc architecture"
)
message
(
STATUS
"building milvus_engine on ppc architecture"
)
set
(
MILVUS_BUILD_ARCH ppc64le
)
else
()
message
(
"unknown processor type"
)
message
(
"CMAKE_SYSTEM_PROCESSOR=
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
message
(
WARNING
"unknown processor type"
)
message
(
WARNING
"CMAKE_SYSTEM_PROCESSOR=
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
set
(
MILVUS_BUILD_ARCH unknown
)
endif
()
...
...
@@ -94,6 +95,8 @@ else()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-O0 -g -fPIC -DELPP_THREAD_SAFE -fopenmp"
)
endif
()
set
(
ALLOW_DUPLICATE_CUSTOM_TARGETS TRUE
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
include
(
ExternalProject
)
...
...
@@ -104,13 +107,13 @@ include(ThirdPartyPackages)
include_directories
(
${
MILVUS_SOURCE_DIR
}
)
link_directories
(
${
MILVUS_BINARY_DIR
}
)
if
(
NOT DEFINED KNOWHERE_BUILD_DIR
)
message
(
FATAL_ERROR
"You must set environment variable KNOWHERE_BUILD_DIR"
)
endif
()
message
(
STATUS
"Build with
${
KNOWHERE_BUILD_DIR
}
"
)
include_directories
(
${
KNOWHERE_BUILD_DIR
}
/include
)
include_directories
(
${
KNOWHERE_BUILD_DIR
}
/include/SPTAG/AnnService
)
link_directories
(
${
KNOWHERE_BUILD_DIR
}
/lib
)
#
if (NOT DEFINED KNOWHERE_BUILD_DIR)
#
message(FATAL_ERROR "You must set environment variable KNOWHERE_BUILD_DIR")
#
endif()
#
message(STATUS "Build with ${KNOWHERE_BUILD_DIR}")
#
include_directories(${KNOWHERE_BUILD_DIR}/include)
#
include_directories(${KNOWHERE_BUILD_DIR}/include/SPTAG/AnnService)
#
link_directories(${KNOWHERE_BUILD_DIR}/lib)
## Following should be check
...
...
@@ -119,7 +122,7 @@ set(MILVUS_ENGINE_SRC ${PROJECT_SOURCE_DIR}/src)
add_compile_definitions
(
PROFILER=
${
PROFILER
}
)
message
(
"MILVUS_ENABLE_PROFILING =
${
MILVUS_ENABLE_PROFILING
}
"
)
message
(
STATUS
"MILVUS_ENABLE_PROFILING =
${
MILVUS_ENABLE_PROFILING
}
"
)
if
(
MILVUS_ENABLE_PROFILING STREQUAL
"ON"
)
ADD_DEFINITIONS
(
-DMILVUS_ENABLE_PROFILING
)
endif
()
...
...
cpp/build.sh
浏览文件 @
ff79e179
...
...
@@ -83,9 +83,9 @@ if [[ ! -d cmake_build ]]; then
MAKE_CLEAN
=
"ON"
fi
pushd
`
pwd
`
/src/core
./build.sh
${
KNOWHERE_OPTIONS
}
popd
#
pushd `pwd`/src/core
#
./build.sh ${KNOWHERE_OPTIONS}
#
popd
cd
cmake_build
...
...
cpp/src/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -4,6 +4,15 @@
# Proprietary and confidential.
#-------------------------------------------------------------------------------
add_subdirectory
(
core
)
set
(
CORE_INCLUDE_DIRS
${
CORE_INCLUDE_DIRS
}
PARENT_SCOPE
)
foreach
(
dir
${
CORE_INCLUDE_DIRS
}
)
message
(
"dir =
${
dir
}
"
)
include_directories
(
${
dir
}
)
endforeach
()
#include_directories(${CMAKE_SOURCE_DIR}/src/core/thirdparty/SPTAG/AnnService)
aux_source_directory
(
cache cache_files
)
aux_source_directory
(
config config_files
)
aux_source_directory
(
server server_files
)
...
...
@@ -87,12 +96,12 @@ set(client_grpc_lib
set
(
third_party_libs
knowhere
SPTAGLibStatic
arrow
jemalloc_pic
faiss
openblas
lapack
#
SPTAGLibStatic
#
arrow
#
jemalloc_pic
#
faiss
#
openblas
#
lapack
easyloggingpp
sqlite
${
client_grpc_lib
}
...
...
@@ -115,14 +124,14 @@ set(third_party_libs
cudart
)
if
(
${
BUILD_FAISS_WITH_MKL
}
STREQUAL
"ON"
)
set
(
third_party_libs
${
third_party_libs
}
${
MKL_LIBS
}
)
else
()
set
(
third_party_libs
${
third_party_libs
}
lapack
openblas
)
endif
()
#
if(${BUILD_FAISS_WITH_MKL} STREQUAL "ON")
#
set(third_party_libs ${third_party_libs}
#
${MKL_LIBS})
#
else()
#
set(third_party_libs ${third_party_libs}
#
lapack
#
openblas)
#
endif()
if
(
MILVUS_ENABLE_PROFILING STREQUAL
"ON"
)
set
(
third_party_libs
${
third_party_libs
}
...
...
@@ -171,13 +180,13 @@ set(server_libs
set
(
knowhere_libs
knowhere
SPTAGLibStatic
arrow
jemalloc_pic
faiss
openblas
lapack
tbb
#
SPTAGLibStatic
#
arrow
#
jemalloc_pic
#
faiss
#
openblas
#
lapack
#
tbb
)
add_executable
(
milvus_server
...
...
@@ -195,8 +204,8 @@ target_link_libraries(milvus_server ${server_libs} ${knowhere_libs} ${third_part
install
(
TARGETS milvus_server DESTINATION bin
)
install
(
FILES
${
KNOWHERE_BUILD_DIR
}
/li
b/
${
CMAKE_SHARED_LIBRARY_PREFIX
}
tbb
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
${
KNOWHERE_BUILD_DIR
}
/li
b/
${
CMAKE_SHARED_LIBRARY_PREFIX
}
tbb
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
.2
${
CMAKE_SOURCE_DIR
}
/src/core/thirdparty/tb
b/
${
CMAKE_SHARED_LIBRARY_PREFIX
}
tbb
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
${
CMAKE_SOURCE_DIR
}
/src/core/thirdparty/tb
b/
${
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
...
...
cpp/src/core/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -5,6 +5,7 @@
#-------------------------------------------------------------------------------
cmake_minimum_required
(
VERSION 3.14
)
message
(
STATUS
"---------------core--------------"
)
message
(
STATUS
"Building using CMake version:
${
CMAKE_VERSION
}
"
)
set
(
KNOWHERE_VERSION
"0.1.0"
)
...
...
@@ -42,14 +43,14 @@ find_package(CUDA)
#set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -O0 -g")
if
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"(x86)|(X86)|(amd64)|(AMD64)"
)
message
(
"building milvus_engine on x86 architecture"
)
message
(
STATUS
"building milvus_engine on x86 architecture"
)
set
(
KNOWHERE_BUILD_ARCH x86_64
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"(ppc)"
)
message
(
"building milvus_engine on ppc architecture"
)
message
(
STATUS
"building milvus_engine on ppc architecture"
)
set
(
KNOWHERE_BUILD_ARCH ppc64le
)
else
()
message
(
"unknown processor type"
)
message
(
"CMAKE_SYSTEM_PROCESSOR=
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
message
(
WARNING
"unknown processor type"
)
message
(
WARNING
"CMAKE_SYSTEM_PROCESSOR=
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
set
(
KNOWHERE_BUILD_ARCH unknown
)
endif
()
...
...
@@ -60,14 +61,21 @@ else()
endif
()
message
(
STATUS
"Build type =
${
BUILD_TYPE
}
"
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
set
(
CORE_SOURCE_DIR
${
PROJECT_SOURCE_DIR
}
)
set
(
CORE_BINARY_DIR
${
PROJECT_BINARY_DIR
}
)
message
(
STATUS
"Core source dir:
${
PROJECT_SOURCE_DIR
}
"
)
message
(
STATUS
"Core binary dir:
${
PROJECT_BINARY_DIR
}
"
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CORE_SOURCE_DIR
}
/cmake"
)
include
(
ExternalProject
)
include
(
DefineOptions
)
include
(
BuildUtils
)
include
(
ThirdPartyPackages
)
include
(
DefineOptions
Core
)
include
(
BuildUtils
Core
)
include
(
ThirdPartyPackages
Core
)
add_subdirectory
(
src
)
set
(
CORE_INCLUDE_DIRS
${
CORE_INCLUDE_DIRS
}
PARENT_SCOPE
)
if
(
BUILD_UNIT_TEST STREQUAL
"ON"
)
add_subdirectory
(
test
)
endif
()
...
...
cpp/src/core/cmake/BuildUtils.cmake
→
cpp/src/core/cmake/BuildUtils
Core
.cmake
浏览文件 @
ff79e179
...
...
@@ -75,7 +75,7 @@ function(ExternalProject_Use_Cache project_name package_file install_path)
"Extracting
${
package_file
}
to
${
install_path
}
"
COMMAND
${
CMAKE_COMMAND
}
-E tar xzvf
${
package_file
}
${
install_path
}
WORKING_DIRECTORY
${
C
MAKE_CURRENT
_BINARY_DIR
}
WORKING_DIRECTORY
${
C
ORE
_BINARY_DIR
}
)
ExternalProject_Add_StepTargets
(
${
project_name
}
extract
)
...
...
cpp/src/core/cmake/DefineOptions.cmake
→
cpp/src/core/cmake/DefineOptions
Core
.cmake
浏览文件 @
ff79e179
...
...
@@ -104,7 +104,7 @@ macro(config_summary)
message
(
STATUS
" Source directory:
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
if
(
${
CMAKE_EXPORT_COMPILE_COMMANDS
}
)
message
(
STATUS
" Compile commands:
${
C
MAKE_CURRENT
_BINARY_DIR
}
/compile_commands.json"
)
STATUS
" Compile commands:
${
C
ORE
_BINARY_DIR
}
/compile_commands.json"
)
endif
()
foreach
(
category
${
KNOWHERE_OPTION_CATEGORIES
}
)
...
...
cpp/src/core/cmake/ThirdPartyPackages.cmake
→
cpp/src/core/cmake/ThirdPartyPackages
Core
.cmake
浏览文件 @
ff79e179
此差异已折叠。
点击以展开。
cpp/src/core/src/CMakeLists.txt
浏览文件 @
ff79e179
set
(
TBB_DIR
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/tbb
)
set
(
TBB_DIR
${
C
OR
E_SOURCE_DIR
}
/thirdparty/tbb
)
set
(
TBB_LIBRARIES
${
TBB_DIR
}
/libtbb.so
)
include_directories
(
${
TBB_DIR
}
/include
)
include_directories
(
${
CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
}
)
link_directories
(
${
CUDA_TOOLKIT_ROOT_DIR
}
/lib64
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/include
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/SPTAG/AnnService
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/include
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty/SPTAG/AnnService
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include
)
set
(
SPTAG_SOURCE_DIR
${
C
MAKE_CURRENT_SOURCE_DIR
}
/..
/thirdparty/SPTAG
)
set
(
SPTAG_SOURCE_DIR
${
C
ORE_SOURCE_DIR
}
/thirdparty/SPTAG
)
file
(
GLOB HDR_FILES
${
SPTAG_SOURCE_DIR
}
/AnnService/inc/Core/*.h
${
SPTAG_SOURCE_DIR
}
/AnnService/inc/Core/Common/*.h
...
...
@@ -26,7 +26,9 @@ file(GLOB SRC_FILES
#add_library(SPTAGLib SHARED ${SRC_FILES} ${HDR_FILES})
#target_link_libraries(SPTAGLib ${TBB_LIBRARIES})
add_library
(
SPTAGLibStatic STATIC
${
SRC_FILES
}
${
HDR_FILES
}
)
if
(
NOT TARGET SPTAGLibStatic
)
add_library
(
SPTAGLibStatic STATIC
${
SRC_FILES
}
${
HDR_FILES
}
)
endif
()
set
(
external_srcs
knowhere/adapter/sptag.cpp
...
...
@@ -58,7 +60,7 @@ set(depend_libs
openblas
lapack
arrow
jemalloc_pic
${
ARROW_PREFIX
}
/lib/libjemalloc_pic.a
cudart
cublas
gomp
...
...
@@ -66,11 +68,13 @@ set(depend_libs
pthread
)
add_library
(
knowhere STATIC
${
external_srcs
}
${
index_srcs
}
)
if
(
NOT TARGET knowhere
)
add_library
(
knowhere STATIC
${
external_srcs
}
${
index_srcs
}
)
endif
()
#target_compile_options(knowhere PUBLIC "-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
target_link_libraries
(
...
...
@@ -112,24 +116,42 @@ INSTALL(FILES ${OPENBLAS_REAL_STATIC_LIB}
DESTINATION lib
)
INSTALL
(
FILES
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/tbb/libtbb.so.2
INSTALL
(
FILES
${
C
OR
E_SOURCE_DIR
}
/thirdparty/tbb/libtbb.so.2
# RENAME "libtbb.so.2"
DESTINATION lib
)
INSTALL
(
FILES
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/tbb/libtbb.so
INSTALL
(
FILES
${
C
OR
E_SOURCE_DIR
}
/thirdparty/tbb/libtbb.so
# RENAME "libtbb.so"
DESTINATION lib
)
set
(
CORE_INCLUDE_DIRS
${
CORE_SOURCE_DIR
}
/include
${
CORE_SOURCE_DIR
}
/thirdparty
${
CORE_SOURCE_DIR
}
/thirdparty/SPTAG/AnnService
${
CORE_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include
${
ARROW_INCLUDE_DIR
}
${
FAISS_INCLUDE_DIR
}
${
OPENBLAS_INCLUDE_DIR
}
${
LAPACK_INCLUDE_DIR
}
${
CORE_SOURCE_DIR
}
/thirdparty/tbb/include
)
set
(
CORE_INCLUDE_DIRS
${
CORE_INCLUDE_DIRS
}
PARENT_SCOPE
)
#include_directories(SYSTEM ${CORE_SOURCE_DIR}/include)
#include_directories(SYSTEM ${CORE_SOURCE_DIR}/thirdparty/jsoncons-0.126.0/include)
#include_directories(SYSTEM ${CORE_SOURCE_DIR}/thirdparty/tbb/include)
#include_directories(SYSTEM ${SPTAG_SOURCE_DIR}/AnnService/inc)
INSTALL
(
DIRECTORY
${
C
MAK
E_SOURCE_DIR
}
/include/knowhere
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include/jsoncons
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include/jsoncons_ext
${
C
OR
E_SOURCE_DIR
}
/include/knowhere
${
C
OR
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include/jsoncons
${
C
OR
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include/jsoncons_ext
${
ARROW_INCLUDE_DIR
}
/arrow
# ${ARROW_INCLUDE_DIR}/parquet
${
FAISS_PREFIX
}
/include/faiss
${
OPENBLAS_INCLUDE_DIR
}
/
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/tbb/include/tbb
${
C
OR
E_SOURCE_DIR
}
/thirdparty/tbb/include/tbb
DESTINATION
include
)
...
...
cpp/src/core/test/CMakeLists.txt
浏览文件 @
ff79e179
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/SPTAG/AnnService
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/include
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty/SPTAG/AnnService
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/include
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty/jsoncons-0.126.0/include
)
include_directories
(
/usr/local/cuda/include
)
link_directories
(
/usr/local/cuda/lib64
)
link_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/tbb
)
link_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty/tbb
)
set
(
unittest_libs
gtest gmock gtest_main gmock_main
)
message
(
STATUS
"arrow prefix:
${
ARROW_PREFIX
}
"
)
message
(
STATUS
"libjemalloc_pic path:
${
ARROW_PREFIX
}
/lib/libjemalloc_pic.a"
)
set
(
depend_libs
faiss openblas lapack
arrow
jemalloc_pic
arrow
"
${
ARROW_PREFIX
}
/lib/libjemalloc_pic.a"
tbb
)
...
...
@@ -24,32 +26,36 @@ set(basic_libs
#<IVF-TEST>
#<<<<<<<<<<
set
(
ivf_srcs
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/ivf.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/gpu_ivf.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cloner.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/idmap.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/ivf.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/gpu_ivf.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cloner.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/idmap.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
utils.cpp
)
add_executable
(
test_ivf test_ivf.cpp
${
ivf_srcs
}
)
if
(
NOT TARGET test_ivf
)
add_executable
(
test_ivf test_ivf.cpp
${
ivf_srcs
}
)
endif
()
target_link_libraries
(
test_ivf
${
depend_libs
}
${
unittest_libs
}
${
basic_libs
}
)
#<<<<<<<<<<
#<IDMAP-TEST>
#<<<<<<<<<<
set
(
idmap_srcs
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/idmap.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/ivf.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cloner.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/gpu_ivf.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/idmap.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/ivf.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cloner.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/gpu_ivf.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
utils.cpp
)
add_executable
(
test_idmap test_idmap.cpp
${
idmap_srcs
}
)
if
(
NOT TARGET test_idmap
)
add_executable
(
test_idmap test_idmap.cpp
${
idmap_srcs
}
)
endif
()
target_link_libraries
(
test_idmap
${
depend_libs
}
${
unittest_libs
}
${
basic_libs
}
)
#<<<<<<<<<<
...
...
@@ -57,17 +63,19 @@ target_link_libraries(test_idmap ${depend_libs} ${unittest_libs} ${basic_libs})
#<KDT-TEST>
#<<<<<<<<<<
set
(
kdt_srcs
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/preprocessor/normalize.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/kdt_parameters.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cpu_kdt_rng.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/adapter/sptag.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/adapter/arrow.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/preprocessor/normalize.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/kdt_parameters.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cpu_kdt_rng.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/adapter/sptag.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/adapter/arrow.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
utils.cpp
)
add_executable
(
test_kdt test_kdt.cpp
${
kdt_srcs
}
)
if
(
NOT TARGET test_kdt
)
add_executable
(
test_kdt test_kdt.cpp
${
kdt_srcs
}
)
endif
()
target_link_libraries
(
test_kdt
SPTAGLibStatic
${
depend_libs
}
${
unittest_libs
}
${
basic_libs
}
)
...
...
cpp/src/core/test/faiss_ori/CMakeLists.txt
浏览文件 @
ff79e179
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/include
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/include
)
include_directories
(
/usr/local/cuda/include
)
link_directories
(
/usr/local/cuda/lib64
)
link_directories
(
${
C
MAK
E_SOURCE_DIR
}
/thirdparty/tbb
)
link_directories
(
${
C
OR
E_SOURCE_DIR
}
/thirdparty/tbb
)
set
(
unittest_libs
gtest gmock gtest_main gmock_main
)
set
(
depend_libs
faiss openblas lapack
arrow
jemalloc_pic
arrow
${
ARROW_PREFIX
}
/lib/libjemalloc_pic.a
tbb
)
...
...
@@ -21,6 +21,8 @@ set(basic_libs
#<GPU-TEST>
#<<<<<<<<<<
add_executable
(
test_gpu gpuresource_test.cpp
)
if
(
NOT TARGET test_gpu
)
add_executable
(
test_gpu gpuresource_test.cpp
)
endif
()
target_link_libraries
(
test_gpu
${
depend_libs
}
${
unittest_libs
}
${
basic_libs
}
)
#<<<<<<<<<<
cpp/src/core/test/test_nsg/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -14,33 +14,35 @@ else ()
endif
()
message
(
${
OpenMP_CXX_FLAGS
}
)
include_directories
(
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/nsg
)
include_directories
(
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/nsg
)
#include_directories(/home/zilliz/opt/app/pyenv/versions/3.6.8/include/python3.6m)
#include_directories(/home/zilliz/opt/app/pyenv/versions/3.6.8/envs/megasearch_testframework_dev/lib/python3.6/site-packages/numpy/core/include)
aux_source_directory
(
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/nsg nsg_src
)
aux_source_directory
(
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/nsg nsg_src
)
#add_library(nsg_raw SHARED ${nsg_src})
#target_link_libraries(nsg_raw
# gomp)
set
(
interface_src
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/ivf.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/gpu_ivf.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cloner.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/idmap.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/nsg_index.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
MAK
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/ivf.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/gpu_ivf.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/cloner.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/idmap.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/index/vector_index/nsg_index.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/adapter/structure.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/exception.cpp
${
C
OR
E_SOURCE_DIR
}
/src/knowhere/common/timer.cpp
../utils.cpp
)
add_executable
(
test_nsg
test_nsg.cpp
${
interface_src
}
${
nsg_src
}
)
if
(
NOT TARGET test_nsg
)
add_executable
(
test_nsg
test_nsg.cpp
${
interface_src
}
${
nsg_src
}
)
endif
()
#target_link_libraries(test_nsg
# # libprofiler.so
## -ltcmalloc
...
...
cpp/unittest/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -6,6 +6,8 @@
link_directories
(
"
${
CMAKE_BINARY_DIR
}
/lib"
)
#include_directories(${CMAKE_SOURCE_DIR}/src/core/include)
#include_directories(${CMAKE_SOURCE_DIR}/src/core/thirdparty/SPTAG/AnnService)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/db db_srcs
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/config config_files
)
...
...
@@ -38,6 +40,13 @@ set(unittest_libs
cudart
)
#message(STATUS "unittest core dir: ${CMAKE_CURRENT_BINARY_DIR}/core")
#add_subdirectory(${CMAKE_SOURCE_DIR}/src/core ${CMAKE_CURRENT_BINARY_DIR}/core)
foreach
(
dir
${
CORE_INCLUDE_DIRS
}
)
message
(
"dir =
${
dir
}
"
)
include_directories
(
${
dir
}
)
endforeach
()
add_subdirectory
(
server
)
add_subdirectory
(
db
)
add_subdirectory
(
knowhere
)
...
...
cpp/unittest/db/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -69,24 +69,24 @@ set(db_libs
set
(
knowhere_libs
knowhere
SPTAGLibStatic
arrow
jemalloc_pic
faiss
openblas
lapack
tbb
#
SPTAGLibStatic
#
arrow
#
jemalloc_pic
#
faiss
#
openblas
#
lapack
#
tbb
cudart
cublas
)
if
(
${
BUILD_FAISS_WITH_MKL
}
STREQUAL
"ON"
)
set
(
db_libs
${
db_libs
}
${
MKL_LIBS
}
${
MKL_LIBS
}
)
else
()
set
(
db_libs
${
db_libs
}
lapack
openblas
)
endif
()
#
if(${BUILD_FAISS_WITH_MKL} STREQUAL "ON")
#
set(db_libs ${db_libs} ${MKL_LIBS} ${MKL_LIBS})
#
else()
#
set(db_libs ${db_libs}
#
lapack
#
openblas)
#
endif()
target_link_libraries
(
db_test
${
db_libs
}
${
knowhere_libs
}
${
unittest_libs
}
)
...
...
cpp/unittest/knowhere/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -8,13 +8,13 @@ set(helper
set
(
knowhere_libs
knowhere
SPTAGLibStatic
arrow
jemalloc_pic
faiss
openblas
lapack
tbb
#
SPTAGLibStatic
#
arrow
#
jemalloc_pic
#
faiss
#
openblas
#
lapack
#
tbb
cudart
cublas
)
...
...
cpp/unittest/metrics/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -72,13 +72,13 @@ add_executable(metrics_test ${count_test_src} ${require_files} )
set
(
knowhere_libs
knowhere
SPTAGLibStatic
arrow
jemalloc_pic
faiss
openblas
lapack
tbb
#
SPTAGLibStatic
#
arrow
#
jemalloc_pic
#
faiss
#
openblas
#
lapack
#
tbb
)
target_link_libraries
(
metrics_test
...
...
@@ -96,12 +96,12 @@ target_link_libraries(metrics_test
mysqlpp
${
unittest_libs
}
)
if
(
${
BUILD_FAISS_WITH_MKL
}
STREQUAL
"ON"
)
target_link_libraries
(
metrics_test
${
MKL_LIBS
}
${
MKL_LIBS
}
)
else
()
target_link_libraries
(
metrics_test
lapack
openblas
)
endif
()
#
if(${BUILD_FAISS_WITH_MKL} STREQUAL "ON")
#
target_link_libraries(metrics_test ${MKL_LIBS} ${MKL_LIBS})
#
else()
#
target_link_libraries(metrics_test
#
lapack
#
openblas)
#
endif()
install
(
TARGETS metrics_test DESTINATION bin
)
\ No newline at end of file
cpp/unittest/scheduler/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -69,24 +69,24 @@ set(scheduler_libs
set
(
knowhere_libs
knowhere
SPTAGLibStatic
arrow
jemalloc_pic
faiss
openblas
lapack
tbb
#
SPTAGLibStatic
#
arrow
#
jemalloc_pic
#
faiss
#
openblas
#
lapack
#
tbb
cudart
cublas
)
if
(
${
BUILD_FAISS_WITH_MKL
}
STREQUAL
"ON"
)
set
(
db_libs
${
db_libs
}
${
MKL_LIBS
}
${
MKL_LIBS
}
)
else
()
set
(
db_libs
${
db_libs
}
lapack
openblas
)
endif
()
#
if (${BUILD_FAISS_WITH_MKL} STREQUAL "ON")
#
set(db_libs ${db_libs} ${MKL_LIBS} ${MKL_LIBS})
#
else ()
#
set(db_libs ${db_libs}
#
lapack
#
openblas)
#
endif ()
target_link_libraries
(
scheduler_test
${
scheduler_libs
}
${
knowhere_libs
}
${
unittest_libs
}
)
...
...
cpp/unittest/server/CMakeLists.txt
浏览文件 @
ff79e179
...
...
@@ -34,9 +34,9 @@ cuda_add_executable(server_test
set
(
require_libs
knowhere
faiss
openblas
lapack
#
faiss
#
openblas
#
lapack
stdc++
cudart
cublas
...
...
@@ -51,13 +51,13 @@ set(require_libs
pthread
)
if
(
${
BUILD_FAISS_WITH_MKL
}
STREQUAL
"ON"
)
set
(
require_libs
${
require_libs
}
${
MKL_LIBS
}
${
MKL_LIBS
}
)
else
()
set
(
require_libs
${
require_libs
}
lapack
openblas
)
endif
()
#
if(${BUILD_FAISS_WITH_MKL} STREQUAL "ON")
#
set(require_libs ${require_libs} ${MKL_LIBS} ${MKL_LIBS})
#
else()
#
set(require_libs ${require_libs}
#
lapack
#
openblas)
#
endif()
target_link_libraries
(
server_test
${
require_libs
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录