【问题标题】:CMake could not find PerlCMake 找不到 Perl
【发布时间】:2019-08-26 11:47:50
【问题描述】:

我正在尝试使用我自己的使用 Yocto Linux 的 arm 板配方构建 mbedcrypto。我可以下载并解压源代码,但是在编译库期间,我得到了错误

| -- Detecting C compiler ABI info
| -- Detecting C compiler ABI info - done
| -- Detecting C compile features
| -- Detecting C compile features - done
| -- Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE)
| -- Could NOT find Perl (missing:  PERL_EXECUTABLE)

相关CMakeLists.txt部分如下


set(CTR_DRBG_128_BIT_KEY_WARNING "${WARNING_BORDER}"
                         "${CTR_DRBG_128_BIT_KEY_WARN_L1}"
                         "${CTR_DRBG_128_BIT_KEY_WARN_L2}"
                         "${CTR_DRBG_128_BIT_KEY_WARN_L3}"
                         "${WARNING_BORDER}")


find_package(PythonInterp)
find_package(Perl)
if(PERL_FOUND)

    # If 128-bit keys are configured for CTR_DRBG, display an appropriate warning
    execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.pl -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY

错误信息

 Found Threads: TRUE
| -- Could NOT find Perl (missing:  PERL_EXECUTABLE)
| CMake Error at tests/CMakeLists.txt:15 (message):
|   Cannot build test suites without Perl

来自文件tests/CMakeLists.txt,其中有

if(ENABLE_ZLIB_SUPPORT)
    set(libs ${libs} ${ZLIB_LIBRARIES})
endif(ENABLE_ZLIB_SUPPORT)

find_package(Perl)
if(NOT PERL_FOUND)
    message(FATAL_ERROR "Cannot build test suites without Perl")
endif()

我已在主机的 /usr/bin/perl 上安装并运行 perl。我不知道是 cmake 配置还是 yocto 问题。

mbedcrypto 配方

DESCRIPTION = "Simple helloworld application"
SECTION = "examples"
DEPENDS = ""
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=302d50a6369f5f22efdb674db908167a"
SRC_URI[md5sum] = "06dd48905c236f7939d03b09bcf7f1a2"


SRC_URI = "https://github.com/ARMmbed/mbed-crypto/archive/mbedcrypto-${PV}.tar.gz"

S = "${WORKDIR}/mbed-crypto-mbedcrypto-${PV}"

inherit cmake pkgconfig

【问题讨论】:

  • 很难说没有更多细节。您能否指出 CMake 文件中生成此错误的行?或者任何引用perl的行?我过去使用过 CMake,但从未使用过 perl。如果您的 CMake 文件很小,您可以发布它,或者如果不是,则发布相关部分。
  • 我已经用一些信息编辑了这个问题
  • 看起来python解释器也找不到。 CMake 有调试选项。你能和他们一起跑吗?查看文档。也许--trace 会有所帮助,或者--debug-output
  • 你的食谱是什么样的?

标签: cmake yocto bitbake


【解决方案1】:

您的配方缺少 Perl 和 Python 的 build-time 依赖项。这些依赖项由DEPENDS variable 指定。

如果您需要 Perl 的本机变体来构建测试,请指定(编辑:根据评论,它没有帮助):

DEPENDS = "perl-native"

你也可以使用perlnative class (see doc for the difference):

inherit perlnative

顺便说一句,还有 runtime 依赖项(请参阅RDEPENDS variable)

【讨论】:

  • 嗨 Tomas...首先尝试使用 DEPENDS = "perl-native" 但它不起作用...不知道为什么...但是将“inherit perlnative”添加到配方中解决了问题。
猜你喜欢
  • 1970-01-01
  • 2016-01-19
  • 1970-01-01
  • 2016-04-14
  • 2021-07-23
  • 2011-08-20
  • 2018-01-20
  • 2023-03-28
  • 2016-10-31
相关资源
最近更新 更多