jonhoo / rust-ibverbs

Bindings for RDMA ibverbs through rdma-core
Apache License 2.0
143 stars 33 forks source link

Does not seem to support cross-compilation #1

Closed raphaelcohn closed 7 years ago

raphaelcohn commented 7 years ago

I came across your bindings and decided to give them a whirl - I was almost going to create my own!

However, I can't get them to build. I'm using Mac OS X, with a local linux / musl toolchain (installed via brew install filosottile/musl-cross/musl-cross). Its works well, and I used it to cross-build nvml, bearssl, DPDK, libfabric and others... however, the build.rs doesn't seem to respect --target from cargo, and so consequently fails. (I'm not entirely sure that's the case, though).

I realise it's early days for this binding, so it's probably something that's not on the radar yet, and might be something you don't want to cope with.

jonhoo commented 7 years ago

The intention was for this to work on macOS as well, though I don't have a macOS device myself to test on. What kind of errors are you seeing? Maybe the bindgen requirements has something helpful?

raphaelcohn commented 7 years ago

I've done a lot of digging. It seems the underlying build is cmake based, so cross-building is both straightforward to do but unpleasant to make work through cargo. In the time I posted the original comment, I've created my own set of bindings; this isn't intended to compete with yours, but I have a specific use case I need to explore: I want to see how they work with NVML / PMEM (and building my own bindings helps me to learn how to best apply them). I also intend to use rdma-core via Libertine Linux with static-linking (something that is slightly broken in vanilla rdma-core) only in the long run - this is a stripped down in-memory linux for rapid deployment and manageability. I've also generated bindings for the static inline functions in verbs.h using a simple shell script. Feel free to grab ideas - they're MIT licensed. Bindings at https://github.com/lemonrock/rdma-core. I may publish them to cargo, but only as a convenience for my other projects.

For the record, bindgen is pretty awful to work with. To be fair, parsing C source is nightmarish, and some C source does some truly horrible things...