Cpp SDK for Milvus.
To contribute to this project, please read our contribution guidelines and Development Guide first.
The following collection shows Milvus versions and recommended milvus-cpp-sdk versions:
| Milvus version | Recommended SDK version |
|---|---|
| 2.3.x | 2.3(branch) |
| 2.4.x | v2.4.1 |
| 2.5.x | v2.5.4 |
| 2.6.x | v2.6.3 |
| 3.0.x | v3.0.0 |
- C++ compiler with C++14 support (GCC 7+, Clang 5+, MSVC 2017+)
- CMake 3.14+
- Python 3 with pip (for Conan and build tools)
git clone https://github.com/milvus-io/milvus-sdk-cpp.git
cd milvus-sdk-cpp
bash scripts/install_deps.sh
makemake test # unit tests + integration tests
make st # system tests (requires Docker)
make coverage # code coverage reportmake install # install to /usr/localOr specify a custom install prefix:
make install CMAKE_INSTALL_PREFIX=/path/to/installThe project uses Conan 2 to manage dependencies. The scripts/build.sh handles Conan integration automatically. You can also use Conan directly:
conan install . --build=missing -s build_type=Release
cmake --preset conan-release
cmake --build build/ReleaseSee Development Guide for more details.
If you want to integrate milvus-sdk-cpp into your own C++ application, the recommended starting point is the companion example repository:
That repository shows three practical integration modes:
- without-conan: build the SDK and its dependencies from source with CMake/FetchContent
- conan-for-dependencies: build
milvus-sdk-cppfrom source while using Conan for its dependencies - conan-managed: consume
milvus-sdk-cppitself as a Conan package
A typical workflow is:
- Build and install
milvus-sdk-cpp - Point your project’s CMake build to the installed headers and library
- Include SDK headers such as
milvus/MilvusClientV2.h - Link your executable against
milvus_sdk
For example, after installing the SDK to a custom prefix:
make install CMAKE_INSTALL_PREFIX=/path/to/installyour CMake project can add the SDK include and library paths explicitly:
include_directories(/path/to/install/include)
link_directories(/path/to/install/lib)
target_link_libraries(my_program milvus_sdk)If you prefer a complete, working reference project instead of a minimal snippet, use the example repository above. It includes ready-to-build CMakeLists.txt files and build scripts for the supported integration approaches.