2

我正在尝试使用 bitbake 构建一个非常简单的配方,但我无法弄清楚为什么不能包含 opencv。我发现的所有示例都使用此设置,并且链接到 opencv 似乎没有问题。我对 bitbake 还很陌生,担心我会误解一些非常简单的东西。提前感谢您提供的任何帮助。

收件人:

UMMARY = "Hello"
SRCNAME = "Hello"

depends += "opencv"

LICENSE = "PSF"
LIC_FILES_CHKSUM = "file://${TOPDIR}/Yocto/Recipies/LICENSE.txt;md5=7424386ffe323e815ee62ee9ad591dd8"

SRCREV = "master"
SRC_URI = "https://developer-binaries.s3.amazonaws.com/hello-1.0.zip"
SRC_URI[md5sum] = "ca5940b7e30c489c4304c467252980f5"

inherit pkgconfig cmake

CMakeLists:

PROJECT(Hello)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)

FIND_PACKAGE(OpenCV REQUIRED)

ADD_EXECUTABLE(Hello
    Main.cpp)

INSTALL(FILES
 ${CMAKE_BINARY_DIR}/Hello
  DESTINATION ${exec_prefix}/bin)

位烘烤错误:

ERROR: Function failed: do_configure (log file is located at /home/ubuntu/oe-core/build/out-eglibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/hello/1.0-r0/temp/log.do_configure.5288)
ERROR: Logfile of failure stored in: /home/ubuntu/oe-core/build/out-eglibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/hello/1.0-r0/temp/log.do_configure.5288
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing python function autotools_copy_aclocals
| DEBUG: Python function autotools_copy_aclocals finished
| DEBUG: Executing shell function do_configure
| -- The C compiler identification is GNU 4.8.3
| -- The CXX compiler identification is GNU 4.8.3
| -- Check for working C compiler: /home/ubuntu/oe-core/build/out-eglibc/sysroots/x86_64-linux/usr/bin/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gcc
| -- Check for working C compiler: /home/ubuntu/oe-core/build/out-eglibc/sysroots/x86_64-linux/usr/bin/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gcc -- works
| -- Detecting C compiler ABI info
| -- Detecting C compiler ABI info - done
| -- Check for working CXX compiler: /home/ubuntu/oe-core/build/out-eglibc/sysroots/x86_64-linux/usr/bin/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-g++
| -- Check for working CXX compiler: /home/ubuntu/oe-core/build/out-eglibc/sysroots/x86_64-linux/usr/bin/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-g++ -- works
| -- Detecting CXX compiler ABI info
| -- Detecting CXX compiler ABI info - done
| CMake Error at CMakeLists.txt:5 (FIND_PACKAGE):
|   By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
|   asked CMake to find a package configuration file provided by "OpenCV", but
|   CMake did not find one.
| 
|   Could not find a package configuration file provided by "OpenCV" with any
|   of the following names:
| 
|     OpenCVConfig.cmake
|     opencv-config.cmake
| 
|   Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
|   "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
|   provides a separate development package or SDK, be sure it has been
|   installed.
| 
| 
| -- Configuring incomplete, errors occurred!
| See also "/home/ubuntu/oe-core/build/out-eglibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/hello/1.0-r0/build/CMakeFiles/CMakeOutput.log".
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/ubuntu/oe-core/build/out-eglibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/hello/1.0-r0/temp/log.do_configure.5288)
ERROR: Task 6 (/home/ubuntu/oe-core/build/Yocto/Recipies/hello.bb, do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 540 tasks of which 539 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
No currently running tasks (537 of 549)
4

2 回答 2

3

尝试将“depends”更改为“DEPENDS”——大小写很重要。

于 2014-12-12T12:29:20.170 回答
2

在 yocto 构建中安装 OpenCV 的最快方法之一

git clone git://git.openembedded.org/bitbake/
git clone git://git.openembedded.org/openembedded-core
git clone git://git.openembedded.org/meta-openembedded

将 bitbake 链接到 openembedded-core 并配置 oe-core。

ln -s <Path>/bitbake <Path>/openembedded-core/bitbake
source openembedded-core/oe-init-build-env

现在,编辑你的 bblayers.conf 文件

BBLAYERS ?= "\ ~Path/openembedded-core/meta \
~Path/meta-openembedded/meta-oe \"

现在,在 openembedded-core/meta/recipes-core/images/core-image-minimal.bb 中,

IMAGE_INSTALL += "opencv libavcodec-dev libavformat-dev libswscale-dev"

PACKAGECONFIG_pn-opencv="eigen jpeg libav png tiff"

保存并关闭文件。

此外,将以下行添加到您的 local.conf,因为 opencv 依赖项是由商业的 ffmpeg 配方提供的。

LICENSE_FLAGS_WHITELIST += "commercial"

现在,您可以执行以下命令,该命令将为 OpenCV 烘焙修改后的配方:

bitbake core-image-minimal
于 2016-09-23T14:30:24.610 回答