# Installation

> USearch for Rust

```sh
cargo add usearch
```

CMake builds the engine from the crate's sources and links it as a static archive.
That build compiles the four most common dense storage types, `bf16`, `u1x8`, `i8` and `e4m3`, and an index over any other is refused as `Unsupported`.
[NumKong](/docs/numkong/) is a hard dependency rather than a feature: its matrices, scalar types, and traits _are_ this crate's vocabulary, and it supplies the SIMD kernels.

Two features swap the implementation of the C interface the crate links, and naming both is refused:

- `cuda` compiles the CUDA backends in and needs a toolkit at build time, with `USEARCH_CUDA_ARCH` choosing the GPU code, the release set `all` by default.
- `stub` links a brute-force stand-in that answers the same verbs over the standard library alone, with exact search, seconds to build and no submodules, for testing a caller and never for shipping.

A WASI build reads the SDK from `WASI_SDK_PATH` and needs `-C target-feature=+simd128`.
`USEARCH_LIBRARY_DIR` names a directory already holding `libusearch_static.a`, such as the `lib/` of a prefix `cmake --install build_release --component static` filled, and skips the CMake build.

