ViSP  2.10.0
Tutorial: Installation from source on Linux CentOS

In this tutorial you will learn how to install ViSP from source on CentOS. These steps have been tested for CentOS 7.0 (x86_64) distribution, but should work with any other distribution as well.

Concerning ViSP installation, we provide also other Tutorials.

Required packages

  • gcc 4.4.x or later. This can be installed with:
    sudo yum install gcc-c++
  • CMake 2.6 or higher that could be installed with:
    sudo yum install cmake

ViSP is interfaced with several optional third-party libraries. The installation of the corresponding packages is described in Optional 3rd party packages section.

Getting ViSP source code

There are different ways to get ViSP source code:

  • You can download the latest stable release as a zip or a tarball. Once downloaded, uncompress the file using either
    tar xvzf ViSP-2.10.0.tar.gz
  • You can also download a more recent snapshot. Once downloaded, uncompress the file using
  • Or you get the cutting-edge ViSP from Subversion repository. To this end you have first to install subversion
    sudo yum install subversion
    and then use the following command
    svn checkout svn:// ViSP-trunk

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

Configuring ViSP from source

  • Create first a directory denoted <binary_dir> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries.
    cd $HOME; mkdir ViSP-build-release
  • Enter the <binary_dir> and to configure the build type:
    cmake [<optional parameters>] <source_dir>
    For example:
    cd $HOME/ViSP-build-release
    A more versatile way to configure the build is to use ccmake, the CMake GUI:
    ccmake ../ViSP-2.10.0
    The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used.
    Snapshot of the ccmake ../ViSP-2.10.0 command used to configure ViSP.
  • There is an other way to see which are the 3rd parties that are found during the configuration stage and that will be used by ViSP during the build. To this end you can have a look to the text file named ViSP-third-party.txt and located in <binary_dir>. We provide hereafter an example of a possible content of this file:
    ViSP third-party libraries
    Below you will find the list of third party libraries used to
    build ViSP on your computer.
    Gnu Scientific Library : no
    Lapack/blas : no
    Ogre simulator : no
    \- Ogre3D : no
    \- OIS : no
    Coin simulator :
    \- Coin3D : no
    \- SoWin : no
    \- SoXt : no
    \- SoQt : no
    \- Qt4 : no
    \- Qt3 : no
    Afma6 : no
    Afma4 : no
    Biclops : no
    Ptu46 : no
    Pioneer : no
    Viper S650 : no
    Viper S850 : no
    Video devices (display)
    X11 : no
    GTK : no
    OpenCV : no
    GDI : no
    Direct3D : no
    Firewire libdc1394-1.x : no
    Firewire libdc1394-2.x : no
    Video For Linux Two : no
    DirectShow : no
    CMU 1394 Digital Camera SDK : no
    OpenCV : no
    Specific devices
    Yarp : no
    Kinect : no
    \-libfreenect : no
    \-libusb-1.0 : no
    \-pthread : yes
    Video and image Read/Write:
    FFMPEG : no
    libjpeg : no
    libpng : no
    XML2 : no
    pthread : yes
    OpenMP : yes
    zbar : no
    dmtx : no
    Doxygen : no
    Graphviz dot : no
    ViSP built with C++11 features: no
    In our case, only pthread an OpenMP 3rd parties are detected.

Optional 3rd party packages

As mentioned previously, ViSP is interfaced with some 3rd party libraries. The complete list is provided here. We recommend to install the following:

  • OpenCV
    sudo yum install opencv-devel
  • libX11 to be able to open a window to display images
    sudo yum install libX11-devel
  • lapack and gsl to benefit from optimized mathematical capabilities
    sudo yum install lapack-devel gsl-devel
  • libv4l to grab images from usb or analogic cameras
    sudo yum install libv4l-devel
  • libxml2 to be able to configure the model-based trackers from xml files
    sudo yum install libxml2-devel
  • libjpeg, libpng to support jpeg and png images
    sudo yum install libjpeg-devel libpng-devel

Once installed, if you want that ViSP exploit the new 3rd parties, you have to configure ViSP again.

ccmake ../ViSP-2.10.0

The following image shows now that all the previous optional 3rd parties are detected.

Snapshot of the ccmake ../ViSP-2.10.0 command used to configure ViSP after installation of optional 3rd party libraries.
Other 3rd party libraries are interfaced with ViSP. This is for example the case of Ogre that can be used to enhance the visibility computation of the faces that are tracked with the model-based tracker (see Tutorial: Model-based tracking), or Coin that can be used to parse vrml files that describe the 3D model of the object to track using the same model-based tracker. It seems that these 3rd parties are not packaged on CentOS. If you want to use these 3rd parties, you have to install them from source code.

Generating Makefiles

To generate the makefiles, just press [g] key in the ccmake gui.

Now we can build ViSP.

Known issues

  • On CentOS 7.0 with cmake 2.8.11, during cmake configuration you may encounter the following issue:
    CMake Warning at src/CMakeLists.txt:80 (add_library):
    Cannot generate a safe runtime search path for target visp because files in
    some directories may conflict with libraries in implicit directories:
    runtime library [] in /usr/lib64 may be hidden by files in:
    Some of these libraries may not be found correctly.
    The problem was that exists in /usr/lib64 and in //lib64. In //lib64 it should be a symbolic link to /usr/lib64.
    $ ls -als //lib64
    0 lrwxrwxrwx. 1 root root 9 Feb 4 12:16 //lib64 -> usr/lib64
    $ ls -als //lib64/libpthread*
    140 -rwxr-xr-x. 1 root root 141616 Jan 27 15:13 //lib64/
    4 -rw-r--r--. 1 root root 222 Jan 27 14:42 //lib64/
    0 lrwxrwxrwx. 1 root root 18 Feb 4 12:34 //lib64/ ->
    The fix consists in removing //lib64/ and creating a new symbolic link
    $ cd //lib64
    $ sudo rm
    $ sudo ln -s
    $ ls -als libpthread*
    140 -rwxr-xr-x. 1 root root 141616 Jan 27 15:13
    0 lrwxrwxrwx. 1 root root 18 Feb 4 16:09 ->
    0 lrwxrwxrwx. 1 root root 18 Feb 4 12:34 ->
  • On CentOS 7.0, vpVideoReader is not able to read mpeg videos. If ffmpeg is not installed (this is our case since ffmpeg is not packaged for CentOS 7.0), this class uses OpenCV to read and decode videos. Some examples or tutorials provided in ViSP hang during cv::Capture::open() call. The reason is that OpenCV 2.4.5 cv::Capture seams buggy. This is for example the case if you run:
    $ ./example/video/videoReader
    A work arround consists in installing a more recent OpenCV version from source.

Building ViSP from source

  • To build ViSP proceed with:
    make -j4
  • To install ViSP proceed with:
    sudo make install
  • To build ViSP documentation, you have first to install Doxygen package:
    sudo yum install doxygen graphviz
    Then you can proceed with:
    make visp_doc

You are now ready to see the next Tutorial: How to create and build a CMake project that uses ViSP on Unix or Windows that will show you how to use ViSP as a 3rd party to build your own project.