3L504 Ubuntu linux (a.k.a. Zengaku PC linux) is strictly administrated by the university.
So unlike your own linux at your PC, we need to have a special care on preparation and compiling the target software (OpenCV).
Limitations are:
We use the /tmp directory, which is a freespace.
(Unfortunately, you will loose everything in /tmp on shutdown.)
(If you wan to keep this week's work, you need to make a back up of /tmp/iit/usr (and tmp/iit/work if you have a space.)
The procedure here is rather different from ordinary ones you may find on the Internet.
Anyway, you can check what have been installed here.
Terminal |
# full list dpkg -l # find some (e.g. opencv) dpkg -l | grep build-essential dpkg -l | grep cmake dpkg -l | grep git dpkg -l | grep libgtk2.0-dev # ... dpkg -l | grep libdc1394-22-dev # some are actually missing, but you cannot install them directly. dpkg -l | grep opencv # ... actually, you can find version 2.4.9.1(+dgs-1.5ubuntu1) have been installed # ... but we will pursue 3.2.0 |
Terminal:Shell |
cd /tmp mkdir iit cd iit mkdir work cd work # take the source (main part) git clone https://github.com/opencv/opencv.git cd opencv # https://github.com/opencv/ -> click "opencv" -> click "Clone or download" git log --date=short --pretty='format:%H %cd %s' | less # and find "70bbf17b133496bd7d54d034b0f94bd869e0e810" (= OpenCV 3.2.0 release) # https://github.com/opencv -> click "opencv" -> click "51 releases" # -> click "70bbf17" -> check string of "commit" git log --date=short --pretty='format:%H %cd %s' | grep 70bbf17 # let's roll back to the 70bbf17 .. # remove everything! rm -rf * ls git checkout 70bbf17b133496bd7d54d034b0f94bd869e0e810 git reset --hard HEAD ls # take the source (contrib part) cd ../ # https://github.com/opencv/ -> click "opencv" -> click "Clone or download" git clone https://github.com/opencv/opencv_contrib.git cd opencv_contrib # https://github.com/opencv/ -> click "opencv_contrib" -> click "6 releases" # -> click "8634252" -> check string of "commit" git log --date=short --pretty='format:%H %cd %s' | grep 8634252 git checkout 86342522b0eb2b16fa851c020cc4e0fef4e010b7 git reset --hard HEAD ls # Go back to the main part cd ../opencv # dig a folder for compiling # mmdd-hhss ... your time now (my recommendation) # 20170623-0850 for example mkdir build-2017mmdd-hhss cd build-2017mmdd-hhss # cmake 1st try cmake ../ > ../build-2017mmdd-hhss-a.txt less CMakeCache.txt # cmake 2nd try cmake \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ \ ../ > ../build-2017mmdd-hhss-b.txt # cmake 3rd try cmake \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ \ -D BUILD_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D WITH_TBB=ON \ -D CMAKE_INSTALL_PREFIX=/tmp/iit/usr \ ../ > ../build-2017mmdd-hhss-c.txt # Find the each variable ("OPENCV_EXTRA_MODULES_PATH", ... ) # in build-2017mmdd-hhss-c.txt and explain it. |
Terminal:Shell |
# continued cd /tmp/iit/work/opencv/build-2017mmdd-hhss # Let's check how much we consurme the space du -s . du -s /tmp/iit/work/opencv du -s /tmp/iit/work/FFmpeg-n3.3.2 du -s /tmp/iit/usr # It's the time to compile (with 4 CPUs) time make -j4 # test (as this is a huge project...) make test # install (without root permission) make install # Let's check how much we consurme the space du -s . du -s /tmp/iit/work/opencv du -s /tmp/iit/usr # files are ls /tmp/iit/usr/ ls /tmp/iit/usr/lib/ ls /tmp/iit/usr/lib/ ls /tmp/iit/usr/share/OpenCV |