Build on modern macOS (Apple Silicon) + Metal depth backend#1
Conversation
Brings libfreenect2 up to date so it configures, builds, and runs on a current Apple Silicon Mac (CMake 4.x, Xcode 26, Apple clang 21), while preserving Linux/CUDA compatibility. Combines fixes from upstream PRs OpenKinect#1158, OpenKinect#1189, OpenKinect#1208, OpenKinect#1209, OpenKinect#1210. - CMake: raise CMAKE_MINIMUM_REQUIRED 2.8.12.1 -> 3.5 (CMake >= 4.0 removes compatibility with < 3.5). (OpenKinect#1209) - OpenCL: guard the local CL_ICDL_VERSION against redefinition by recent OpenCL headers (cl_ext.h >= 3.0.16). (OpenKinect#1189) - VideoToolbox: add ENABLE_VIDEOTOOLBOX option; default OFF on arm64 to avoid the VTRgbPacketProcessor heap-corruption crash on Apple Silicon, falling back to TurboJPEG. Stays ON for Intel Macs. (OpenKinect#1208) - Metal: add a Metal GPU depth packet processor backend for Apple platforms, selectable as the "metal" pipeline. (OpenKinect#1210) - Protonect: accept "metal" as a pipeline argument. - Build the metallib into the library output dir so the runtime loader finds it next to libfreenect2.dylib in both the build tree and install. - streamer_recorder: use cv::IMWRITE_JPEG_QUALITY and build as C++14 for modern OpenCV. (OpenKinect#1158) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (15)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Updates libfreenect2 so it configures, builds, and runs on a current Apple Silicon Mac (CMake 4.x, Xcode 26, Apple clang 21), while preserving Linux/CUDA compatibility. Every macOS-specific change is gated behind
IF(APPLE)/#ifdef LIBFREENECT2_WITH_METAL_SUPPORT.Combines the useful pieces of upstream PRs OpenKinect#1158, OpenKinect#1189, OpenKinect#1208, OpenKinect#1209, OpenKinect#1210.
Changes
CMAKE_MINIMUM_REQUIRED2.8.12.1 → 3.5 (3 files)<3.5— the hard configure blockerCL_ICDL_VERSIONredefinition#if !definedformENABLE_VIDEOTOOLBOXoptionVTRgbPacketProcessorheap-corruption crash on Apple Silicon (falls back to TurboJPEG); stays ON for Intel Macsmetalpipeline for Apple platformscv::IMWRITE_JPEG_QUALITY+ C++14 (tool remains OFF by default)Additional glue beyond the source PRs:
metalas a pipeline argument (the factory was wired but the example parser was not).default.metallibis emitted into the library output dir so the runtime loader finds it besidelibfreenect2.dylibin both the build tree and aftermake install.Verification (Apple M2 Pro, macOS 26.5, Xcode 26, CMake 4.3.4)
make installplacesdefault.metallibbeside the dylib.Not exercised: a live frame (no Kinect connected). The Metal backend (from OpenKinect#1210) compiles and initializes correctly but its depth-decode output has not been validated against real hardware.
🤖 Generated with Claude Code
Summary by cubic
Modernized macOS build for Apple Silicon and added a
Metaldepth pipeline, while keeping Linux/CUDA builds intact. Installsdefault.metallibnext tolibfreenect2.dyliband defaults toTurboJPEGon arm64 for stability.New Features
MetalGPU depth packet processor (MetalPacketPipeline), selectable via "metal".Protonectnow accepts "metal";default.metallibis built and installed besidelibfreenect2.dylib.ENABLE_METALCMake option (ON on Apple).Migration
CMake≥ 3.5.ENABLE_VIDEOTOOLBOXdefaults OFF to avoid a crash; RGB decoding usesTurboJPEGunless explicitly enabled.streamer_recorderbuilds as C++14 and usescv::IMWRITE_JPEG_QUALITY.Written for commit 5b50c2c. Summary will update on new commits.