You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.4 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. #! /bin/bash
  2. # exit if a command fails
  3. set -e
  4. opencv_version="3.0.0-beta"
  5. opencv_deps=(libopencv-dev yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg pkg-config)
  6. install_deps=(curl build-essential checkinstall cmake)
  7. # install dependencies
  8. apt-get update && apt-get install -y ${install_deps[@]} ${opencv_deps[@]}
  9. # download opencv
  10. curl -sL https://github.com/Itseez/opencv/archive/$opencv_version.tar.gz | tar xvz -C /tmp
  11. # install
  12. cd /tmp/opencv-$opencv_version && mkdir build && cd build
  13. cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_OPENGL=ON ..
  14. make
  15. make install
  16. # configure
  17. echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf
  18. ldconfig
  19. ln /dev/null /dev/raw1394 # hide warning - http://stackoverflow.com/questions/12689304/ctypes-error-libdc1394-error-failed-to-initialize-libdc1394
  20. # cleanup package manager
  21. apt-get remove --purge -y ${install_deps[@]} && apt-get autoclean && apt-get clean
  22. rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  23. # prepare dir
  24. mkdir /source