-
Notifications
You must be signed in to change notification settings - Fork 95
Rewrite build system, fix hbool_t, remove libhdf5-lib crate #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- On Windows, look up HDF5 in Windows registry - On macOS, check if HDF5 is installed in Homebrew - Only run pkg-config on non-macos unix platforms - Remove pkg-config build dependency on macOS - HDF5_LIBDIR is no longer used - HDF5_DIR can be pointed to HDF5 installation root - HDF5_VERSION environment variable can be now specified - HDF5_VERSION restricts pkg-config/winreg lookups - On Windows, detect conda environments automatically - Require that include/H5pubconf.h exists in HDF5 root - Parse H5Ppubconf.h header and extract useful constants
I just ran
I'm on Manjaro Linux (Arch-based), with HDF5 installed via pacman: pacman -Si hdf5
|
@Enet4 thanks for testing! So, not everything is lost, the following did work:
What didn’t work: loading the library .so via libloading to figure out its version. It’s hard to tell why it failed without debugging locally, options are:
Note: if you run |
By the way, I think we can try and replace one of the xenial/apt Travis environments with Arch/pacman - I’ll take a look a bit later. |
All right, another set of quick commands:
I'm afraid that I am not in a good position to go deep into this right now, I'm on an important deadline until Thursday. |
No problems, thanks for helping. I see the problem, ok - The question is, how can it figure out about |
@aldanor very cool! I tested it against my current macOS install (brew), and followed the conda directions in our linux environment. Both worked smoothly! This is great for our near-term use cases. |
@Enet4 Could you please run the following on your machine and post the results back here? ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\012 |
Right now I am on a different Manjaro Linux machine, but it seems to reproduce the problem all the same. Allow me to run everything again from here: Building with [libhdf5-sys 0.2.0] Attempting to find HDF5 via pkg-config...
[libhdf5-sys 0.2.0] Found HDF5 headers at:
[libhdf5-sys 0.2.0] "/usr/include"
[libhdf5-sys 0.2.0] Adding to link path:
[libhdf5-sys 0.2.0] "/usr/lib/x86_64-linux-gnu"
[libhdf5-sys 0.2.0] Parsing HDF5 config from:
[libhdf5-sys 0.2.0] "/usr/include/H5pubconf.h"
[libhdf5-sys 0.2.0] thread 'main' panicked at 'Unable to infer HDF5 library runtime version.', libhdf5-sys/build.rs:144:5
[libhdf5-sys 0.2.0] note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: failed to run custom build command for `libhdf5-sys v0.2.0 (/home/enet4/misc/hdf5-rs/libhdf5-sys)`
process didn't exit successfully: `/home/enet4/misc/hdf5-rs/target/debug/build/libhdf5-sys-17b7a3d8adc43b30/build-script-build` (exit code: 101)
--- stdout
Attempting to find HDF5 via pkg-config...
Found HDF5 headers at:
"/usr/include"
Adding to link path:
"/usr/lib/x86_64-linux-gnu"
Parsing HDF5 config from:
"/usr/include/H5pubconf.h"
--- stderr
thread 'main' panicked at 'Unable to infer HDF5 library runtime version.', libhdf5-sys/build.rs:144:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
And
|
@Enet4 Great, thanks. I think the proper course of action on Linux would be then to search for |
19b40fe
to
f8dd24c
Compare
@Enet4 the build script now looks for |
I'm afraid that it did not quite do the trick yet:
At this point it might be worth understanding why the
It seems that this package configuration does not specify any link paths. Not that it should be a problem, considering that the shared objects are installed in the default system's lib directory. |
The question is why no paths are added, seems like regex is not parsing anything successfully on your box from At this point I’d either need to install an arch virtual machine somewhere, or setup arch via docker on travis or something like that, either of which may take considerable time... so any help is greatly appreciated. |
Well, that’s exactly what we’re trying to do here with parsing |
@Enet4 wonder if you could upload the output of your local |
@Enet4 gotcha -- here's another attempt, maybe that would finally work?.. (why would ld report paths as "=/usr/lib" on debian and as "/usr/lib" on arch?... that's a different question altogether...) |
Yes, this one built successfully now! All tests (except the ones from hdf5-derive) also pass. |
Use extern crate to force linkage
HDF5_DIR
andHDF5_VERSION
.H5pubconf.h
(autogenerated header) viabindgen
, extracting the library version and several preprocessor definitions out of it to be used later.hbool_t
is now defined conditionally).h5_have_parallel
,h5_have_threadsafe
andh5_have_direct
are exposed for downstream use.libloading
and verifies its version (we would probably still have to do this even if linking is static).libhdf5-lib
crate is removed entirely, its contents are merged intolibhdf5-sys
.pkg-config
now only runs on Linux.brew --prefix
on macOS; this supports both @1.8 and @1.10 bottles.winreg
) for official installations.Expand the CI test suite greatly (in particular, link against conda on all platforms along with other methods like apt, brew and official installers; build both HDF5 1.8 and HDF5 1.10 on all platforms):