@@ -67,16 +67,18 @@ fn main() -> h5::Result<()> {
6767
6868### Platforms
6969
70- ` hdf5-rs ` is known to run on these platforms:
71-
72- - Linux (tested on Travis CI, HDF5 v1.8.4)
73- - OS X (tested on Travis CI, HDF5 v1.8.16)
74- - Windows (tested on AppVeyor, MSVC target, HDF5 v1.8.16, VS2015 x64)
70+ ` hdf5-rs ` is known to run on these platforms: Linux, macOS, Windows (tested on Travis CI and
71+ AppVeyor, HDF5 1.8 and 1.10, system installations and conda environments).
7572
7673### Rust
7774
78- ` hdf5-rs ` is tested for all three official release channels, and requires Rust compiler
79- of version 1.13 or newer.
75+ ` hdf5-rs ` is tested continuously for all three official release channels, and requires
76+ a modern Rust compiler (e.g. of version 1.31 or later).
77+
78+ ### HDF5
79+
80+ Required HDF5 version is 1.8.4 or newer. The library doesn't have to be built with
81+ threadsafe option enabled.
8082
8183## Building
8284
@@ -88,38 +90,56 @@ enabled or disabled at compile time. While this allows supporting multiple versi
8890in a single codebase, this is something the library user should be aware of in case they
8991choose to use the low level FFI bindings.
9092
91- ### Linux, OS X
93+ ### Environment variables
94+
95+ If ` HDF5_DIR ` is set, the build script will look there (and nowhere else) for HDF5
96+ headers and binaries (i.e., it will look for headers under ` $HDF5_DIR/include ` ).
97+
98+ If ` HDF5_VERSION ` is set, the build script will check that the library version matches
99+ the specified version string; in some cases it may also be used by the build script to
100+ help locating the library (e.g. when both 1.8 and 1.10 are installed via Homebrew on macOS).
101+
102+ ### conda
103+
104+ It is possible to link against ` hdf5 ` conda package; a few notes and tips:
105+
106+ - Point ` HDF5_DIR ` to conda environment root.
107+ - The build script knows about conda environment layout specifics and will adjust
108+ paths accordingly (e.g. ` Library ` subfolder in Windows environments).
109+ - On Windows, environment's ` bin ` folder must be in ` PATH ` (or the environment can
110+ be activated prior to running cargo).
111+ - On Linux / macOS, it is recommended to set rpath, e.g. by setting
112+ ` RUSTFLAGS="-C link-args=-Wl,-rpath,$HDF5_DIR/lib" ` .
113+ - For old versions of HDF5 conda packages on macOS, it may also be necessary to set
114+ ` DYLD_FALLBACK_LIBRARY_PATH="$HDF5_DIR/lib" ` .
92115
93- The build script of ` libhdf5-lib ` crate will try to use ` pkg-config ` if it's available
94- to deduce HDF5 library location. This is sufficient for most standard setups.
116+ ### Linux
95117
96- There are also two environment variables that may be of use if the library location and/or name
97- is unconventional:
118+ The build script will attempt to use pkg-config first, which will likely work out without
119+ further tweaking for the more recent versions of HDF5. The build script will then also look
120+ in some standard locations where HDF5 can be found after being apt-installed on Ubuntu.
98121
99- - ` HDF5_LIBDIR ` – added to library search path during the build step
100- - ` HDF5_LIBNAME ` – library name (defaults to ` hdf5 ` )
122+ ### macOS
101123
102- Note that ` cargo clean ` is requred before rebuilding if any of those variables are changed.
124+ On macOS, the build script will attempt to locate HDF5 via Homebrew if it's available.
125+ If both 1.8 and 1.10 are installed and available, the default (1.10) will be used
126+ unless ` HDF5_VERSION ` is set.
103127
104128### Windows
105129
106130` hdf5-rs ` fully supports MSVC toolchain, which allows using the
107131[ official releases] ( https://www.hdfgroup.org/downloads/index.html ) of
108- HDF5 and is generally the recommended way to go. That being said, previous experiments have shown
109- that all tests pass on the ` gnu ` target as well, one just needs to be careful with building the
110- HDF5 binary itself and configuring the build environment.
132+ HDF5 and is generally the recommended way to go. That being said, previous experiments have
133+ shown that all tests pass on the ` gnu ` target as well, one just needs to be careful with
134+ building the HDF5 binary itself and configuring the build environment.
111135
112136Few things to note when building on Windows:
113137
114138- ` hdf5.dll ` should be available in the search path at build time and runtime (both ` gnu ` and ` msvc ` ).
115139 This normally requires adding the ` bin ` folder of HDF5 installation to ` PATH ` . If using an official
116- HDF5 release (` msvc ` only), this will be done automatically by the installer.
117- - If ` HDF5_LIBDIR ` or ` HDF5_LIBNAME ` change, ` cargo clean ` is required before rebuilding.
140+ HDF5 release (` msvc ` only), this will typically be done automatically by the installer.
118141- ` msvc ` : installed Visual Studio version should match the HDF5 binary (2013 or 2015). Note that it
119142 is not necessary to run ` vcvars ` scripts; Rust build system will take care of that.
120- - In most cases, it is not necessary to manually set ` HDF5_LIBDIR ` as it would be inferred from the
121- search path (both ` gnu ` and ` msvc ` ). This also implies that the official releases should work
122- out of the box.
123143- When building for either target, make sure that there are no conflicts in the search path (e.g.,
124144 some binaries from MinGW toolchain may shadow MSVS executables or vice versa).
125145- The recommended platform for ` gnu ` target is [ TDM distribution] ( http://tdm-gcc.tdragon.net/ ) of
0 commit comments