How to add Hailo integration tool into Yocto build environment

Instruction to integrate “Hailo integration tool” into Yocto’s build environment.
There is a dependency between the integration tool and hailort. This guide is based on integration tool version 1.15.0 which is based on hailort version 4.15.0. Future versions may break compatibility and require other hailort versions so make sure to check the CMakeLists.txt of the integration tool which defines the required hailort version. Adjust version naming of this guide according to your case.

  1. Download the latest source package of hailo integration tool from the dev zone
  2. In your Yocto environment, find the meta-hailo layer folder location and go to the folder
    …meta-hailo/meta-hailo-libhailort/recipes-hailo
    Create a folder called “hailo-integration-tool” and a folder called “files” within it
  3. Extract the contents of the downloaded zip file into the “files” folder created in previous step
  4. Create the recipe file in the …meta-hailo/meta-hailo-libhailort/recipes-hailo/hailo-integration-tool/
DESCRIPTION = "Hailo Integration Tool" 
LICENSE = "CLOSED"

SRC_URI = "file://CMakeLists.txt \
	   file://subprojects/CMakeLists.txt \
           file://etc \
	   file://var \
 	   file://src \
	   file://src/common \
	   file://src/config \
	   file://src/hailort \
	   file://src/hailort/infer_runner \
	   file://src/misc \
	   file://src/output \
	   file://src/testers \
	   file://src/testers/pcie_config \
	   file://src/testers/thermal "

S = "${WORKDIR}"

inherit hailort-base

DEPENDS = "libhailort"
RDEPENDS:${PN} += "libhailort"
CMAKE_BUILD_TYPE = "RELEASE"

do_install:append() {
    install -d ${D}/etc
    install -d ${D}/var
    install -d ${D}${bindir}
    install -m 0755 ${WORKDIR}/bin/hailo-integration-tool ${D}${bindir}/hailo-integration-tool
    cp -r ${WORKDIR}/etc/* ${D}/etc
    cp -r ${WORKDIR}/var/* ${D}/var
}

FILES:${PN} += "${bindir}/hailo-integration-tool /etc/* /var/*"

Note: The file name has the product version appended to it. If using another version of hailo integration tool, please modify accordingly

  1. Edit the libhailort recipe in
    …meta-hailo/meta-hailo-libhailort/recipes-hailo/libhailort/libhailort_4.15.0.bb:

Change:
HAILORT_INCLUDE_STAGING_DIR = "${D}${includedir}/hailort"

to:

HAILORT_INCLUDE_STAGING_DIR = "${D}${includedir}"

and add immediately after it:

HAILORT_EXPORT_DIR = "${D}${libdir}/cmake/HailoRT"

before the end of the do_install() function add:

install -d ${HAILORT_EXPORT_DIR}
install -m 0644 ${WORKDIR}/build/hailort/libhailort/src/*.cmake ${HAILORT_EXPORT_DIR}
install -m 0644 ${WORKDIR}/build/hailort/libhailort/src/CMakeFiles/Export/**/*.cmake ${HAILORT_EXPORT_DIR}

  1. Add the integration tool in your local.conf file under …build/conf (usually where the other hailo packages were added):

IMAGE_INSTALL:append = " hailo-integration-tool hailo-firmware libhailort hailortcli hailo-pci libgsthailo "
IMAGE_INSTALL:append = " libgsthailotools tappas-apps hailo-post-processes "

  1. Bitbake your image - in this case done for iMX8MP NXP platform:

bitbake imx-image-multimedia

or

bitbake core-image-minimal