Linux compiler Gpu_flow

Source: Internet
Author: User

Because of the need to do Shuangliu, the paper recommended to this GPU version of the TVL1 algorithm, and began to compile.

First, download the source code

git clone https://github.com/feichtenhofer/gpu_flow.git

Second, Dependencies
    • [OpenCV 2.4] (http://opencv.org/downloads.html)
    • [Qt 5.4] (https://www.qt.io/qt5-4/)
    • [CMake] (https://cmake.org/)

Because my system cmake and QT are no problem, the main problem is on the OPENCV, because I have compiled a opencv3.x, was installed by colleagues in the system path, so I need to recompile opencv2.4, and version switching.

Download opencv2.4.13.5, extract into the source directory, mkdir build-->cd Build-->cmake-gui. Modify Install_prefix inside, and change all cuda9.0 to cuda8.0, configure-->generate-->make-j28, then error:

CMake Warning at Cmake/opencvpackaging.cmake: (message): Cpack_package_ver

Modify the CMakeLists.txt of OpenCV,

 403 if(git_executable)404Execute_process (COMMAND ${git_executable} describe--tags--always--dirty--match"2.[0-9]. [0-9]*" 405Working_directory"${opencv_source_dir}" 406output_variable opencv_vcsversion407result_variable Git_result408Error_quiet409Output_strip_trailing_whitespace410   ) 411   if(Not Git_result EQUAL0) 412#set (opencv_vcsversion"Unknown") 413     set (opencv_vcsversion "2.4.13")414endif ()415 Else() 416# We Don'T has git: 417#set (opencv_vcsversion"Unknown") 418   set (opencv_vcsversion "2.4.13")419endif ()

Modify this here to 2.4.13, recompile pass, make install, complete.

Third, compiling Gpu_flow

1.mkdir-p Build

2.CD Build

3.cmake-gui.

Modify where cuda9.0 is cuda8.0

Configure-->generate, error, here because of my two OPENCV version of the conflict, you need to make a version switch.

OPENCV Version switching:

The original opencv3 in/usr/local/share/opencv, the new opencv2.4.13.5 under my home, executed

Export pkg_config_path=/home/ocean1101/workspace/packages/opencv-2.4.13.5/lib/pkgconfigexport LD_LIBRARY_ PATH=/home/ocean1101/workspace/packages/opencv-2.4.13.5/lib

See if the switch was successful with the following command:

pkg-config --modversion OpenCV

To modify the Gpu_flow CMakeLists.txt:

Add in the first few lines:

  1 2.4 )  2 set (Opencv_dir "/home/ocean1101/workspace/packages/opencv-2.4.13.5/build/install/")  3 Set (Cmake_prefix_path "/home/ocean1101/workspace/packages/opencv-2.4.13.5/build/install")  4 Set (CUDA_USE_ Static_cuda_runtime OFF)

Wherein,set (Cuda_use_static_cuda_runtime OFF) is because if not add this sentence, the compile will statically link cuda, if there is no CUDA static library will be error, plus after the dynamic link Cuda, CMake after modification. --Make-j24, OK, done.

Linux compiler Gpu_flow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.