You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -31,13 +31,14 @@ All variable data is read into a contiguous buffer, or into an [ndarray](https:/
31
31
32
32
## Building
33
33
34
-
This crate depends on `libnetcdf`, but a static build from source is also supported, which can be enabled using the `static` feature.
34
+
This crate depends on the C library [`netcdf-c`](https://www.unidata.ucar.edu/netcdf/) which must be installed on the machine, along with libraries such as `hdf5` which `netcdf-c` depends on. For some platforms you might have to set the environment variable `NETCDF_DIR`which needs to point at the installation of `netcdf-c` you wish to use.
35
35
36
-
The crate is built on several platforms using github actions, and is currently known to build form from source on all major platforms (linux, macos, windows (gnu+msvc)), and through the package installers `conda` and `apt`.
36
+
An alternative to using the system libraries is to enable `static` feature of this crate (`cargo add netcdf --features static`), which compiles `libnetcdf`from source. The `static` feature requires `cmake`, a `c++` compiler and more to be installed on the build machine.
37
37
38
-
If during compilation there is an error in building the `hdf5` crate, consider using the `static` feature which will include a compatible version of both `netcdf` and `hdf5`. This is likely to be an issue [upstream](https://github.com/aldanor/hdf5-rust/issues/262).
38
+
The crate is built on several platforms using github actions, and is currently known to build form from source on all major platforms (linux, macos, windows (gnu+msvc)), and through the package installers `conda` and `apt`. Please see the github workflows for tips on how to install `netcdf`.
39
39
40
-
### Building without `libnetcdf` or building statically
panic!("A system version of libnetcdf could not be found. Consider installing to some default location, use the environment variable NETCDF_DIR (remember to restart the shell), or prefer building the static version of libnetcdf by enabling the `static` feature on `netcdf-sys` or `netcdf`"
268
+
);
269
+
}
270
+
235
271
fnmain(){
236
272
println!("cargo::rerun-if-changed=build.rs");
237
273
@@ -240,26 +276,19 @@ fn main() {
240
276
let netcdf_lib = std::env::var("DEP_NETCDFSRC_LIB").unwrap();
241
277
let netcdf_path = PathBuf::from(std::env::var_os("DEP_NETCDFSRC_SEARCH").unwrap());
242
278
243
-
info = NcInfo::gather_from_ncconfig(Some(&netcdf_path.join("..")))
//! This crate depends on [Unidata NetCDF-c](https://github.com/Unidata/netcdf-c) and dependencies
22
+
//! of this library (such as hdf5).
23
+
//! An alternative to the system libraries is to use the bundled sources of netcdf by using the `static` feature of this crate. This will require build utilities such as `cmake`, `c++` compiler and more.
0 commit comments