Quantcast

Add opencv support into yocto project with meta-dsp-overo

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Add opencv support into yocto project with meta-dsp-overo

bowu86
Hi all,

Following the detailed tutorial in https://github.com/jumpnow/meta-dsp-overo, we were able to build a working image and successfully got the webcam image on PC via wifi.

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-12.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "overo"
DISTRO            = "poky"
DISTRO_VERSION    = "1.5.1"
TUNE_FEATURES     = "armv7a vfp neon"
TARGET_FPU        = "vfp-neon"
meta              
meta-yocto        = "dora:19745990465b37107142c5464008ca9f7959cc0b"
meta-oe          
meta-networking   = "dora:ee173678383683e972c7d4d6f0ef5790bfa50274"
meta-ti           = "dora:87a4bfa96ab067e857f8f3090a54a288bb3f2d69"
meta-dsp-overo    = "dora:e9be5a7f3fdc31222a28fe57a23c681ee6199cec"



But we would like also some onboard image processing, so we added opencv into the builded image by adding opencv related tools into console-image.bb

EXTRA_TOOLS_INSTALL = " \
    bzip2 \
    devmem2 \
    ethtool \
    findutils \
    i2c-tools \
    iftop \
    iperf \
    htop \
    less \
    nano \
    procps \
    sysfsutils \
    tcpdump \
    unzip \
    wget \
    zip \
    opencv \
    opencv-dev \
    opencv-apps \

 "

And rebuild the image by bitbake dsp-image. However this time we ran into problems:

| compiling C sources
| C compiler: arm-poky-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon --sysroot=/home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/overo -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -O2 -pipe -g -feliminate-unused-debug-types -fPIC
|
| compile options: '-DNO_ATLAS_INFO=2 -Inumpy/core/blasdot -I/usr/include/atlas -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/overo/usr/include/python2.7 -Ibuild/src.linux-x86_64-2.7/numpy/core/src/multiarray -Ibuild/src.linux-x86_64-2.7/numpy/core/src/umath -c'
| arm-poky-linux-gnueabi-gcc: numpy/core/blasdot/_dotblas.c
| cc1: warning: include location "/usr/include/atlas" is unsafe for cross-compilation [-Wpoison-system-directories]
| arm-poky-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon --sysroot=/home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/overo -shared -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -O2 -pipe -g -feliminate-unused-debug-types build/temp.linux-x86_64-2.7/numpy/core/blasdot/_dotblas.o -L/usr/lib -L/home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/overo/usr/lib -Lbuild/temp.linux-x86_64-2.7 -lptf77blas -lptcblas -latlas -lpython2.7 -o build/lib.linux-x86_64-2.7/numpy/core/_dotblas.so
| /home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/x86_64-linux/usr/libexec/armv7a-vfp-neon-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.8.1/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation
| /usr/lib/libptcblas.a: could not read symbols: File format not recognized
| collect2: error: ld returned 1 exit status
| /home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/x86_64-linux/usr/libexec/armv7a-vfp-neon-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.8.1/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation
| /usr/lib/libptcblas.a: could not read symbols: File format not recognized
| collect2: error: ld returned 1 exit status
| error: Command "arm-poky-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon --sysroot=/home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/overo -shared -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -O2 -pipe -g -feliminate-unused-debug-types build/temp.linux-x86_64-2.7/numpy/core/blasdot/_dotblas.o -L/usr/lib -L/home/ndrobotic/yocto_USB_camera/poky/build/tmp/sysroots/overo/usr/lib -Lbuild/temp.linux-x86_64-2.7 -lptf77blas -lptcblas -latlas -lpython2.7 -o build/lib.linux-x86_64-2.7/numpy/core/_dotblas.so" failed with exit status 1
| ERROR: python setup.py build_ext execution failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/ndrobotic/yocto_USB_camera/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/python-numpy/1.4.1-r2/temp/log.do_compile.32225)
ERROR: Task 1757 (/home/ndrobotic/yocto_USB_camera/poky/meta-openembedded/meta-oe/recipes-devtools/python/python-numpy_1.4.1.bb, do_compile) failed with exit code '1'


Seems that the atlas libraries have some issue with the compiler... Any one had similar problems before? Any suggestions are greatly appreciated.

Best,
Bo

 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Add opencv support into yocto project with meta-dsp-overo

bowu86
Seems that the arm-poky-linux-gnueabi-gcc compiler is incompatible with the libraries that were generated with gcc on laptop's linux system.

I guess those libraries such as libptcblas.a should be generated with arm-poky-linux-gnueabi-gcc and be placed somewhere in poky/build/tmp/sysroots/overo/usr/lib. But maybe I missed something so these libraries were not generated...

Anyone has any thoughts? Thanks in advance.

Bo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Add opencv support into yocto project with meta-dsp-overo

Scott Ellis
I haven't tried opencv on a Gumstix in a long while, but I did recently
build numpy and had similar issues.

To solve it I ended up adding the fortran compiler to the Yocto build.

AND I removed the native fortran compiler from the build machine.

Either that or I used a build machine that didn't have a native fortran
compiler installed.

Otherwise the numpy recipe seemed to keep finding the native compiler.
I didn't track it down.

The steps to add fortran weren't obvious so I wrote up some notes.

http://www.jumpnowtek.com/linux/yocto/Add-Fortran-support-to-a-Yocto-build.html

After that I could add this to the image and it built clean.

PYTHON_INSTALL = " \
    python-core \
    python-numpy \
"

Maybe this helps.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Add opencv support into yocto project with meta-dsp-overo

bowu86
Thanks a lot, Scott! We will have a try.

Bo
Loading...