linux_install_a.sh 764 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. # This file contains documentation snippets for Linux installation tutorial
  3. if [ "$1" = "--check" ] ; then
  4. sudo()
  5. {
  6. command $@
  7. }
  8. fi
  9. sudo apt update
  10. # [gcc]
  11. sudo apt install -y g++
  12. # [gcc]
  13. # [make]
  14. sudo apt install -y make
  15. # [make]
  16. # [cmake]
  17. sudo apt install -y cmake
  18. # [cmake]
  19. # [wget]
  20. sudo apt install -y wget unzip
  21. # [wget]
  22. # [download]
  23. wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
  24. unzip opencv.zip
  25. mv opencv-4.x opencv
  26. # [download]
  27. # [prepare]
  28. mkdir -p build && cd build
  29. # [prepare]
  30. # [configure]
  31. cmake ../opencv
  32. # [configure]
  33. # [build]
  34. make -j4
  35. # [build]
  36. # [check]
  37. ls bin
  38. ls lib
  39. # [check]
  40. # [check cmake]
  41. ls OpenCVConfig*.cmake
  42. ls OpenCVModules.cmake
  43. # [check cmake]
  44. # [install]
  45. sudo make install
  46. # [install]