feat: CMake integration for vortex-ffi & vortex-cpp - #9774
Conversation
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Reduce RustToolchain.cmake to one function that finds Cargo and rustc, reads the rustc host and release, captures RUSTUP_TOOLCHAIN, and forwards the Apple SDK and deployment target. The rustc host selects the Rust target directly; SystemDependencies.cmake already rejects unsupported targets, and Cargo enforces the workspace rust-version. Replace the concrete-binary pinning by forwarding the configure-time RUSTUP_TOOLCHAIN to every Cargo build. Default the macOS deployment target to rustc's 11.0 minimum so the cc crate does not compile for the SDK version, which ld64 reports as newer than CMake's link target. Remove the compiler triple validation, platform cross-checks, SDK name resolution, and version minimums, along with the CMake test harness that only exercised them. Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Reduce RustToolchain.cmake to tool discovery, the rustc host, the RUSTUP_TOOLCHAIN capture, and the macOS deployment target. Drop the nightly pre-check, since rustc rejects the nightly-only flags itself, and stop forwarding CMAKE_OSX_SYSROOT and CMAKE_<LANG>_COMPILER_TARGET, which only matter for cross builds. Pass the Rust, C, and C++ flags to CargoBuild.cmake as -D lists instead of support files, and encode them where the Cargo environment is built. CMake strips enclosing single quotes from -D values, so the shell-quoted strings could not cross that boundary intact. Remove the compiler wrapper for CMAKE_<LANG>_COMPILER_ARG1 and the no-op --no-default-features. Default standalone builds to Debug when no build type is given, and map an empty build type to Cargo's dev profile without a warning. Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Call project() unconditionally and use PROJECT_IS_TOP_LEVEL for the standalone defaults, which removes the embedded language detection and the helper path variables. Drop the toolchain-file configure dependency, since configure no longer reads anything it changes, and glob the wrapper sources like the tests do. Group the file into commented sections and explain why Catch2 is built as C++17: its compiled sources gate std::string_view, optional, variant, and byte support on that standard, and the C++23 tests include its headers. Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Move the Cargo integration modules from lang/cpp/cmake to vortex-ffi/cmake and make vortex-ffi/CMakeLists.txt own the Cargo build, exporting Vortex::ffi_static as a global imported target. lang/cpp consumes that target, adding vortex-ffi itself when nothing else has, and a root CMakeLists.txt adds both so consumers can link Vortex::ffi_static from C or Vortex::cpp_static from C++ after one add_subdirectory(). Port the C tests and examples to the static target, prefix example target names on both sides so a combined build has no clashes, and fix scan.c, which used pthread_t as a thread count and never compiled on macOS. Drive the two FFI CI jobs through CMake instead of a manual Cargo step, default sanitizer builds to rustup's nightly toolchain unless RUSTUP_TOOLCHAIN is set, and drop the no-op --no-default-features from the Rust sanitizer tests and docs. Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Restore CMAKE_EXPORT_COMPILE_COMMANDS, which the consolidated entry points had dropped, for configures where a Vortex directory is the top level so editor tooling keeps working. Embedded builds leave the parent's setting alone. Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Take a comma- or semicolon-separated list of asan, lsan, ubsan, and tsan instead of two fixed bundles, and map each entry to its native and Rust names. UBSan has no Rust counterpart, so a native-only selection needs no nightly toolchain and none is defaulted. CI asks for asan,lsan,ubsan explicitly to keep the coverage the asan bundle used to imply. Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Drop the stray blank line and odd alignment in tests/CMakeLists.txt. Make gcov-report.sh run from its own directory, rely on the Debug default, use --coverage so the gcov runtime is linked explicitly, anchor the lcov exclude globs to full paths, and accept only `html` as the optional argument as the README documents. Signed-off-by: "Alexander Droste" <alexander.droste@protonmail.com> Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
vortex-ffi & vortex-cppvortex-ffi & vortex-cpp
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
|
This lays the foundation to integrate Vortex into other C++ projects such as cuDF. |
Merging this PR will improve performance by 15.38%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | arrow_checked_add_u32_avx2[16384] |
21.4 µs | 17.6 µs | +21.31% |
| ⚡ | Simulation | allocate_drop_arrow[0] |
456.9 ns | 402.7 ns | +13.45% |
| ⚡ | Simulation | allocate_drop_bytes[0] |
520.2 ns | 466 ns | +11.62% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ad/cmake-rust-integration (4f1a465) with develop (a997c3f)
Footnotes
-
206 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Summary
Make the C and C++ CMake builds self-contained by having CMake build the Rust FFI archive through Cargo instead of requiring a separate
cargo buildand manually locating its output.This adds source-tree CMake targets suitable for vendored downstream projects: