Numerical Backends

oCAS ships a pure-Rust default build (using num-bigint/num-rational) and optional high-performance backends behind feature flags. The default build uses only LGPL-compatible dependencies; GPL-exclusive code is isolated in the optional ocas-gpl crate.

Feature flags

FeatureCrateBackendLicense
gmpocas-core, ocas-domain, ocas-polyGMP integers/rationals via rugLGPL
mpfrocas-domainMPFR real balls via rugLGPL
flintocas-polyFLINT 3 (Linux/WSL only)LGPL
nttocas-polyNumber-theoretic transform for polynomial multiplication (self-implemented)LGPL
sprsocas-polySparse matrix backend (via sprs crate)MIT
fast-polyocas-evalFast polynomial evaluation (SIMD-friendly)MIT
jitocas-evalCranelift JIT compilationApache-2.0
simdocas-evalSIMD-vectorized evaluationMIT
eggocas-rewriteE-graph equality saturationMIT

Enabling backends

# GMP + MPFR backends (recommended on Windows via MSYS2 MINGW64)
cargo build -p ocas --features gmp,mpfr

# FLINT backend (Linux/WSL only; requires system libflint)
cargo build -p ocas --features gmp,mpfr,flint

# JIT + SIMD evaluation
cargo build -p ocas --features jit,simd

See docs/build-windows.md for Windows-specific setup of GMP/MPFR via MSYS2.

GPL backends

The ocas-gpl crate (licensed GPL-3.0-or-later) is opt-in and never included in the default build. It hosts GPL-exclusive algorithms that cannot ship under LGPL. Default oCAS builds remain LGPL-clean.