Skip to content

milvus-io/milvus-sdk-cpp

Repository files navigation

Milvus Cpp SDK

license Mergify Status

Cpp SDK for Milvus.

To contribute to this project, please read our contribution guidelines and Development Guide first.

Compatibility

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

Installation

Prerequisites

  • C++ compiler with C++14 support (GCC 7+, Clang 5+, MSVC 2017+)
  • CMake 3.14+
  • Python 3 with pip (for Conan and build tools)

Quick start

git clone https://github.com/milvus-io/milvus-sdk-cpp.git
cd milvus-sdk-cpp
bash scripts/install_deps.sh
make

Build and run tests

make test          # unit tests + integration tests
make st            # system tests (requires Docker)
make coverage      # code coverage report

Install the SDK

make install       # install to /usr/local

Or specify a custom install prefix:

make install CMAKE_INSTALL_PREFIX=/path/to/install

Build with Conan

The 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/Release

See Development Guide for more details.

Use milvus-sdk-cpp in your project

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-cpp from source while using Conan for its dependencies
  • conan-managed: consume milvus-sdk-cpp itself as a Conan package

A typical workflow is:

  1. Build and install milvus-sdk-cpp
  2. Point your project’s CMake build to the installed headers and library
  3. Include SDK headers such as milvus/MilvusClientV2.h
  4. Link your executable against milvus_sdk

For example, after installing the SDK to a custom prefix:

make install CMAKE_INSTALL_PREFIX=/path/to/install

your 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.

License

Apache License 2.0

About

C++ SDK for Milvus

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors