-
Notifications
You must be signed in to change notification settings - Fork 158
Description
Describe Issue
A cmake v3_develop branch snapshot was found to build OK on a Raspberry Pi OS (Debian) RPi5 when using mkdir build && cd build followed by cmake -S .. -B .. However, the same snapshot failed to build with a current macOS 15.4.1 / Xcode 16.3 / Apple clang version 17.0.0 (clang-1700.0.13.3) toolchain.
Steps were then taken to achieve a successful macOS 15.4.1 build. The steps for a successful build are outlined in the Additional Context section. Also, the successfully built snapshot is provided on the v3_develop_macos15 branch of the marc-medley/depthai-core fork.
Minimal Reproducible Example
Configuration:
Use a macOS with an up-to-date toolchain. In this case, a macOS 15.4.1 / Xcode 16.3 / Apple clang version 17.0.0 (clang-1700.0.13.3) toolchain was used.
xcrun --sdk macosx --show-sdk-path
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk
xcrun --sdk macosx --show-sdk-version
# 15.4Steps:
brew uninstall clang-format
brew install opencv pcl
git clone --single-branch \
--branch v3_develop \
--recurse-submodules \
[email protected]:luxonis/depthai-core.git \
depthai_v3_develop
cd depthai_v3_develop
mkdir build && cd build
cmake -S .. -B . \
-D'CMAKE_POLICY_VERSION_MINIMUM=3.5'
NUM_CORES=$(sysctl -n hw.ncpu) # optional
cmake --build . --parallel $NUM_CORESAfter the blocking "Running vcpkg install - failed" and xtensor+xtl build issues were resolved, then the building of the cpp examples was checked.
cd path/to/depthai_v3_develop
rm -rf build
mkdir build && cd build
cmake -S .. -B . \
-D'CMAKE_POLICY_VERSION_MINIMUM=3.5' \
-D'DEPTHAI_BUILD_EXAMPLES=ON'
cmake --build . --parallel $NUM_CORESResult:
- "Running vcpkg install - failed" when using
cmake -S . -B build xtensor,xtlfailures blocked the build- some cpp examples failed to build
- 1,628 warnings due to a SDK major version mismatch
- ClangFormat warnings
Expected behavior
Primary expectation:
- A successful
depthai-corev3.x.y-beta-like build on an up-to-date macOS toolchain.
Secondary exectation:
- The depthai-core/v3_develop/README.md instructions would be sufficient and work.
- The README.md macOS prerequisites would include
brew install clang-format - The README.md would perhaps show
mkdir build && cd buildfollowed bycmake -S .. -B .until thecmake -S . -B build"Running vcpkg install - failed" issue gets sorted out.
- The README.md macOS prerequisites would include
Attach System Log
Additional Context
Running vcpkg install - failed
The first blocking issue was a "Running vcpkg install - failed" fatal errror. This is reported separately as [BUG/v3_develop] Running vcpkg install - failed #1334
xtensor, xtl
The code build issues with xtensor v0.25.0, xtl v0.7.6 were resolved by updating to the xtensor v0.26.0, xtl v0.8.0 releases.
Note: xtensor v0.25.0, xtl v0.7.6 are available through homebrew.
brew info xtensor
# ==> xtensor: stable 0.26.0 (bottled)
# Multi-dimensional arrays with broadcasting and lazy computing
# https://xtensor.readthedocs.io/en/latest/
# ==> Dependencies
# Build: cmake ✔
# Required: xtl ✔
brew info xtl
# ==> xtl: stable 0.8.0 (bottled)
# X template library
# https://github.com/xtensor-stack/xtl
# ==> Dependencies
# Build: cmake ✔, pkgconf ✔
# Required: nlohmann-json ✔
brew install xtensorRerun Examples
Two cpp examples (RGBD, RVC2/VSLAM) failed to build because the Apache Arrow dependency of rerun-io/rerun 0.16.1 [2024.05.29] failed to build.
A quick check of using the current release rerun-io/rerun 0.23.2 [2025.05.06] also did not build. So, these two examples were just commented out instead of putting more effort into the examples at this time.
MACOS_SDK_MAJOR_VERSION
There were 1,628 warnings related to a SDK major version mismatch.
ld: warning: object file (…/build/_deps/….cpp.o))
was built for newer 'macOS' version (15.0) than being linked (11.0)
The warnings were resolved by adding some automatic MACOS_SDK_MAJOR_VERSION detection.
ClangFormat
There were about 70 ClangFormat not available messages which were resolved with brew install clang-format.
-- ClangFormat: clang-format not found! Target 'clangformat' not available...
The ClangFormat messages were resolved with a brew install:
brew install clang-formatNote: It would be helpful to have
brew install clang-formatadded to the depthai-core/v3_develop/README.md
CMake Versions
- cmake version 3.31.7 also built OK without requiring
-D'CMAKE_POLICY_VERSION_MINIMUM=3.5'. - cmake 4.0.2 successfully builds the marc-medley/depthai-core/v3_develop_macos15 snapshot provided
-D'CMAKE_POLICY_VERSION_MINIMUM=3.5'is used.