agentleFS
zilliztechzilliztech/knowhere/.agents/skills/building/SKILL.md

building

Skill390 starsChanged 10 days agoApache-2.0View on GitHub

Use when building knowhere from source, configuring build options (CPU/GPU/DISKANN/ASAN), or troubleshooting compilation errors

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run commands from the repository root.

    line 10
  2. Distinctive:

    ASAN failures: Check for memory leaks, use-after-free, buffer overflows

    line 71
  3. Distinctive:

    If the build changes a feature or interface, update the corresponding repository documentation.

    line 75

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Building Knowhere

Prerequisites

Run commands from the repository root. Reuse an existing compiler and Conan environment when available. For initial setup, scripts/install_deps.sh is the maintained source for platform dependencies and tool versions, including CMake, ccache, and Conan. The script also configures the default Conan profile and remote; review it before using it in an existing environment.

Build options and output paths are defined in Makefile and conanfile.py. Use make help to inspect the available targets and flags.

Build Commands

Build TypeCommand
CPU Releasemake
CPU Debugmake WITH_DEBUG=True
CPU + UTmake WITH_UT=True
CPU + UT + ASANmake WITH_UT=True WITH_ASAN=True
Cardinal GPUmake WITH_CARDINAL=True WITH_GPU=True
Cardinal CPU onlymake WITH_CARDINAL=True
Cardinal GPU + cuVSmake WITH_CARDINAL=True WITH_GPU=True WITH_CUVS=True
GPU (cuVS)make WITH_GPU=True
GPU (cuVS) + UTmake WITH_GPU=True WITH_UT=True
macOSmake (auto-detects libc++)

Build outputs default to build/Release/ or build/Debug/. Run tests after building with WITH_UT=True:

make test

# Match the build configuration and any custom output directory
make test WITH_DEBUG=True
make test BUILD_DIR=/path/to/build

Build Flags

FlagDescription
WITH_GPU=True/FalseEnable Cardinal GPU with Cardinal, otherwise enable cuVS; defaults to False
WITH_CUVS=True/FalseExplicit cuVS selection, including alongside Cardinal
WITH_CARDINAL=TrueEnable Cardinal
WITH_UT=TrueEnable unit tests
WITH_BENCHMARK=TrueEnable benchmarks
WITH_ASAN=TrueEnable AddressSanitizer
WITH_DISKANN=FalseDisable DiskANN (enabled by default by Makefile on Linux)
WITH_SVS=TrueEnable SVS on x86
WITH_DEBUG=TrueDebug build (default: Release)
BUILD_DIR=<path>Set the output root; binaries remain under its Release/Debug subdirectory
CONAN_PROFILE=<p>Use one custom Conan profile for host and build
LIBCXX=<lib>Override compiler.libcxx (auto-detected from OS)

GPU, cuVS and Cardinal flags accept True/False, ON/OFF and 1/0. Other enable flags use Make's ifdef: leave them unset to disable them; WITH_UT=False, for example, still enables tests. WITH_DISKANN explicitly accepts true/false values.

WITH_CUVS=True enables cuVS independently of WITH_GPU. Without Cardinal, WITH_GPU=True still enables cuVS even when WITH_CUVS=False.

Common Issues

  • libstdc++ errors: Override with make LIBCXX=libstdc++11
  • macOS: libc++ is auto-detected; OpenMP uses Homebrew's libomp
  • CMake 4.x: Makefile already exports CMAKE_POLICY_VERSION_MINIMUM=3.5 for old dependency recipes
  • ASAN failures: Check for memory leaks, use-after-free, buffer overflows

If the build changes a feature or interface, update the corresponding repository documentation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.