-
Notifications
You must be signed in to change notification settings - Fork 429
Modify tensorflow-sys/src/lib.rs to be bindgen generated #67
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
Version of bindgen used: 0.22.1 Command used: bindgen --blacklist-type max_align_t /usr/include/tensorflow/c_api.h > src/bindgen.rs
Note that the enums values are rexported (`pub use TF_[...]::*`)
See discussions about libc: * rust-lang/rust#31536 * rust-lang/libc#180 * rust-lang/libc#547
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
…ead of using `libc::c_void`
The CI failure is due to tensorflow failing to build and not this MR.
See similar issues in the main tensorflow repository:
MR #65 could aleviate this problem by using a pre-built binary for tensoflow. This would help a lot! |
Could you add a script for running bindgen? |
Thanks! |
I think this is a great middle ground between hand-generating the API and forcing couple of compile time dependencies on the user :) |
This MR gets rid of the hand-written
tensorflow-sys/src/lib.rs
file, and replaces it with two files:tensorflow-sys/src/bindgen.rs
is the result ofbindgen --blacklist-type max_align_t /usr/include/tensorflow/c_api.h > tensorflow-sys/src/bindgen.rs
;tensorflow-sys/src/lib.rs
simplyinclude!()
the generated wrapper, adding some#![allow(...)]
and re-exporting the enum values.I've added the option
--blacklist-type max_align_t
to bindgen so that the automatically generated unit tests don't fail:See rust-lang/rust-bindgen#550 for the bindgen issue about this unit test.
Should close issue #57.