1

I've written (on Ubuntu host) a simple OpenCV Application (opening the videostream from Logitech Webcam Pro 9000) in Qt Creator. After fixing problems (CMake didn't find it) with ffmepeg, x264, gstreamer etc. (found on http://www.ozbotz.org/opencv-installation/) the application works.

Now I want to cross-compile OpenCV with CMake for Pandaboard (Ubuntu), to use it in combination with the cross-compiled Qt Application (like on host). After pressing the configure button I get this output. http://depositfiles.com/files/se4r3bhrh

Besides the problem, I don't know exactly how to write the "toolchain file for cross-compiling" and/or to "Specify Options for cross-compiling" in CMake, I'm afraid to fix the problems with ffmpeg etc. (like on the host)? I have a good HOWTO (from ozbotz) for host, but how to handle it for cross-compiling for Pandaboard ?

Does anyone has experience/ideas with these problems ?

David Hammen
  • 32,454
  • 9
  • 60
  • 108
user1855143
  • 11
  • 1
  • 2

1 Answers1

0

To cross compile Opencv for pandaboard with a host ubuntu pc,Follow these steps:

  • Install cross compiling tools On ubuntu, you can simply do it by entering the following in the terminal:

    sudo apt-get install gcc-arm-linux-gnueabihf

    • Get opencv source and prepare to build

      mkdir opencv
      cd opencv
      git clone https://github.com/Itseez/opencv.git
      cd opencv-master
      mkdir build
      cd build

    • Edit Cmake variables to tell it to use the cross compiler. gedit ../platforms/linux/arm-gnueabi.toolchain.cmake
      add these lines at appropriate place in the file:
      set( CMAKE_C_COMPILER gcc-arm-linux-gnueabihf)
      set( CMAKE_CXX_COMPILER g++-arm-linux-gnueabihf)

      Set additional C_FLAGS if you need:
      set(CMAKE_C_FLAGS "-mcpu=cortex-a8 -O3 -mfloat-abi=hard -ftree-vectorize -ftree-vectorizer-verbose=9" CACHE STRING "c flags")

    • Run cmake:
      cmake -DCMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabi.toolchain.cmake ../

    • make
  • The binary installed by gcc-arm-linux-gnueabihf seems to have had a name change to arm-linux-gnueabihf-gcc. Similarly, the g++ binary now seems to be arm-linux-gnueabihf-g++. – Anatortoise House Jan 25 '14 at 15:56
  • To get the g++ compiler, I also needed apt-get install g++-arm-linux-gnueabihf. Use the 'which arm-linux-gnueabihf-gcc' and 'which arm-linux-gnueabihf-g++' to find the binaries and confirm they're installed correctly. Not sure why the cmake script wants both gcc and g++, but I needed to install both to get the default cmake script to work. – Anatortoise House Jan 25 '14 at 16:02
  • We wound up using apt-get python-opencv, which had binaries for arm (pandaboard) already built. – Anatortoise House Jan 25 '14 at 21:47