-
Notifications
You must be signed in to change notification settings - Fork 334
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
C++ SDK #2516
Comments
Part of #2516 ### What This PR introduces the seeds of the C and C++ SDK. It's all a hack right now, and only tested on Mac, but I'd rather merge many small PRs than build this in isolation over a long time. A new crate `rerun_c` is introduced, which implements the C SDK (over FFI). The C SDK consists of a single header, `rerun.h`, with no dependencies except on `rerun_c`. The C++ SDK consists of a single header, `rerun.hpp`, which depends on: * Arrow C++ * `rerun.h` (the C SDK) * `rerun_c` (the Rust crate) The C SDK can create recording streams and log data to them using the arrow IPC format. The C++ SDK adds a few helper function for generating some test data and converting it to the Arrow IPC format. ### Testing it * Install CMake * Start rerun with `cargo rerun` * Run `crates/rerun_c/example_cpp/build_and_run.sh` You should see three points in a 3D space view. Those points come from C++! ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2594) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2594) - [Docs preview](https://rerun.io/preview/pr%3Aemilk%2Fc-sdk/docs) - [Examples preview](https://rerun.io/preview/pr%3Aemilk%2Fc-sdk/examples) --------- Co-authored-by: Clement Rey <[email protected]>
Part of #2516 ### What A few small steps towards a C++ SDK. * Creates `rerun_cpp` top-level folder. The C SDK remains in `crates/rerun_c`. * The new folder has a tree of `CMakeLists.txt`. * The source code is now split in several .hpp and .cpp * There is now a C++ class for RecordingStream ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2624) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2624) - [Docs preview](https://rerun.io/preview/pr%3Aemilk%2Fcpp-sdk/docs) - [Examples preview](https://rerun.io/preview/pr%3Aemilk%2Fcpp-sdk/examples) --------- Co-authored-by: Clement Rey <[email protected]>
Discussed today in the standup the many perils of shipping C++ binaries. Since we depend on Arrow C++ SDK right now, any source distribution would enforce C++17. We came up with various solutions (use Arrow C library, build out C SDK and forward to that, isolate Arrow code behind a C interface, etc. etc.) but concluded that this is very low priority for us right now: It seems that all known early adopters are (while reportedly not using C++17) are on compiler versions that supports C++17. So as long as our interface isn't C++17 requiring, our implementations can despite shipping as source. |
…t APIs & introduce C++ SDK tests (#2890) * Part of #2516 (SDK! Not codegen! :)) * Next in the cpp series after #2874 ### What Adds a test dependency to the [Catch2](https://github.com/catchorg/Catch2/) testing framework in order to start testing all the new RecordingStream features added here. C++ tests can be conveniently run via `./rerun_cpp/build_and_run_tests.sh` now! For quick api overview start with the `rerun.h` and `recording_stream.h` headers. Fixes a range of compiler warnings as a consequence of improving some of the CMake setup, more to do there! Adds lots more documentation to RecordingStream as well. Next steps: * Add C++ to ci (linting, running this test suite) * Add roundtrip tests * Add codegen custom code injection * Improve API usability in varous places, including * #2873 * add other tests * serialize unions * serialize datatypes nested in unions, structs and lists * more testing & roundtripping ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2890) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2890) - [Docs preview](https://rerun.io/preview/pr%3Aandreas%2Fcpp-api%2Fbetter-recording-stream/docs) - [Examples preview](https://rerun.io/preview/pr%3Aandreas%2Fcpp-api%2Fbetter-recording-stream/examples)
Superseded by |
This is the tracking issue for our initial high-level C++ SDK
Goals
Non-goals
We will save this for later.
Approach
Low-level C SDK
We wrap our Rust SDK with a minimal set of functions for:
init
connect
,save
log
aDataRow
The Rust side is responsible for:
Low-level C++ SDK
Basically a C++-friendly wrapper around the C SDK
Code-generated classes
We use
re_types
(#2241) to generate classes for datatypes, components, and archetypes.These are converted to Arrow-messages using the official Arrow C++ SDK.
Integrations
Finally, we have opt-in integrations with various libraries such as:
Distribution
The C SDK will consist of a single
rerun.h
header, and then a dynamic and/or static library of thererun_c
crate.The C++ SDK will have a CMakelists.txt for ease of use in cmake build systems. We can maybe set up a system where cmake downloads and install the Rerun C++ SDK for users, including dependencies (Arrow).
TODO
The text was updated successfully, but these errors were encountered: