Fork de SPLAT! (John A. Magliacane, KD2BD, 2002-2014), bajo GPLv2 heredada del original. El núcleo de cálculo de propagación (ITWOM v3.0, Sid Shumate) se mantiene sin modificar en cpp/itwom3.0.cpp, llamado vía FFI. El resto del pipeline (lectura de formatos SPLAT!, reportes, mapas, KML, gnuplot) se reescribió en Rust, con paralelización nativa vía rayon reemplazando el paralelismo por múltiples procesos del original. Validado contra el corpus golden de SPLAT! con drift < 0.02 dB en cálculos ITWOM.
35 lines
1.3 KiB
Rust
35 lines
1.3 KiB
Rust
fn main() {
|
|
cc::Build::new()
|
|
.cpp(true)
|
|
.file("cpp/itwom3.0.cpp")
|
|
.file("cpp/itwom_ffi.cpp")
|
|
.flag_if_supported("-std=c++11")
|
|
.flag_if_supported("-O3")
|
|
.flag_if_supported("-ffast-math")
|
|
.flag_if_supported("-fomit-frame-pointer")
|
|
.warnings(false)
|
|
.compile("itwom");
|
|
|
|
// libbz2 is used by the SDF loader (FFI shim in src/sdf.rs). On this
|
|
// machine libbz2-dev isn't installed system-wide, but miniconda ships it.
|
|
// BZ2_BZ2_LIB_DIR can override; otherwise we probe common locations.
|
|
if let Ok(dir) = std::env::var("BZ2_LIB_DIR") {
|
|
println!("cargo:rustc-link-search=native={dir}");
|
|
} else {
|
|
for candidate in ["/home/cescobar/miniconda3/lib", "/usr/lib/x86_64-linux-gnu"] {
|
|
if std::path::Path::new(candidate).join("libbz2.so").exists()
|
|
|| std::path::Path::new(candidate).join("libbz2.a").exists()
|
|
|| std::path::Path::new(candidate).join("libbz2.so.1.0").exists()
|
|
{
|
|
println!("cargo:rustc-link-search=native={candidate}");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
println!("cargo:rustc-link-lib=dylib=bz2");
|
|
|
|
println!("cargo:rerun-if-changed=cpp/itwom3.0.cpp");
|
|
println!("cargo:rerun-if-changed=cpp/itwom_ffi.cpp");
|
|
println!("cargo:rerun-if-env-changed=BZ2_LIB_DIR");
|
|
}
|