33[ ![ Build Status] ( https://img.shields.io/travis/aldanor/hdf5-rs.svg )] ( https://travis-ci.org/aldanor/hdf5-rs ) [ ![ Appveyor Build Status] ( https://img.shields.io/appveyor/ci/aldanor/hdf5-rs.svg )] ( https://ci.appveyor.com/project/aldanor/hdf5-rs )
44
55[ Documentation] ( http://aldanor.github.io/hdf5-rs/hdf5_rs )
6+ [ Changelog] ( https://github.com/aldanor/hdf5-rs/blob/master/CHANGELOG.md )
67
78Thread-safe Rust bindings and high-level wrappers for the HDF5 library API.
89
@@ -16,15 +17,15 @@ Requires HDF5 library of version 1.8.4 or later.
1617
1718- Linux (tested on Travis CI, HDF5 v1.8.4)
1819- OS X (tested on Travis CI, HDF5 v1.8.16)
19- - Windows (see below for details; gnu build tested on AppVeyor, HDF5 v1.8.15 )
20+ - Windows (tested on AppVeyor, MSVC target, HDF5 v1.8.16, VS2015 x64 )
2021
2122### Rust
2223
2324` hdf5-rs ` is tested for all three official release channels: stable, beta and nightly.
2425
2526## Building
2627
27- ### Conditional compilation
28+ ### HDF5 version
2829
2930Build scripts for both ` libhdf5-sys ` and ` hdf5-rs ` crates check the actual version of the
3031HDF5 library that they are being linked against, and some functionality may be conditionally
@@ -34,38 +35,42 @@ choose to use the low level FFI bindings.
3435
3536### Linux, OS X
3637
38+ The build script of ` libhdf5-lib ` crate will try to use ` pkg-config ` if it's available
39+ to deduce HDF5 library location. This is sufficient for most standard setups.
40+
3741There are also two environment variables that may be of use if the library location and/or name
3842is unconventional:
3943
4044- ` HDF5_LIBDIR ` – added to library search path during the build step
41- - ` HDF5_LIBNAME ` – library filename (defaults to ` hdf5 ` )
42-
43- Note also that the build script of ` libhdf5-sys ` crate tries to use ` pkg-config ` (if it's available
44- to deduce library location).
45+ - ` HDF5_LIBNAME ` – library name (defaults to ` hdf5 ` )
4546
46- For most setups though, just running ` cargo build ` and ` cargo test ` should be sufficient .
47+ Note that ` cargo clean ` is requred before rebuilding if any of those variables are changed .
4748
4849### Windows
4950
50- Until the official MSVC tooling lands becomes mature enough in stable Rust, we can only support the
51- gcc build of HDF5 binaries on Windows. Since the official binaries from
52- [ HDF-Group] ( http://www.hdfgroup.org/ ) are built with MSVC, a few extra step are required to get
53- everything working. Instructions for building HDF5 on Windows can be found
54- [ here] ( http://www.hdfgroup.org/HDF5/release/cmakebuild.html ) . The
55- [ TDM distribution] ( http://tdm-gcc.tdragon.net/ ) of MinGW-GCC is recommended as it contains bintools
56- for both 32-bit and 64-bit.
57-
58- As of now, building ` hdf5-rs ` on Windows requires a few manual steps:
59-
60- - gcc-compatible HDF5 binary (` hdf5.dll ` shared library) is required for linking.
61-
62- - Set ` HDF5_LIBDIR ` environment variable to point to the folder containing ` hdf5.dll ` (avoid paths
63- with spaces as they are difficult to escape correctly).
64-
65- - Make sure that ` hdf5.dll ` is on your search path, otherwise the tests will fail.
66-
67- - Run ` cargo build ` and/or ` cargo test ` to build the Rust library and run the tests. After making
68- any changes to the build environment, e.g. ` HDF5_LIBDIR ` , a ` cargo clean ` may be necessary.
51+ ` hdf5-rs ` fully supports MSVC toolchain, which allows using the
52+ [ official releases] ( https://www.hdfgroup.org/downloads/index.html ) of
53+ HDF5 and is generally the recommended way to go. That being said, previous experiments have shown
54+ that all tests pass on the ` gnu ` target as well, one just needs to be careful with building the
55+ HDF5 binary itself and configuring the build environment.
56+
57+ Few things to note when building on Windows:
58+
59+ - ` hdf5.dll ` should be available in the search path at build time and runtime (both ` gnu ` and ` msvc ` ).
60+ This normally requires adding the ` bin ` folder of HDF5 installation to ` PATH ` . If using an official
61+ HDF5 release (` msvc ` only), this will be done automatically by the installer.
62+ - If ` HDF5_LIBDIR ` or ` HDF5_LIBNAME ` change, ` cargo clean ` is required before rebuilding.
63+ - ` msvc ` : installed Visual Studio version should match the HDF5 binary (2013 or 2015). Note that it
64+ is not necessary to run ` vcvars ` scripts; Rust build system will take care of that.
65+ - In most cases, it is not necessary to manually set ` HDF5_LIBDIR ` as it would be inferred from the
66+ search path (both ` gnu ` and ` msvc ` ). This also implies that the official releases should work
67+ out of the box.
68+ - When building for either target, make sure that there are no conflicts in the search path (e.g.,
69+ some binaries from MinGW toolchain may shadow MSVS executables or vice versa).
70+ - The recommended platform for ` gnu ` target is [ TDM distribution] ( http://tdm-gcc.tdragon.net/ ) of
71+ MinGW-GCC as it contains bintools for both 32-bit and 64-bit.
72+ - The recommended setup for ` msvc ` target is VS2015 x64 since that matches CI build configuration,
73+ however VS2013 and x86 should work equally well.
6974
7075## License
7176
0 commit comments