Unable to compile OpenCV with OpenCL support (Yocto Zeus IMX8MPlus)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to compile OpenCV with OpenCL support (Yocto Zeus IMX8MPlus)

1,268 Views
CarlosVisionTIR
Contributor I

Good day everyone,

I am using the lastest version of meta-openembedded for zeus  with I.MX 8M Plus as target. 

MACHINE ??= 'imx8mp-vpb'
DISTRO ?= 'vpb-imx-xwayland'

 

For my program, I need to implement an OpenCL kernel to perform a per-element operation on a OpenCV UMat. As I understand, I must first compile OpenCV with the option WITH_OPENCL.

This is the whole opencv recipe:

SUMMARY = "Opencv : The Open Computer Vision Library"
HOMEPAGE = "http://opencv.org/"
SECTION = "libs"

LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=6450921bb12a3133c8f5cb2a80343710"

ARM_INSTRUCTION_SET_armv4 = "arm"
ARM_INSTRUCTION_SET_armv5 = "arm"

DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp"

SRCREV_opencv = "371bba8f54560b374fbcd47e7e02f015ac4969ad"
SRCREV_contrib = "2c32791a9c500343568a21ea34bf2daeac2adae7"
SRCREV_ipp = "32e315a5b106a7b89dbed51c28f8120a48b368b4"
SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26"
SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"
SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12"

def ipp_filename(d):
    import re
    arch = d.getVar('TARGET_ARCH')
    if re.match("i.86$", arch):
        return "ippicv_2019_lnx_ia32_general_20180723.tgz"
    else:
        return "ippicv_2019_lnx_intel64_general_20180723.tgz"

def ipp_md5sum(d):
    import re
    arch = d.getVar('TARGET_ARCH')
    if re.match("i.86$", arch):
        return "4f38432c30bfd6423164b7a24bbc98a0"
    else:
        return "c0bd78adb4156bbf552c1dfe90599607"

IPP_FILENAME = "${@ipp_filename(d)}"
IPP_MD5 = "${@ipp_md5sum(d)}"

SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg"
SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
           git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib \
           git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20180723;destsuffix=ipp;name=ipp \
           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc \
           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \
           git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face \
           file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
           file://0002-Make-opencv-ts-create-share-library-intead-of-static.patch \
           file://0003-To-fix-errors-as-following.patch \
           file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \
           file://0001-Dont-use-isystem.patch \
           file://download.patch \
           "
PV = "4.1.0"

S = "${WORKDIR}/git"

# OpenCV wants to download more files during configure.  We download these in
# do_fetch and construct a source cache in the format it expects
OPENCV_DLDIR = "${WORKDIR}/downloads"

do_unpack_extra() {
    tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR}

    md5() {
        # Return the MD5 of $1
        echo $(md5sum $1 | cut -d' ' -f1)
    }
    cache() {
        TAG=$1
        shift
        mkdir --parents ${OPENCV_DLDIR}/$TAG
        for F in $*; do
            DEST=${OPENCV_DLDIR}/$TAG/$(md5 $F)-$(basename $F)
            test -e $DEST || ln -s $F $DEST
        done
    }
    cache xfeatures2d/boostdesc ${WORKDIR}/boostdesc/*.i
    cache xfeatures2d/vgg ${WORKDIR}/vgg/*.i
    cache data ${WORKDIR}/face/*.dat
}
addtask unpack_extra after do_unpack before do_patch

EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
    -DWITH_1394=OFF \
    -DENABLE_PRECOMPILED_HEADERS=OFF \
    -DCMAKE_SKIP_RPATH=ON \
    -DOPENCV_ICV_HASH=${IPP_MD5} \
    -DIPPROOT=${WORKDIR}/ippicv_lnx \
    -DOPENCV_GENERATE_PKGCONFIG=ON \
    -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \
    -DOPENCV_ALLOW_DOWNLOADS=OFF \
    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
    ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
"
EXTRA_OECMAKE_append_x86 = " -DX86=ON"

PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
    ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"

PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade"
PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native,"
PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog,"
PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype,"
PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2,"
PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native,"
PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/opencl-icd,"
PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native,"
PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy,"
PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python3-numpy,"
PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract,"
PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"

inherit pkgconfig cmake

inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'distutils3-base', '', d)}
inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)}

export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
export PYTHON="${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}"
export ORACLE_JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native"
export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"

TARGET_CC_ARCH += "-I${S}/include "

PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \
    ${PN}-apps"

python populate_packages_prepend () {
    cv_libdir = d.expand('${libdir}')
    do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
    do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
    do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
    do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)

    pn = d.getVar('PN')
    metapkg =  pn + '-dev'
    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
    blacklist = [ metapkg ]
    metapkg_rdepends = [ ]
    packages = d.getVar('PACKAGES').split()
    for pkg in packages[1:]:
        if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
            metapkg_rdepends.append(pkg)
    d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))

    metapkg =  pn
    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
    blacklist = [ metapkg, "libopencv-ts" ]
    metapkg_rdepends = [ ]
    for pkg in packages[1:]:
        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'):
            metapkg_rdepends.append(pkg)
    d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
}

PACKAGES_DYNAMIC += "^libopencv-.*"

FILES_${PN} = ""
FILES_${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*"
FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig  ${libdir}/cmake/opencv4/*.cmake"
FILES_${PN}-staticdev += "${libdir}/opencv4/3rdparty/*.a"
FILES_${PN}-apps = "${bindir}/* ${datadir}/opencv4 ${datadir}/licenses"
FILES_${PN}-java = "${datadir}/OpenCV/java"
FILES_${PN}-samples = "${datadir}/opencv4/samples/"

INSANE_SKIP_${PN}-java = "libdir"
INSANE_SKIP_${PN}-dbg = "libdir"

ALLOW_EMPTY_${PN} = "1"

SUMMARY_python-opencv = "Python bindings to opencv"
FILES_python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
RDEPENDS_python-opencv = "python-core python-numpy"

SUMMARY_python3-opencv = "Python bindings to opencv"
FILES_python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
RDEPENDS_python3-opencv = "python3-core python3-numpy"

RDEPENDS_${PN}-apps  = "bash"

do_install_append() {
    # Move Python files into correct library folder (for multilib build)
    if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
        mv ${D}/usr/lib/* ${D}/${libdir}/
        rm -rf ${D}/usr/lib
    fi
}



This a snippet of the CMakeLists.txt of OpenCV (CV_DISABLE_OPTIMIZATION is turned off):

OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" (NOT ANDROID AND NOT CV_DISABLE_OPTIMIZATION)
  VISIBLE_IF NOT IOS AND NOT WINRT
  VERIFY HAVE_OPENCL)

 

Nevertheless, when I compile it, this is the output I get:

-- General configuration for OpenCV 4.1.0 =====================================
--   Version control:               unknown
-- 
--   Extra modules:
--     Location (extra):            /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/contrib/modules
--     Version control (extra):     unknown
-- 
--   Platform:
--     Timestamp:                   2023-07-11T06:56:55Z
--     Host:                        Linux 5.4.0-87-generic x86_64
--     Target:                      Linux aarch64
--     CMake:                       3.15.3
--     CMake generator:             Ninja
--     CMake build tool:            ninja
--     Configuration:               Release
-- 
--   CPU/HW features:
--     Baseline:                    NEON FP16
--       required:                  NEON
--       disabled:                  VFPV3
-- 
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++  (ver 9.2.0)
--     C++ flags (Release):         -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -g  -DDEBUG -D_DEBUG
--     C Compiler:                  /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc
--     C flags (Release):           -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native=   -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0=/usr/src/debug/opencv/4.1.0-r0                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native=   -mcpu=cortex-a53+crc+crypto -I/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/git/include  -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -g  -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now  -Wl,--gc-sections  
--     Linker flags (Debug):        -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now  -Wl,--gc-sections  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          dl m pthread rt
--     3rdparty dependencies:
-- 
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    dnn freetype text world
--     Disabled by dependency:      dnn_objdetect
--     Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java js matlab ovis python2 viz
--     Applications:                tests perf_tests examples apps
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI: 
--     GTK+:                        YES (ver 3.24.8)
--       GThread :                  YES (ver 2.60.7)
--       GtkGlExt:                  NO
-- 
--   Media I/O: 
--     ZLib:                        /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot/usr/lib/libz.so (ver 1.2.11)
--     JPEG:                        /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot/usr/lib/libjpeg.so (ver 62)
--     WEBP:                        /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot/usr/lib/libwebp.so (ver encoder: 0x020e)
--     PNG:                         /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot/usr/lib/libpng.so (ver 1.6.37)
--     TIFF:                        /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot/usr/lib/libtiff.so (ver 42 / 4.0.10)
--     OpenEXR:                     build (ver 1.7.1)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     FFMPEG:                      YES
--       avcodec:                   YES (58.54.100)
--       avformat:                  YES (58.29.100)
--       avutil:                    YES (56.31.100)
--       swscale:                   YES (5.5.100)
--       avresample:                YES (4.0.0)
--     GStreamer:                   YES (1.16.2)
--     gPhoto2:                     YES
-- 
--   Parallel framework:            TBB (ver 2017.0 interface 9106)
-- 
--   Trace:                         YES (built-in)
-- 
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.7)
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.5.1)
-- 
--   Python 3:
--     Interpreter:                 /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3 (ver 3.7.8)
--     Libraries:                   /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot/usr/lib/libpython3.7m.so (ver 3.7.8)
--     numpy:                       /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot/usr/lib/python3.7/site-packages/numpy/core/include (ver undefined - cannot be probed because of the cross-compilation)
--     install path:                lib/python3.7/site-packages/cv2/python-3.7
-- 
--   Python (for build):            /home/user/projects/yocto/imx-yocto-bsp-2.3.2/build/tmp/work/aarch64-mx8mp-poky-linux/opencv/4.1.0-r0/recipe-sysroot-native/usr/bin/python3-native/python3
-- 
--   Install to:                    /usr
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done

 

Where there's no mention at all of OpenCL. Also, the generated cvconfig.h includes:

/* OpenCL Support */
/* #undef HAVE_OPENCL */
/* #undef HAVE_OPENCL_STATIC */
/* #undef HAVE_OPENCL_SVM */

which if I understand correctly, means OpenCL is not used.

 

If I try to run my program using OpenCL in the target, I get errors related with OpenCV not being compiled with OpenCL.

 

Maybe you could help me with this? Is this some misconfiguration of my Yocto environment, or am i missing something?

 

Thank you in advance,

Carlos Durán

0 Kudos
Reply
2 Replies

1,233 Views
jimmychan
NXP TechSupport
NXP TechSupport

Please try to use the latest version of the i.MX8MP BSP.

 

You could build the Yocto BSP by following the i.MX Yocto Project User’s Guide​.

(FYI. More details of the Linux Yocto BSP from here: https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applicat...)

 

The i.MX Graphics User’s Guide include the GPU support information of i.MX8MP.

The i.MX Linux Reference Manual​ Chapter 5 include the GPU drivers and library files information.

 

0 Kudos
Reply

1,219 Views
CarlosVisionTIR
Contributor I

Thank you for your reply. Unfortunately, upgrading the Yocto version is not an option as of now due to current work load.

0 Kudos
Reply