# Build FalkorDB

Builds FalkorDB with its native dependencies and runs format and lint checks.

- Repository: https://github.com/FalkorDB/FalkorDB (10505 stars)
- Category: DevOps
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add FalkorDB/FalkorDB --skill build -g -a claude-code -y`
Codex: `npx skills add FalkorDB/FalkorDB --skill build -g -a codex -y`
Cursor: `npx skills add FalkorDB/FalkorDB --skill build -g -a cursor -y`
Gemini CLI: `npx skills add FalkorDB/FalkorDB --skill build -g -a gemini-cli -y`

## Description

Build FalkorDB (Rust code plus its native GraphBLAS/RediSearch dependencies), and run formatting/lint checks. Use when asked to build or compile the project, set up native dependencies for the first time, fix a build/compile/lint error, or run cargo fmt/clippy.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Build

FalkorDB-rs is a Redis module: the Rust crates link against two native C
libraries (GraphBLAS and RediSearch) that must be compiled and installed
*before* `cargo build` will succeed.

## 1. First-time native dependency setup

Only needed once per machine/container (skip if `cargo build` already works).

On macOS, point the build at Homebrew clang first: the system clang has no
OpenMP, and GraphBLAS would build single-threaded without saying so.

```bash
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
```

```bash
git submodule update --init --recursive   # populates deps/{GraphBLAS,LAGraph,RediSearch}
cargo build                               # graph/build.rs builds them via native-deps
```

`cargo build` builds whatever is missing, so this is usually all you need. To
build them ahead of time, or to see what is happening:

```bash
cargo run --manifest-path native-deps/Cargo.toml
```

Results are cached at
`${XDG_CACHE_HOME:-$HOME/.cache}/falkordb/native-deps/<dep>/<key>/`
(`$FALKORDB_DEPS_CACHE` overrides the root), keyed on the submodule revision,
the GB_control patch, the vendored PreJIT kernels, the recipe sources,
`$CC`/`$CXX --version`, the target triple and the OpenMP/sanitizer flavour.

If a build fails, `native-deps/src/recipes/<dep>.rs` documents the exact cmake
flags (`-DGRAPHBLAS_COMPACT=OFF`, `-DCMAKE_POSITION_INDEPENDENT_CODE=ON`, static
build). To build one dep only, name it, e.g. `... -- graphblas`; add
`FALKORDB_NATIVE_DEPS_FORCE=1` to rebuild it even on a cache hit. A cache miss
is diffable: each entry's
`.stamp` records the full key manifest after a `--- manifest ---` marker.

## 2. Build

```bash
cargo build            # debug build -> target/debug/libfalkordb.{so,dylib}
cargo build --release  # release build -> target/release/libfalkordb.{so,dylib}
```

## 3. Format & lint

```bash
cargo fmt --all -- --check
CXX=clang++ cargo clippy --all-targets
```

The rest: https://github.com/FalkorDB/FalkorDB/blob/HEAD/.claude/skills/build/SKILL.md
