# Installation

> UForm for Rust

```sh
cargo add uform
```

CMake builds the library from the crate's sources into Cargo's output directory and links it as a static archive, along with the system image, video and audio codecs.
Three features swap what is linked, and `build.rs` refuses the stub beside either GPU feature:

- `cuda` adds the NVIDIA residency, the trainer and the mesh, and needs a CUDA toolkit at build time.
- `rocm` adds the AMD residency, and needs ROCm at build time.
- `stub` links a stand-in that answers the same verbs over the C++ standard library alone, with deterministic rows, seconds to build and no codecs, for testing a caller and never for shipping.

CMake builds the NumKong, StringZilla, ForkUnion and SmashTable trees of the crates Cargo resolved, rather than fetching their pinned revisions again.
`UFORM_LIBRARY_DIR`, naming the directory of a `libuform_static.a` CMake already built, links that archive instead of running CMake.
A WASI build reads the SDK from `WASI_SDK_PATH` and needs `-C target-feature=+simd128`.
The suites run against the stub:

```sh
CC=clang-22 CXX=clang++-22 cargo test --features stub
```

`use uform::*;`

## version

The version of the linked library.

```rust
pub fn version() -> &'static str
```

Calls `uform_version_name`.

