> ## Documentation Index
> Fetch the complete documentation index at: https://zinc.ossl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Build and install Zinc for your platform and language

Zinc ships as a shared library (`libzinc_core`) with per-language adapter packages. Build the core, then install the adapter for your language.

<Warning>Windows is not supported. Zinc uses POSIX shared memory (`shm_open` + `mmap`). There are no plans to add Windows support.</Warning>

## Prerequisites

* Rust 1.82 or later
* A C compiler toolchain (Xcode on macOS, build-essential on Linux)
* For adapter packages: the corresponding language runtime

## Build the core

The core library is a Rust crate at the `core/` directory. It compiles to a `cdylib` that every language adapter loads at runtime.

```bash theme={null}
git clone https://github.com/ossl-dev/zinc
cd zinc
cargo build --release --manifest-path core/Cargo.toml
```

The output appears at:

* Linux: `core/target/release/libzinc_core.so`
* macOS: `core/target/release/libzinc_core.dylib`

The build also generates `include/zinc.h` via cbindgen. This header is the C ABI contract. All adapters derive their FFI bindings from it.

## By language

<CodeGroup>
  ```bash Rust theme={null}
  # Add zinc-core as a dependency
  cargo add zinc-core --path /path/to/zinc/core

  # Or from crates.io (once published)
  cargo add zinc-core
  ```

  ```bash Python theme={null}
  pip install zinc-shm

  # Or install from source
  cd adapters/python
  pip install -e .
  ```

  ```bash Go theme={null}
  go get github.com/ossl/zinc/adapters/go

  # Or use a local path
  # In go.mod: replace zinc => ./adapters/go
  ```

  ```bash Node.js theme={null}
  npm install @ossl/zinc
  ```

  ```bash Bun theme={null}
  bun add @ossl/zinc-bun
  ```

  ```bash Deno theme={null}
  deno add @ossl/zinc
  ```

  ```bash C++ theme={null}
  # Header-only. Copy include/zinc.hpp into your project.
  # Link against libzinc_core at build time.
  ```

  ```xml Java theme={null}
  <!-- Maven Central (pending) -->
  <dependency>
    <groupId>dev.zinc</groupId>
    <artifactId>zinc-java</artifactId>
    <version>0.1.0</version>
  </dependency>
  ```

  ```bash C# theme={null}
  dotnet add package Zinc
  ```
</CodeGroup>

## Library path

All adapters expect `libzinc_core.{so,dylib}` on the library search path. The easiest approach is to place the compiled library in a standard location:

<CodeGroup>
  ```bash Linux theme={null}
  sudo cp core/target/release/libzinc_core.so /usr/local/lib/
  sudo ldconfig
  ```

  ```bash macOS theme={null}
  cp core/target/release/libzinc_core.dylib /usr/local/lib/
  ```
</CodeGroup>

Alternatively, set the library path via `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS).

## Platform notes

* **Linux** requires glibc 2.17 or later. The notify/wait backend uses the `futex` syscall.
* **macOS** uses an adaptive spin-loop for wait (the `ulock` API is private on Darwin).

<Warning>Windows is not supported. Zinc uses `shm_open` and `mmap`, which are POSIX APIs not available on Windows.</Warning>

## Verify the installation

Build the core, then run the C ABI test:

```bash theme={null}
cargo test --manifest-path core/Cargo.toml
```

All tests should pass on Linux and macOS.
