Files
chess-endgame-trainer/native/fathom_nif/build.rs
T
owenrees e60c161a3a Add a Fathom Syzygy probe NIF (#29)
Vendor the MIT-licensed Fathom C source and compile it into a Rustler NIF (native/fathom_nif). The NIF exposes init/1 (point Fathom at a tablebase directory) and probe/1 (raw WDL/DTZ/move results for a FEN); probes are serialised because Fathom's root probe is not thread safe, and run as dirty NIFs.

Add KRvK/KQvK 3-piece WDL+DTZ fixtures and an integration test proving a known KRvK probe returns Win, DTZ 23 and 15 moves.
2026-11-03 13:41:54 +01:00

22 lines
586 B
Rust

fn main() {
for file in [
"vendor/fathom/src/tbprobe.c",
"vendor/fathom/src/tbchess.c",
"vendor/fathom/src/tbprobe.h",
"vendor/fathom/src/tbconfig.h",
"vendor/fathom/src/stdendian.h",
"csrc/wrapper.c",
] {
println!("cargo:rerun-if-changed={file}");
}
cc::Build::new()
.file("vendor/fathom/src/tbprobe.c")
.file("csrc/wrapper.c")
.include("vendor/fathom/src")
.flag_if_supported("-std=gnu99")
.flag_if_supported("-O2")
.warnings(false)
.compile("fathom");
}