arpack-sys 0.0.2

FFI bindings to ARPACK-NG (system-linked via pkg-config)
Documentation
# arpack-sys

Raw FFI bindings to [ARPACK-NG](https://github.com/opencollab/arpack-ng), the modernized fork of the ARPACK eigenvalue-solver library. Exposes the C-callable `{s,d,c,z}{na,ne,sa,se}upd_c` driver family introduced in ARPACK-NG 3.8.0.

For a safe Rust wrapper, depend on the [`arpack`](https://crates.io/crates/arpack) crate instead.

## Status

The full driver surface is wrapped. Bindings are generated by `bindgen` and committed at `src/bindings.rs`, so downstream builds do **not** need `bindgen` or `clang`.

## Supported targets

64-bit-pointer-width targets only. The safe wrapper's workspace-size arithmetic is bounded only by `usize` / `isize::MAX`, which on 32-bit sits within reach of mistaken inputs; rather than threading fallible allocation everywhere, `arpack-sys` enforces 64-bit-only at compile time via `compile_error!`. Open an issue if you need 32-bit support.

## Linking model

`arpack-sys` links to a system-installed ARPACK-NG (>= 3.8.0) located via `pkg-config`. There is no vendored Fortran build — install ARPACK-NG through your platform package manager:

```bash
# macOS
brew install arpack

# Debian / Ubuntu
sudo apt install libarpack2-dev pkg-config

# Fedora
sudo dnf install arpack-devel pkgconf-pkg-config
```

`pkg-config --modversion arpack` must succeed before `cargo build`.

## Integer ABI

The committed bindings target ARPACK-NG's default 32-bit-integer ABI (`a_int = int`). The build script reads `arpackdef.h` and rejects libraries built with `INTERFACE64=1` (64-bit `a_int`) — silently using such a build would corrupt memory because the Rust side passes 32-bit ints. Rebuild ARPACK-NG with `INTERFACE64=0` (the upstream default) if you hit this.

## Regenerating bindings

To regenerate `src/bindings.rs` against a newer ARPACK-NG header, run from the workspace root:

```bash
./regen-bindings.sh
```

`bindgen` and `clang` are required only for regeneration, not for downstream builds.

## Thread safety

ARPACK-NG keeps state in Fortran `SAVE` variables and is **not** thread-safe — concurrent driver calls race on it. The safe wrapper (`arpack`) serializes every call through a process-wide mutex; if you use `arpack-sys` directly, you are responsible for the same discipline.

## License

- These FFI bindings: `MIT OR Apache-2.0`
- ARPACK-NG itself: `BSD-3-Clause` ([upstream `COPYING`]https://github.com/opencollab/arpack-ng/blob/master/COPYING). Dynamically linked from a system installation; not redistributed by this crate.