|
ublk-cpp v0.0
|
How to build and integrate ublk-cpp in your project.
You can add ublk-cpp to your project via Git submodule:
In your CMakeLists.txt:
Alternatively, you can add ublk-cpp with FetchContent:
Condy fetches and statically links liburing by default (CONDY_LINK_LIBURING=ON). To use the liburing installed on your system instead, configure with CONDY_LINK_LIBURING=OFF.
ublk-cpp currently also fetches and depends on stdexec, or beman/execution when enabled via the UBLKCPP_EXECUTION_BACKEND option. Once std::execution is finalized in C++26, this dependency is expected to be replaced by the standard library implementation.
ublk-cpp provides CMake options to build tests, the ublkctl tool, examples, and the Doxygen documentation:
| Option | Description | Default |
|---|---|---|
| UBLKCPP_BUILD_TESTS | Build tests | OFF |
| UBLKCPP_BUILD_UBLKCTL | Build the ublkctl tool | OFF |
| UBLKCPP_BUILD_EXAMPLES | Build examples | OFF |
| UBLKCPP_BUILD_DOCS | Build Doxygen documentation | OFF |
| UBLKCPP_USE_URING_CMD128 | Use IORING_OP_URING_CMD128 for control commands | ON |
| UBLKCPP_TESTS_STATIC_LINK | Use static linking for tests | OFF |
| UBLKCPP_TESTS_ASAN | Enable ASan/UBSan for tests | OFF |
| UBLKCPP_EXECUTION_BACKEND | std::execution implementation used via Condy: stdexec or beman | stdexec |
The examples are ublk block device daemons and need the ublk driver loaded:
ublkctl is a control tool for ublk devices. Run it with a subcommand:
See ublkctl --help for all supported subcommands and options.