C++ Zenoh Flow Components
Zenoh Flow provides a Zenoh-based dataflow programming framework for computations that span from the cloud to the device.
Requirements
- Rust: see the installation page
- cxxbridge
cargo install cxxbridge-cmd
Building your C++ node
The following commands have been tested Linux and MacOS machines. They are working with the latest version of Zenoh Flow.
-
Building the Source:
mkdir build && cd build cmake .. -DSOURCE=ON make
-
Building the Operator:
mkdir build && cd build cmake .. -DOPERATOR=ON make
-
Building the Sink:
mkdir build && cd build cmake .. -DSINK=ON make
This will:
- generate the rust library that wraps the Zenoh-Flow APIs;
- call
cxxbridge
to generate the bindings needed by Zenoh Flow, in particular the headerinclude/wrapper.hpp
and the sourcesrc/wrapper.cpp
files; - "patch" the header file
include/wrapper.hpp
; - compile the Rust code located under the
vendor/wrapper
folder and generate a static librarylibwrapper.a
; - compile the C++ wrapper code,
- compile the node,
- link everything together producing
build/libcxx_XXX.dylib
(.so
on Linux) — whereXXX
is the kind of node.
The resulting library can then be loaded by Zenoh Flow!
Building the docs.
When calling cmake it is possible to pass the -DBUILD_DOC=ON
parameter, this will instruct CMake to build also the documentation.
The documentation is built leveraging on doxygen
so verify that it is installed on your machine.
The documentation will then accessible in build/doc_doxygen/html/index.html
.
Acknowledgments
We relied on the CXX — safe FFI between Rust and C++ library to generates the bindings.