Cross compiling OpenCV for BBxM

Hello,

I followed the procedure given on this page http://processors.wiki.ti.com/index.php/Building_OpenCV_for_ARM_Cortex-A8 for building OpenCV. After the build, the build folder contains some new folders and the .so library files are dumped in the modules folder.

I want to know how to cross compile an OpenCV application on my host for running on the beagle.

Also, i didn’t understand the concept of ~/targetfs on that page.

Can someone help me out on this regard?

I have been trying to cross compile OpenCV and OpenCV app for BBxM, but, i have not found anything other than above link which has worked.

Thanks.

I don’t really understand their concept with NFS mounted fs, but I have another solution. Have you already tried Buildroot (http://buildroot.uclibc.org/)? With this distro you have toolchain, kernel and rootfs at once. OpenCV is already included (you just need to activate it for your target). After you’ve done the basic build and the system is starting you can try to write your own application and get it included into your final rootfs. See this article http://free-electrons.com/blog/buildroot-2011-11/ for tips on how to add your app.

Yegor

Why? Opencv is already available by default for Angstrom, which comes with the SD card shipped with your xM. No need to build it yourself, especially using such an painfull and outdated process like mentioned in the wiki.

regards,

Koen

@ Yegor

I haven’t tried buildroot yet. Thanks for the pointer i will look into it.

@Koen

So basically i have to cross compile my application code on PC and then just transfer the application binary to the board. The application binary will automatically take the library files (assuming it’s using dynamic linking), as the Angstrom comes with OpenCV available by default. Am i correct in my understanding?.

Also, any tutorials or pointers on how to cross compile any OpenCV application on desktop? And what are the prerequisite for achieving the cross compiling successfully?

you can compile your application natively on the BB (under angstrom).

Marco Casaroli

sanchayan maity wrote:

@ Yegor

I haven't tried buildroot yet. Thanks for the pointer i will look into it.

@Koen

So basically i have to cross compile my application code on PC and then just transfer the application binary to the
board. The application binary will automatically take the library files (assuming it's using dynamic linking), as the
Angstrom comes with OpenCV available by default. Am i correct in my understanding?.

Also, any tutorials or pointers on how to cross compile any OpenCV application on desktop? And what are the prerequisite
for achieving the cross compiling successfully?

again, angstrom can help you there. if you rebuild the beagle software
on your PC using angstrom, you will have all the libraries and headers
that you will need to cross build your application on the PC too.

@Victor

I have the same issue.
Application is compiled correctly for my pc with Ubuntu by:

http://elinux.org/Getting_a_Workshop_SD_Image

I started working on BB-xM using the image available on the above page. You can then write code and compile it on the beagle itself.

You can write apps on the beagleboard using OpenCV without any hassles.

For your particular problem, i can’t recall the exact command, but, find out how to link a library to your application using gcc. Once you get the command write and the assuming the libraries are there, it will link correctly.

I think the command was something like this. Mostly the files start with the libopencv_ extension if i am correct, so in the below command i link my app to all opencv libs in one shot.

arm-angstrom-linux-gnueabi-gcc image-conversion.c /usr/lib/libopencv_*.so -o image-conversion

[http://www.network-theory.co.uk/docs/gccintro/gccintro_17.html](http://www.network-theory.co.uk/docs/gccintro/gccintro_17.html) 

Check this out.


Thanks for reply!
I’m studying how to works gcc and the core issue of the cross-compiling.
However I’ll try your suggestion tonight.

G