[package]
name = "rsxcore"
version.workspace = true
edition = "2024"
rust-version = "1.85"
license = "GPL-3.0-or-later"
description = "Rust library for RAD-seq sex-determination marker analysis (RADSex-compatible)"
repository = "https://github.com/HaoZeke/rsx-rs"
documentation = "https://rsx.rgoswami.me"
keywords = ["bioinformatics", "rad-seq", "sex-determination", "genomics", "ffi"]
categories = ["science", "api-bindings"]

[lib]
name = "rsx_core"
crate-type = ["staticlib", "cdylib", "lib"]

# cargo-c metadata: `cargo cinstall` builds and installs the C library, the
# cbindgen header (rsx/rsx.h), and a pkg-config file (rsx.pc) for system and
# conda consumers. cargo-c drives cbindgen via the existing cbindgen.toml.
[package.metadata.capi]
min_version = "0.10.0"

[package.metadata.capi.header]
name = "rsx"
subdirectory = "rsx"

[package.metadata.capi.pkg_config]
name = "rsx"
filename = "rsx"

[package.metadata.capi.library]
name = "rsx"

[features]
default = ["parallel", "map"]
gen-header = ["dep:cbindgen"]
parallel = ["dep:rayon", "dep:dashmap"]
mpi = ["dep:mpi"]
map = ["dep:minimap2"]
parquet-io = ["dep:arrow", "dep:parquet"]
# Enable Arrow RecordBatch production from commands (for direct data to Python)
arrow-output = ["dep:arrow"]
# Enable Arrow IPC ingestion through MarkerTableSource (in-memory or Parquet spill).
arrow-input = ["dep:arrow", "dep:parquet"]

[dependencies]
needletail = "0.6"
flate2 = "1"
hexf = "0.2"
libm = "0.2"
# crossbeam removed -- inline parsing is faster than channel-based
indexmap = "2"
memchr = "2"
ahash = "0.8"
dashmap = { version = "6", optional = true }
rayon = { version = "1.10", optional = true }
memmap2 = "0.9"
ryu = "1"
# Local/CI builds use rsmpi git main (fixes OpenMPI struct layout issues not
# yet in the 0.8.1 crates.io release); crates.io publish falls back to 0.8.1
# (the optional `mpi` feature is off by default).
mpi = { version = "0.8.1", git = "https://github.com/rsmpi/rsmpi.git", optional = true }
lz4_flex = "0.11"
minimap2 = { version = "0.1", optional = true }
arrow = { version = "55", optional = true }
parquet = { version = "55", optional = true, features = ["arrow"] }
tempfile = "3"
log = "0.4"
env_logger = "0.11"

[build-dependencies]
cbindgen = { version = "0.28", optional = true }

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
tempfile = "3"

[[bench]]
name = "bench_stats"
harness = false
