- C++ application teams building
bindings/cppwith CMake - Maintainers evolving Fluss C++ dependency provisioning
- Build system covered by this document: CMake
- Dependency modes covered by this document: system/build
Current tested baselines:
protoc:3.25.5arrow-cpp:19.0.1
Notes:
- CMake currently warns (does not fail) when local
protoc/Arrow versions differ from the baselines. protocis required because Rustprost-buildruns during the C++ build.
- Rust toolchain (
cargoinPATH, or setCARGO=/path/to/cargo) protocinPATH(required forsystemmode;buildmode can auto-download viabindings/cpp/scripts/ensure_protoc.sh)- C++17 compiler
- CMake 3.22+
Examples below use bindings/cpp as the source directory.
Use this mode when the environment already provides Arrow C++.
cmake -S bindings/cpp -B /tmp/fluss-cpp-cmake-system \
-DFLUSS_CPP_DEP_MODE=system \
-DFLUSS_CPP_ARROW_SYSTEM_ROOT=/path/to/arrow/prefixTypical prefixes:
- Ubuntu package install:
/usr - Custom install prefix:
/usr/localor/opt/arrow
cmake --build /tmp/fluss-cpp-cmake-system --target fluss_cpp -jUse this mode when Arrow C++ is not preinstalled and CMake should fetch/build it.
PROTOC_BIN="$(bash bindings/cpp/scripts/ensure_protoc.sh --print-path)"
export PATH="$(dirname "$PROTOC_BIN"):$PATH"Then configure:
cmake -S bindings/cpp -B /tmp/fluss-cpp-cmake-build \
-DFLUSS_CPP_DEP_MODE=buildOptional overrides:
-DFLUSS_CPP_ARROW_VERSION=19.0.1-DFLUSS_CPP_ARROW_SOURCE_URL=...(internal mirror or pinned archive)-DFLUSS_CPP_PROTOBUF_VERSION=3.25.5(baseline warning only)
If your environment needs a proxy for CMake/FetchContent downloads, export standard proxy vars before configure/build:
export http_proxy=http://host:port
export https_proxy=http://host:port
export HTTP_PROXY="$http_proxy"
export HTTPS_PROXY="$https_proxy"cmake --build /tmp/fluss-cpp-cmake-build --target fluss_cpp -jThis mode is slower on first build because it compiles Arrow C++ from source.
PROTOC_BIN="$(bash bindings/cpp/scripts/ensure_protoc.sh --print-path)"
export PATH="$(dirname "$PROTOC_BIN"):$PATH"
cmake -S bindings/cpp -B /tmp/fluss-cpp-cmake-system \
-DFLUSS_CPP_DEP_MODE=system \
-DFLUSS_CPP_ARROW_SYSTEM_ROOT=/tmp/fluss-system-arrow-19.0.1
cmake --build /tmp/fluss-cpp-cmake-system --target fluss_cpp -jPROTOC_BIN="$(bash bindings/cpp/scripts/ensure_protoc.sh --print-path)"
export PATH="$(dirname "$PROTOC_BIN"):$PATH"
cmake -S bindings/cpp -B /tmp/fluss-cpp-cmake-build \
-DFLUSS_CPP_DEP_MODE=build
cmake --build /tmp/fluss-cpp-cmake-build --target fluss_cpp -jcargo not found- Install Rust toolchain or set
CARGO=/path/to/cargo.
- Install Rust toolchain or set
protoc not found- Install
protocand ensure it is inPATH. - For
buildmode, usebindings/cpp/scripts/ensure_protoc.shand prepend the returned path toPATH.
- Install
arrow/c/bridge.hnot found (build mode)- Reconfigure after updating to the latest
bindings/cpp/CMakeLists.txt; build mode now adds Arrow source/build include dirs explicitly.
- Reconfigure after updating to the latest
- Long first build in
buildmode- Expected. Arrow C++ source build dominates wall time.