Skip to content

Commit e3d0242

Browse files
committed
Merge branch 'v3_cleanup' into lnotspotl/internal_xlink
2 parents 465ae31 + b823bc9 commit e3d0242

File tree

5 files changed

+79
-59
lines changed

5 files changed

+79
-59
lines changed

.github/workflows/main.workflow.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ jobs:
100100
strategy:
101101
matrix:
102102
os: [macos-latest, windows-latest, ubuntu-latest]
103+
# TODO(Morato) - add back Debug builds to CI
103104
# build-type: [Debug, Release]
104105
build-type: [Release]
105106
# shared: [true, false]
106107
shared: [true]
107108
platform: [x64]
109+
# TODO(Morato) - add back Win32 and shared builds to CI
108110
# include:
109111
# - platform: Win32
110112
# os: windows-latest
@@ -159,7 +161,7 @@ jobs:
159161
with:
160162
name: windows-prebuilt-win64-${{ matrix.build-type }}
161163
path: ${{ env.GITHUB_WORKSPACE }}/depthai_install/
162-
164+
# TODO(Morato) - add back Win32 and shared builds to CI
163165
# - name: Upload Win32 shared library
164166
# if: matrix.os == 'windows-latest' && matrix.shared && matrix.platform == 'Win32'
165167
# uses: actions/upload-artifact@v4

.github/workflows/python-main.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,16 @@ jobs:
5959
sudo apt install libusb-1.0-0-dev pkg-config bison autoconf libtool libxi-dev libxtst-dev libxrandr-dev libx11-dev libxft-dev libxext-dev nasm flex libudev-dev automake libltdl-dev
6060
python -m pip install -r bindings/python/docs/requirements_mkdoc.txt
6161
- name: Configure project
62-
run: cmake -S . -B build -DDEPTHAI_VCPKG_INTERNAL_ONLY=OFF -DDEPTHAI_BUILD_PYTHON=ON -DDEPTHAI_PYTHON_FORCE_DOCSTRINGS=ON -DDEPTHAI_BASALT_SUPPORT=ON -DDEPTHAI_PCL_SUPPORT=ON -DDEPTHAI_RTABMAP_SUPPORT=ON -DDEPTHAI_PYTHON_DOCSTRINGS_OUTPUT="$PWD/bindings/python/docstrings/depthai_python_docstring.hpp"
62+
run: |
63+
cmake -S . \
64+
-B build \
65+
-DDEPTHAI_VCPKG_INTERNAL_ONLY=OFF \
66+
-DDEPTHAI_BUILD_PYTHON=ON \
67+
-DDEPTHAI_PYTHON_FORCE_DOCSTRINGS=ON \
68+
-DDEPTHAI_BASALT_SUPPORT=ON \
69+
-DDEPTHAI_PCL_SUPPORT=ON \
70+
-DDEPTHAI_RTABMAP_SUPPORT=ON \
71+
-DDEPTHAI_PYTHON_DOCSTRINGS_OUTPUT="$PWD/bindings/python/docstrings/depthai_python_docstring.hpp"
6372
- name: Build target 'pybind11_mkdoc'
6473
run: cmake --build build --target pybind11_mkdoc --parallel 4
6574
- name: Print out vcpkg logs if building port fails
@@ -151,8 +160,14 @@ jobs:
151160
152161
- name: Compile
153162
run: |
154-
cmake -S . -B build -DDEPTHAI_VCPKG_INTERNAL_ONLY=OFF -DDEPTHAI_BUILD_PYTHON=ON -D CMAKE_BUILD_TYPE=Release -D DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp -D DEPTHAI_PYTHON_ENABLE_TESTS=ON
155-
cmake --build build --parallel 4
163+
cmake -S . \
164+
-B build \
165+
-DDEPTHAI_VCPKG_INTERNAL_ONLY=OFF \
166+
-DDEPTHAI_BUILD_PYTHON=ON \
167+
-D CMAKE_BUILD_TYPE=Release \
168+
-D DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp \
169+
-D DEPTHAI_PYTHON_ENABLE_TESTS=ON
170+
cmake --build build --parallel 4
156171
- name: Print out vcpkg logs if building port fails
157172
if: failure() # Only run this if the build step fails
158173
run: cd bindings/python && bash ./ci/show_vcpkg_logs.sh

cmake/depthaiDependencies.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ if(DEPTHAI_BUILD_TESTS)
162162
endif()
163163

164164
# XLink
165+
# Always compile XLink as static library, even when DepthAI is built as shared
165166
set(_BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
166167
set(BUILD_SHARED_LIBS OFF)
167168
set(XLINK_ENABLE_LIBUSB ${DEPTHAI_ENABLE_LIBUSB} CACHE BOOL "Enable libusb" FORCE)

cmake/depthaiOptions.cmake

Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
1+
# ==================================
2+
# DepthAI Build Options (organized)
3+
# ==================================
4+
5+
# ---------- Platform‑based defaults ----------
6+
7+
# Detect 32‑bit Linux for default CURL support
8+
if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND UNIX)
9+
set(DEPTHAI_DEFAULT_CURL_SUPPORT OFF)
10+
else()
11+
set(DEPTHAI_DEFAULT_CURL_SUPPORT ON)
12+
endif()
13+
14+
# ---------- Core Feature Toggles (private) -------------
115
option(DEPTHAI_ENABLE_LIBUSB "Enable usage of libusb and interaction with USB devices" ON)
216
option(DEPTHAI_ENABLE_APRIL_TAG "Enable AprilTag node (not available for Windows)" ON)
3-
option(DEPTHAI_RTABMAP_SUPPORT "Enable optional RTABMap support" OFF)
4-
option(DEPTHAI_BASALT_SUPPORT "Enable optional Basalt support" OFF)
517
option(DEPTHAI_ENABLE_PROTOBUF "Enable Protobuf support" ON)
6-
option(DEPTHAI_BUILD_PYTHON "Build python bindings" OFF)
7-
option(DEPTHAI_BUILD_TESTS "Build tests" OFF)
18+
option(DEPTHAI_ENABLE_CURL "Enable CURL support" ${DEPTHAI_DEFAULT_CURL_SUPPORT})
19+
option(DEPTHAI_ENABLE_KOMPUTE "Enable Kompute support" OFF)
20+
option(DEPTHAI_ENABLE_MP4V2 "Enable video recording using the MP4V2 library" ON)
21+
22+
# ---------- Optional Features (public) -------------
823
option(DEPTHAI_OPENCV_SUPPORT "Enable optional OpenCV support" ON)
9-
OPTION(DEPTHAI_ENABLE_KOMPUTE "Enable Kompute support" OFF)
24+
option(DEPTHAI_XTENSOR_SUPPORT "Enable optional xtensor support" ON)
1025
option(DEPTHAI_PCL_SUPPORT "Enable optional PCL support" OFF)
26+
27+
option(DEPTHAI_RTABMAP_SUPPORT "Enable optional RTABMap support" OFF)
28+
option(DEPTHAI_BASALT_SUPPORT "Enable optional Basalt support" OFF)
29+
30+
# Build Behaviour
1131
option(DEPTHAI_MERGED_TARGET "Enable merged target build" ON)
12-
option(DEPTHAI_NEW_FIND_PYTHON "Use new FindPython module" ON)
32+
option(DEPTHAI_BUILD_PYTHON "Build python bindings" OFF)
33+
option(DEPTHAI_BUILD_TESTS "Build tests" OFF)
34+
option(DEPTHAI_BUILD_EXAMPLES "Build examples - Requires OpenCV library to be installed" OFF)
35+
option(DEPTHAI_BUILD_DOCS "Build documentation - requires doxygen to be installed" OFF)
1336
option(DEPTHAI_BUILD_ZOO_HELPER "Build the Zoo helper" OFF)
14-
option(DEPTHAI_ENABLE_MP4V2 "Enable video recording using the MP4V2 library" ON)
15-
option(DEPTHAI_XTENSOR_SUPPORT "Enable optional xtensor support" ON)
37+
option(DEPTHAI_NEW_FIND_PYTHON "Use new FindPython module" ON)
38+
option(DEPTHAI_INSTALL "Enable install target for depthai-core targets" ON)
1639

17-
#VCPKG related options
40+
# ---------- Dependency Management -------------
1841
option(DEPTHAI_BOOTSTRAP_VCPKG "Automatically bootstrap VCPKG" ON)
19-
# DepthAI uses VCPKG internally, to fetch its private dependencies, but not for the public interface dependencies by default
20-
# (OpenCV, PCL, etc.)
21-
# This is to avoid conflicts with the system installed libraries when downstream libraries use DepthAI.
22-
option(DEPTHAI_VCPKG_INTERNAL_ONLY "Use VCPKG internally, but not for libraries on the interface" ON)
42+
option(DEPTHAI_VCPKG_INTERNAL_ONLY "Use VCPKG internally, but not for interface libraries" ON)
43+
2344
set(USE_EXTERNAL_INTERFACE_LIBS_DEFAULT ON)
2445
if(DEPTHAI_VCPKG_INTERNAL_ONLY)
2546
set(USE_EXTERNAL_INTERFACE_LIBS_DEFAULT OFF)
@@ -29,34 +50,29 @@ option(DEPTHAI_JSON_EXTERNAL "Use external nlohmann_json library" ${USE_EXTERNAL
2950
option(DEPTHAI_LIBNOP_EXTERNAL "Use external libnop library" ${USE_EXTERNAL_INTERFACE_LIBS_DEFAULT})
3051
option(DEPTHAI_XTENSOR_EXTERNAL "Use external xtensor library" ${USE_EXTERNAL_INTERFACE_LIBS_DEFAULT})
3152

32-
if(NOT DEPTHAI_OPENCV_SUPPORT)
33-
set(DEPTHAI_MERGED_TARGET OFF CACHE BOOL "Enable merged target build" FORCE)
34-
endif()
53+
# ---------- Platform / Compiler Tweaks ---------
3554

55+
# AprilTag node support
3656
set(DEPTHAI_HAS_APRIL_TAG ${DEPTHAI_ENABLE_APRIL_TAG})
3757
if(WIN32)
3858
message(STATUS "AprilTag node is not supported on Windows")
3959
set(DEPTHAI_HAS_APRIL_TAG OFF)
4060
endif()
4161

42-
# Enable backward stack printing on crash
62+
# Disable merged target when OpenCV is disabled
63+
if(NOT DEPTHAI_OPENCV_SUPPORT)
64+
set(DEPTHAI_MERGED_TARGET OFF CACHE BOOL "Enable merged target build" FORCE)
65+
endif()
66+
67+
# Backward stacktrace printing
4368
if(ANDROID OR EMSCRIPTEN)
4469
# Backward not supported currently on Android
4570
set(DEPTHAI_ENABLE_BACKWARD OFF CACHE BOOL "" FORCE)
4671
else()
4772
option(DEPTHAI_ENABLE_BACKWARD "Enable stacktrace printing on crash using Backward" ON)
4873
endif()
4974

50-
# Check if on 32 bit linux - default without CURL support
51-
if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND UNIX)
52-
set(DEPTHAI_DEFAULT_CURL_SUPPORT OFF)
53-
else()
54-
set(DEPTHAI_DEFAULT_CURL_SUPPORT ON)
55-
endif()
56-
57-
option(DEPTHAI_ENABLE_CURL "Enable CURL support" ${DEPTHAI_DEFAULT_CURL_SUPPORT})
58-
59-
75+
# ---------- Remote connection options
6076
if(DEPTHAI_ENABLE_PROTOBUF)
6177
option(DEPTHAI_ENABLE_REMOTE_CONNECTION "Enable Remote Connection support" ON)
6278
if(DEPTHAI_ENABLE_CURL AND DEPTHAI_HAVE_OPENCV_SUPPORT)
@@ -70,34 +86,24 @@ else()
7086
message(STATUS "Remote Connection support disabled because Protobuf support is disabled.")
7187
endif()
7288

73-
# Additional options
74-
option(DEPTHAI_CLANG_FORMAT "Enable clang-format target" ON)
75-
option(DEPTHAI_CLANG_TIDY "Enable clang-tidy checks during compilation" OFF)
76-
option(DEPTHAI_SANITIZE "Enable Address and Undefined sanitizers for library, examples and tests" OFF)
77-
78-
# Should install depthai core libraries
79-
option(DEPTHAI_INSTALL "Enable install target for depthai-core targets" ON)
80-
81-
82-
# Debug option
83-
set(DEPTHAI_XLINK_LOCAL "" CACHE STRING "Path to local XLink source to use instead of Hunter")
84-
set(DEPTHAI_BOOTLOADER_SHARED_LOCAL "" CACHE STRING "Path to local depthai-bootloader-shared source to use instead of submodule")
85-
86-
87-
# First specify options
88-
option(DEPTHAI_BUILD_EXAMPLES "Build examples - Requires OpenCV library to be installed" OFF)
89-
option(DEPTHAI_BUILD_DOCS "Build documentation - requires doxygen to be installed" OFF)
90-
91-
# Specify support for FW
92-
option(DEPTHAI_ENABLE_DEVICE_FW "Enable MyriadX Device FW" ON)
93-
option(DEPTHAI_ENABLE_DEVICE_BOOTLOADER_FW "Enable MyriadX Device Bootloader FW" ON)
94-
option(DEPTHAI_ENABLE_DEVICE_RVC3_FW "Enable RVC3 Device FW" OFF)
95-
option(DEPTHAI_ENABLE_DEVICE_RVC4_FW "Enable RVC4 Device FW" ON)
96-
9789
if(DEPTHAI_ENABLE_REMOTE_CONNECTION)
9890
option(DEPTHAI_EMBED_FRONTEND "Embed frontend resources into library" ON)
9991
else()
10092
option(DEPTHAI_EMBED_FRONTEND "Embed frontend resources into library" OFF)
10193
endif()
10294

95+
# ---------- Embedded firmware ---------------------------
96+
option(DEPTHAI_ENABLE_DEVICE_FW "Enable MyriadX Device FW" ON)
97+
option(DEPTHAI_ENABLE_DEVICE_BOOTLOADER_FW "Enable MyriadX Device Bootloader FW" ON)
98+
option(DEPTHAI_ENABLE_DEVICE_RVC3_FW "Enable RVC3 Device FW" OFF)
99+
option(DEPTHAI_ENABLE_DEVICE_RVC4_FW "Enable RVC4 Device FW" ON)
103100
option(DEPTHAI_BINARIES_RESOURCE_COMPILE "Compile Depthai device side binaries into library" ON)
101+
102+
# ---------- Development Aids -------------------
103+
option(DEPTHAI_CLANG_FORMAT "Enable clang-format target" ON)
104+
option(DEPTHAI_CLANG_TIDY "Enable clang-tidy checks during compilation" OFF)
105+
option(DEPTHAI_SANITIZE "Enable Address and Undefined sanitizers for library, examples and tests" OFF)
106+
107+
# Local override paths
108+
set(DEPTHAI_XLINK_LOCAL "" CACHE STRING "Path to local XLink source to use instead of Hunter")
109+
set(DEPTHAI_BOOTLOADER_SHARED_LOCAL "" CACHE STRING "Path to local depthai-bootloader-shared source to use instead of submodule")

tests/src/ondevice_tests/openvino_blob_test.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@ void checkBlob(dai::OpenVINO::Blob& blob) {
1515
for(const auto& in : blob.networkInputs) {
1616
std::string name = in.first;
1717
auto tensor = in.second;
18-
// printf("'%s - dims: %d - order: %04x - type: %d' ", name.c_str(), tensor.numDimensions, tensor.order, tensor.dataType);
1918
}
2019
for(const auto& out : blob.networkOutputs) {
2120
std::string name = out.first;
2221
auto tensor = out.second;
23-
// printf("'%s - dims: %d - order: %04x - type: %d' ", name.c_str(), tensor.numDimensions, tensor.order, tensor.dataType);
2422
}
25-
// printf("(%u %u %u %u)\n", blob.stageCount, blob.numShaves, blob.numSlices, blob.version);
2623

2724
REQUIRE(blob.networkInputs.size() == 1);
2825
REQUIRE(blob.networkInputs.at("0").numDimensions == 4);
2926
REQUIRE(blob.networkInputs.at("0").order == dai::TensorInfo::StorageOrder::NCHW);
30-
// REQUIRE(blob.networkInputs.at("0").dataType == dai::TensorInfo::DataType::U8F);
3127

3228
REQUIRE(blob.networkOutputs.size() == 1);
3329
REQUIRE(blob.networkOutputs.at("14").numDimensions == 4);

0 commit comments

Comments
 (0)