Hello,
I am not sure whether it is a better question for Yocto or Luxonis forums, but I will try here first
I want to backport DepthAi-V3 library version 3.2.2 to run it on Yocto Scarthgap with support of ROS Jazzy. For that, I have implemented my own recipe:
SUMMARY = "Luxonis DepthAI v3"
DESCRIPTION = "DepthAI core is a C++ library which comes with firmware and an API to interact with OAK Platform"
HOMEPAGE = "https://www.luxonis.com/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=39a6484daa66eaf84c7ee9c45e34db02"
inherit cmake pkgconfig cuda
# Replace the meta-ros depthai v2 packagePROVIDES += "depthai"RPROVIDES:${PN} += "depthai"RPROVIDES:${PN}-dev += "depthai-dev"
DEPENDS += "bzip2 \ libarchive \ libeigen \ libusb1 \ lz4 \ nlohmann-json \ opencv \ openssl \ semver \ xtensor \ spdlog \ udev \ xz \ yaml-cpp \ magic-enum \ cpp-httplib \ fp16 \ "PV = "3.2.2-2"
SRC_URI = "git://github.com/luxonis/depthai-core-v3-release.git;protocol=https;branch=release/jazzy/depthai_v3"SRCREV = "4e74c55083e3cb1d9e9c396b000c70f4a730d44d"S = "${WORKDIR}/git"
EXTRA_OECMAKE = "\ -DDEPTHAI_BOOTSTRAP_VCPKG=OFF \ -DDEPTHAI_JSON_EXTERNAL=ON \ -DDEPTHAI_LIBNOP_EXTERNAL=OFF \ -DDEPTHAI_XTENSOR_EXTERNAL=OFF \ -DDEPTHAI_DYNAMIC_CALIBRATION_SUPPORT=OFF \ -DDEPTHAI_BUILD_TESTS=OFF \ -DDEPTHAI_BUILD_EXAMPLES=OFF \ -DDEPTHAI_BUILD_PYTHON=OFF \ -DDEPTHAI_ENABLE_CURL=OFF \ -DDEPTHAI_ENABLE_BACKWARD=OFF \ -DDEPTHAI_ENABLE_KOMPUTE=OFF \ -DDEPTHAI_BASALT_SUPPORT=OFF \ -DDEPTHAI_RTABMAP_SUPPORT=OFF \ -DDEPTHAI_ENABLE_APRIL_TAG=OFF \ -DDEPTHAI_XTENSOR_SUPPORT=OFF \ -DDEPTHAI_ENABLE_PROTOBUF=OFF \ -DDEPTHAI_ENABLE_REMOTE_CONNECTION=OFF \ -DDEPTHAI_ENABLE_EVENTS_MANAGER=OFF \ -DDEPTHAI_EMBED_FRONTEND=OFF \ -DDEPTHAI_ENABLE_MP4V2=OFF \ -DDEPTHAI_PCL_SUPPORT=OFF \ -Dlz4_DIR=${WORKDIR}/cmake-shims/lz4 \ -Dliblzma_DIR=${WORKDIR}/cmake-shims/liblzma \ -DCUDA_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-12.6/bin/nvcc \ -DCUDA_VERSION=12.6 \ -DCUDA_INCLUDE_DIRS=${STAGING_DIR_TARGET}/usr/local/cuda-12.6/include \ -DCUDA_CUDART_LIBRARY=${STAGING_DIR_TARGET}/usr/local/cuda-12.6/lib64/libcudart.so \ -DCUDA_TOOLKIT_ROOT_DIR=${STAGING_DIR_TARGET}/usr/local/cuda-12.6 \"
do_configure:prepend() { mkdir -p ${STAGING_DIR_TARGET}/usr/local/cuda-12.6 echo "CUDA Version 12.6.0" > ${STAGING_DIR_TARGET}/usr/local/cuda-12.6/version.txt # lz4 mkdir -p ${WORKDIR}/cmake-shims/lz4 cat > ${WORKDIR}/cmake-shims/lz4/lz4Config.cmake << EOFif(NOT TARGET lz4::lz4) add_library(lz4::lz4 SHARED IMPORTED) set_target_properties(lz4::lz4 PROPERTIES IMPORTED_LOCATION "${STAGING_LIBDIR}/liblz4.so" INTERFACE_INCLUDE_DIRECTORIES "${STAGING_INCDIR}" )endif()EOF # liblzma mkdir -p ${WORKDIR}/cmake-shims/liblzma cat > ${WORKDIR}/cmake-shims/liblzma/liblzmaConfig.cmake << EOFif(NOT TARGET liblzma::liblzma) add_library(liblzma::liblzma SHARED IMPORTED) set_target_properties(liblzma::liblzma PROPERTIES IMPORTED_LOCATION "${STAGING_LIBDIR}/liblzma.so" INTERFACE_INCLUDE_DIRECTORIES "${STAGING_INCDIR}" )endif()EOF}
to resolve the dependencies from depthaiDependencies.cmake https://shorturl.at/SJRmF
And currently I am adding all the missing dependencies as bitbake recipes (semver, xtl, xtensor, fp16, magic_enum, etc ) with specific versions, before we can migrate to a newer Yocto or ROS release. I don't have too many experience with Yocto and I understand that I need to prepare the recipes for every dependency, so I can compile and package all the libraries. My question is: is there any simpler solution then doing everything from source before we can migrate to the newer versions?
Thank you in advance