Go to file
Sasha Shyrokov cc688dc132 opencv3: fix Python module build for Python 3.x
When the OpenCV3 Python support is enabled with Python 3.x, it builds
properly, and the resulting .so file is built for the target
architecture, but its name is wrong:

  output/target/usr/lib/python3.6/site-packages/cv2.cpython-36m-x86_64-linux-gnu.so

This prevents Python 3.x from importing the module:

>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'

In order to fix this, we simply need to pass PKG_PYTHON_DISTUTILS_ENV
in the environment. The Python module then gets named:

  output/target/usr/lib/python3.6/site-packages/cv2.cpython-36m-arm-linux-gnueabi.so

And can be imported properly:

>>> import cv2
>>>

This solution was suggested by Arnout Vandecappelle in
https://stackoverflow.com/questions/49059035/buildroot-opencv3-python-package-builds-for-the-wrong-target.

With Python 2.x, the module is named just cv2.so so this problem isn't
visible. However, for consistency, we also pass
PKG_PYTHON_DISTUTILS_ENV when building against Python 2.x, by putting
the OPENCV3_CONF_ENV assignment inside the
BR2_PACKAGE_OPENCV3_LIB_PYTHON condition, but outside the
BR2_PACKAGE_PYTHON3/BR2_PACKAGE_PYTHON condition.

Signed-off-by: Sasha Shyrokov <alexander-shyrokov@idexx.com>
[Thomas: extend the commit log, apply the solution to Python 2.x.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

(cherry picked from commit 8ba80282c3)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-04-08 16:52:09 +02:00
arch arch: add Atom CPUs as Silvermont Architecture target 2018-01-01 13:05:16 +01:00
board configs/imxsabre: Fix U-Boot parallel build issue 2018-04-06 16:49:45 +02:00
boot uboot: fix build for older uboot source trees 2018-03-30 23:19:30 +02:00
configs board/technologic/ts5x00: rename to ts5500 2018-03-30 23:17:00 +02:00
docs docs/manual: pass PARALLEL_JOBS to NINJA_OPTS 2018-04-06 16:42:50 +02:00
fs fs/cpio/init: preserve arguments 2018-02-26 20:49:40 +01:00
linux linux: bump default to version 4.15.15 2018-04-06 20:11:00 +02:00
package opencv3: fix Python module build for Python 3.x 2018-04-08 16:52:09 +02:00
support support/check-uniq-files: support weird locales and filenames 2018-04-06 20:09:19 +02:00
system system: only expose getty options for busybox and sysvinit 2018-01-12 22:07:59 +01:00
toolchain toolchain: fix detection of SSP support 2018-04-06 19:55:25 +02:00
utils utils/genrandconfig: use --no-check-certificate in wget by default 2018-04-06 20:10:17 +02:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.flake8 .flake8: add config file for Python code style 2017-10-06 19:05:18 +02:00
.gitignore
.gitlab-ci.yml board/technologic/ts5x00: rename to ts5500 2018-03-30 23:17:00 +02:00
.gitlab-ci.yml.in gitlab-ci: use new, tagged image 2018-02-05 22:38:30 +01:00
CHANGES Update for 2018.02 2018-03-04 22:28:34 +01:00
Config.in Config.in: Document BR2_CCACHE_DIR override 2018-04-06 20:01:36 +02:00
Config.in.legacy linux-headers: drop old unsupported 3.x versions 2018-02-04 00:02:35 +01:00
COPYING
DEVELOPERS docker-proxy: new package 2018-03-30 23:18:49 +02:00
Makefile Update for 2018.02 2018-03-04 22:28:34 +01:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches