Skip to content

Latest commit

 

History

History

README.md

These examples utilize LVQ and LeanVec interfaces which are available when linking to a SVS shared/static library, which are published with 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:

Vamana Examples

IVF Examples

Note: IVF examples require a shared/static library built with SVS_EXPERIMENTAL_ENABLE_IVF=ON, and compiling the examples with -DSVS_ENABLE_IVF_EXAMPLES=ON. Additionally, Intel MKL must be available in the environment (e.g., by sourcing source /opt/intel/oneapi/setvars.sh).

See CMakeLists.txt for details on linking to the SVS shared library.

Running the examples

The CMakeLists.txt is set up to detail usage of all options (tarball, pip, conda), and will prioritize utilization in the following order:

  1. System/Conda/Pip installation - If SVS is installed in a standard location that CMake can find
  2. GitHub Release download - If not found, it will download the tarball from GitHub

Option 1: Using libsvs in a conda environment

Install the libsvs package:

conda install -c https://software.repos.intel.com/python/conda libsvs

mkdir build
cd build
CC=gcc-11 CXX=g++-11 cmake ../
make -j
./example_vamana_with_compression_dynamic

Option 2: Using pip-installed libsvs

Install the libsvs package and ensure CMake can find it by setting CMAKE_PREFIX_PATH:

pip install --index-url https://software.repos.intel.com/python/pypi libsvs

mkdir build
cd build
# Note that pip packages require setting CMAKE_PREFIX_PATH to find the library, conda handles this automatically
CC=gcc-11 CXX=g++-11 cmake -DCMAKE_PREFIX_PATH=$(python -c "import libsvs; print(libsvs.get_cmake_prefix_path())") ..
make -j
./example_vamana_with_compression_dynamic

Option 3: Using shared library tarball

If libsvs is not installed, CMake will download the tarball (see CMakeLists.txt for the necessary steps here):

mkdir build
cd build
CC=gcc-11 CXX=g++-11 cmake ../
make -j
./example_vamana_with_compression_dynamic