How to do an OpenCV build

Linux (Fedora-13)

  • Download the latest file from http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/ 
    in my case its OpenCV-2.3.1.tar.bz2
  • Extract the contents into a folder
    in my case I put it into /home/gperry/opencv/OpenCV-2.3.1
  • If you don't have them already you will need the gcc compiler and several other utilities
    you can install them with the following command
    $ sudo yum install gcc cmake cmake-gui ffmpeg ffmpeg-libs 
  • I like using the cmake-gui
  • Examples is the item I like having which by default is not included 
  • Hit Configure then Generate
  • Create native makefiles unless your cross compiling
  • go to the directory where the binaries will be built and type
    $ make
    then
    $ sudo make install
    This will put the binaries (.so) into /usr/local/lib

  • after its installed you will need to export the /usr/local/lib directory 
    $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH