Or you can download the latest release (should be at least 3.0.1) as a zip or a tarball. Once downloaded, uncompress the file using either

$ tar xvzf visp-x.y.z.tar.gz

or

$ unzip visp-x.y.z.zip

We suppose now that ViSP source is in a directory denoted <source_dir>, for example $HOME/soft/visp

Cross-compiling ViSP from source

Create first a directory denoted <binary_dir> where you want to cross-compile ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries that could be later used on the Raspberry Pi.

Tips and tricks

Howto use an other toochain

The default toolchain used in arm-raspberrypi.toolchain.cmake file is the one located in $HOME/soft/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin. To set an other toochain, use ARM_RASPBERRY_CROSSCHAIN cmake var:

Undefined reference to __throw_out_of_range_fmt

This error occurs when cross-compiling for Raspberry Pi 3 Model B.

Linking CXX executable testArray2D

/home/fspindle/sThis is unfortunately due to the OpenCV core library (for Jessie) being built with a newer version of gcc/g++ oft/raspberrypi/rootfs/usr/lib/arm-linux-gnueabihf/libopencv_ts.so.2.4.9: undefined reference to `std::__throw_out_of_range_fmt(charconst*, ...)@GLIBCXX_3.4.20'

This error is due to the fact that OpenCV was built with gcc-4.9 on Raspberry Pi Jessy distro, while the cross-compiler uses gcc-4.8 version.

There exists different work arround depending on your use case:

if you are just interested to build ViSP libraries, a simple workarround is to turn off the build of the tests, demos, tutorials and examples:

an other way, that we didn't investigate in depth is to upgrade the toochain to gcc-4.9. Notice that arm-rpi-4.9.3-linux-gnuabihf toolchain in https://github.com/raspberrypi/tools.git doesn't allow cmake to detect all the 3rd parties. During our trial, we succeed to build ViSP, but X11, xml2... were not detected. During the configuration cmake only found OpenCV and zbar libraries.

CMake 2.8.12 or greater requested

The following error may occur on Raspberry Pi 1 when you are trying to build a project with the resulting cross-build material: