Skip to content

Commit

Permalink
Remove old HDF5 options (unused)
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Jul 29, 2024
1 parent 8ef9a9e commit ca755db
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions netcdf-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,11 @@ macro_rules! feature {
};
}

fn get_hdf5_version() -> String {
let (major, minor, patch) = std::env::vars()
.filter_map(|(key, value)| {
key.strip_prefix("DEP_HDF5_VERSION_").map(|key| {
assert_eq!(value, "1");
let mut version = key.split('_');
let major: usize = version.next().unwrap().parse().unwrap();
let minor: usize = version.next().unwrap().parse().unwrap();
let patch: usize = version.next().unwrap().parse().unwrap();

(major, minor, patch)
})
})
.max()
.expect("Crate hdf5 should have emitted a hdf5 version");

format!("{major}.{minor}.{patch}")
}

fn main() {
println!("cargo:rerun-if-changed=build.rs");

let hdf5_incdir = std::env::var("DEP_HDF5_INCLUDE").unwrap();
let mut hdf5_lib = std::env::var("DEP_HDF5_LIBRARY").unwrap();
let mut hdf5_hl_lib = std::env::var("DEP_HDF5_HL_LIBRARY").unwrap();

let hdf5_root = format!("{hdf5_incdir}/../");
#[cfg(unix)]
{
let mut hdf5_libdir = format!("{hdf5_root}/lib/");
if !std::path::Path::new(&hdf5_libdir).exists() {
hdf5_libdir = format!("{hdf5_root}/lib64/");
}
hdf5_lib = format!("{hdf5_libdir}/{hdf5_lib}.a");
hdf5_hl_lib = format!("{hdf5_libdir}/{hdf5_hl_lib}.a");
}

let hdf5_version = get_hdf5_version();

let mut netcdf_config = cmake::Config::new("source");
netcdf_config
Expand Down

0 comments on commit ca755db

Please sign in to comment.