|
14 | 14 | ~ limitations under the License. |
15 | 15 | --> |
16 | 16 |
|
17 | | -These examples utilize LVQ and LeanVec interfaces which are available when linking to a SVS shared/static library, which are published with [releases](https://github.com/intel/ScalableVectorSearch/releases). Note that these examples will _not_ run after building the open source codebase without the shared/static library. These examples include: |
| 17 | +These examples utilize LVQ and LeanVec interfaces which are available when linking to a SVS shared/static library, which are published with [releases](https://github.com/intel/ScalableVectorSearch/releases), as a tarball, pip wheel, or conda package. Note that these examples will _not_ run after building the open source codebase without the shared/static library. These examples include: |
18 | 18 | - [example_vamana_with_compression.cpp](./example_vamana_with_compression.cpp): Demonstrates building, searching, saving, and reloading an index with a LeanVec-compressed dataset. |
19 | 19 | - [example_vamana_with_compression_lvq.cpp](./example_vamana_with_compression_lvq.cpp): Demonstrates building, searching, saving, and reloading an index with a LVQ-compressed dataset. |
20 | 20 | - [example_vamana_with_compression_dynamic.cpp](./example_vamana_with_compression_dynamic.cpp): Demonstrates building, searching, saving, and reloading a dynamic index (allows vector insertions and deletions over time) with a LeanVec-compressed dataset. |
21 | 21 |
|
22 | | -See [CMakeLists.txt](./CMakeLists.txt) for details on linking to the SVS shared library and follow the commands below to compile and use the SVS shared library to run shared.cpp example: |
| 22 | +See [CMakeLists.txt](./CMakeLists.txt) for details on linking to the SVS shared library. |
23 | 23 |
|
| 24 | +## Running the examples |
| 25 | + |
| 26 | +The CMakeLists.txt is set up to detail usage of all options (tarball, pip, conda), and will prioritize utilization in the following order: |
| 27 | + |
| 28 | +1. **System/Conda/Pip installation** - If SVS is installed in a standard location that CMake can find |
| 29 | +2. **GitHub Release download** - If not found, it will download the tarball from GitHub |
| 30 | + |
| 31 | +### Option 1: Using libsvs in a conda environment |
| 32 | + |
| 33 | +Install the `libsvs` package (currently only available from GitHub releases): |
| 34 | +```bash |
| 35 | +conda install https://github.com/intel/ScalableVectorSearch/releases/download/v1.0.0-dev/libsvs-0.0.10-gc4e106f_0.conda |
| 36 | + |
| 37 | +mkdir build |
| 38 | +cd build |
| 39 | +CC=gcc-11 CXX=g++-11 cmake ../ |
| 40 | +make -j |
| 41 | +./example_vamana_with_compression_dynamic |
24 | 42 | ``` |
| 43 | + |
| 44 | +### Option 2: Using pip-installed libsvs |
| 45 | + |
| 46 | +Install the `libsvs` package (currently only available from GitHub releases) and ensure CMake can find it by setting `CMAKE_PREFIX_PATH`: |
| 47 | +```bash |
| 48 | +pip install https://github.com/intel/ScalableVectorSearch/releases/download/v1.0.0-dev/libsvs-0.0.10+NIGHTLY20251023.184-py3-none-any.whl |
| 49 | + |
| 50 | +mkdir build |
| 51 | +cd build |
| 52 | +# Note that pip packages require setting CMAKE_PREFIX_PATH to find the library, conda handles this automatically |
| 53 | +CC=gcc-11 CXX=g++-11 cmake -DCMAKE_PREFIX_PATH=$(python -c "import libsvs; print(libsvs.get_cmake_prefix_path())") .. |
| 54 | +make -j |
| 55 | +./example_vamana_with_compression_dynamic |
| 56 | +``` |
| 57 | + |
| 58 | +### Option 2: Using shared library tarball |
| 59 | + |
| 60 | +If `libsvs` is not installed, CMake will download the tarball (see [CMakeLists.txt](./CMakeLists.txt) for the necessary steps here): |
| 61 | +```bash |
25 | 62 | mkdir build |
26 | 63 | cd build |
27 | 64 | CC=gcc-11 CXX=g++-11 cmake ../ |
28 | 65 | make -j |
29 | | -./shared |
| 66 | +./example_vamana_with_compression_dynamic |
30 | 67 | ``` |
0 commit comments