AgentSkillsCN

building

当您从源码构建 Knowhere,配置编译选项(CPU/GPU/DISKANN/ASAN),或排查编译错误时,可使用此技能。

SKILL.md
--- frontmatter
name: building
description: Use when building knowhere from source, configuring build options (CPU/GPU/DISKANN/ASAN), or troubleshooting compilation errors

Building Knowhere

Prerequisites

bash
# Ubuntu/Debian
sudo apt install build-essential libopenblas-openmp-dev libaio-dev python3-dev python3-pip
pip3 install conan==1.61.0 --user
export PATH=$PATH:$HOME/.local/bin

Build Commands

bash
mkdir build && cd build
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
Build TypeCommand
CPU Releaseconan install .. --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s build_type=Release
CPU Debugconan install .. --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s build_type=Debug
GPU (CUVS)conan install .. --build=missing -o with_ut=True -o with_cuvs=True -s compiler.libcxx=libstdc++11 -s build_type=Release
DISKANNconan install .. --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release
ASAN (CI default)conan install .. --build=missing -o with_ut=True -o with_diskann=True -o with_asan=True -s compiler.libcxx=libstdc++11 -s build_type=Release
macOSconan install .. --build=missing -o with_ut=True -s compiler.libcxx=libc++ -s build_type=Release

Then run: conan build ..

Build Options

OptionDescription
with_utEnable unit tests
with_diskannEnable DISKANN index support
with_cuvsEnable GPU (CUVS) support
with_asanEnable AddressSanitizer for memory error detection

Common Issues

  • libstdc++ errors: Ensure -s compiler.libcxx=libstdc++11 matches your system
  • Missing dependencies: Run conan install with --build=missing
  • macOS: Use libc++ instead of libstdc++11
  • ASAN failures: Check for memory leaks, use-after-free, buffer overflows

If this build relates to new features or interface changes, consider updating documentation. See documenting skill.