Yocto:创建SciKit学习食谱

时间:2019-11-27 07:25:15

标签: python-3.x linux numpy scikit-learn yocto

我正在尝试从pypiSciKit-Learn创建食谱。但是似乎python3 setup.py build找不到NumPy,即使我知道我在构建主机上(同时包含pip3 install numpybitbake python3-numpy-native)也是如此。

现在我的食谱中包含以下内容:

DESCRIPTION = "python3-scikit-learn"
SECTION = "devel/python"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://PKG-INFO;md5=4a2bb4f4ec2b68ec46d5d1be3371b2c7"

PR = "r0"
SRCNAME = "scikit-learn"

SRC_URI="https://files.pythonhosted.org/packages/1e/ce/9d8c88e68af0a5b5c5d78d8d2b7bcadfd45e1d6afc863ccb9aee30765b06/scikit-learn-0.21.3.tar.gz"

SRC_URI[md5sum] = "d7bb030fea8d503d897a0dc8c50b9241"

SRC_URI[sha256sum] = "eb9b8ebf59eddd8b96366428238ab27d05a19e89c5516ce294abc35cea75d003"

S = "${WORKDIR}/${SRCNAME}-${PV}"

inherit setuptools3

这种方法适用于尚未在openembedded中的其他python软件包,例如joblib,我确实使用这种确切的方法进行安装。

我可以看到当我运行bitbake python3-scikit-learn -c devshell并在那里运行python3时,我无法导入numpy,因为devshell python3正在查找的路径(位于/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/中)缺少了numpy

我尝试将复制主机numpy软件包文件夹手动粘贴到此目录,但是随后出现此错误:

Log data follows:
| DEBUG: Executing shell function do_compile
| C compiler: aarch64-poky-linux-gcc -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot -Wno-unused-result -Wsign-compare -DNDEBUG -g -O3 -Wall -O2 -pipe -g -feliminate-unused-debug-types -O2 -pipe -g -feliminate-unused-debug-types -O2 -pipe -g -feliminate-unused-debug-types -fPIC
| 
| compile options: '-c'
| extra options: '-fopenmp'
| aarch64-poky-linux-gcc: test_openmp.c
| aarch64-poky-linux-gcc -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now objects/test_openmp.o -o test_openmp -fopenmp
| Partial import of sklearn during the build process.
| /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls'
|   warnings.warn(msg)
| /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires'
|   warnings.warn(msg)
| /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
|   warnings.warn(msg)
| Traceback (most recent call last):
|   File "setup.py", line 291, in <module>
|     setup_package()
|   File "setup.py", line 287, in setup_package
|     setup(**metadata)
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/core.py", line 137, in setup
|     config = configuration()
|   File "setup.py", line 174, in configuration
|     config.add_subpackage('sklearn')
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/misc_util.py", line 1035, in add_subpackage
|     caller_level = 2)
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/misc_util.py", line 1004, in get_subpackage
|     caller_level = caller_level + 1)
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/misc_util.py", line 941, in _get_configuration_from_setup_py
|     config = setup_module.configuration(*args)
|   File "sklearn/setup.py", line 76, in configuration
|     maybe_cythonize_extensions(top_path, config)
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/scikit-learn-0.21.3/sklearn/_build_utils/__init__.py", line 42, in maybe_cythonize_extensions
|     with_openmp = check_openmp_support()
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/scikit-learn-0.21.3/sklearn/_build_utils/openmp_helpers.py", line 100, in check_openmp_support
|     output = subprocess.check_output('./test_openmp')
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 395, in check_output
|     **kwargs).stdout
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 472, in run
|     with Popen(*popenargs, **kwargs) as process:
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 775, in __init__
|     restore_signals, start_new_session)
|   File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
|     raise child_exception_type(errno_num, err_msg, err_filename)
| OSError: [Errno 8] Exec format error: './test_openmp'
| ERROR: 'python3 setup.py build ' execution failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/temp/log.do_compile.605)

有人知道如何解决此问题吗?

0 个答案:

没有答案