Skip to content

Commit

Permalink
Merge pull request #145 from mulimoen/fix-hdf5-include-directive
Browse files Browse the repository at this point in the history
Patch netcdf-c to include correct hdf5
  • Loading branch information
mulimoen authored May 12, 2024
2 parents a77ae80 + 0d16ffb commit 0f74c43
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions netcdf-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");

let hdf5_incdir = std::env::var("DEP_HDF5_INCLUDE").unwrap();
let hdf5_lib = std::env::var("DEP_HDF5_LIBRARY").unwrap();
let hdf5_hl_lib = std::env::var("DEP_HDF5_HL_LIBRARY").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();

#[cfg(unix)]
{
let hdf5_root = format!("{hdf5_incdir}/../");
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();

Expand Down
2 changes: 1 addition & 1 deletion netcdf-src/source
Submodule source updated 1 files
+4 −0 CMakeLists.txt

0 comments on commit 0f74c43

Please sign in to comment.