cmake on OpenCV with CUDA compiles from scratch everytime [closed]
I compiled successfully OpenCV with CUDA supports with make
(it hits 100%, no error returned).
However, if I run make
again or make install
it recompiles everything from the beginning, while when I don't use CUDA support usually what happens is that it compiles only the changed parts of the source code (and nothing is changed).
These are mine cmake options (I only need to run cv::xfeatures2d::surf
and cuda::surf
so most of the modules are disabled):
cmake -G "Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_INSTALL_PREFIX=...
-D OPENCV_EXTRA_MODULES_PATH=... -DWITH_LAPACK=OFF -DWITH_TBB=OFF -DWITH_OPENMP=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_photo=OFF
-D BUILD_opencv_python=OFF -D BUILD_opencv_python2=OFF -D BUILD_opencv_stitching=OFF -D BUILD_opencv_superres=OFF
-D BUILD_opencv_ts=OFF -D BUILD_opencv_videostab=OFF -D BUILD_opencv_viz=OFF -D BUILD_opencv_viz=off -D BUILD_opencv_world=off -D BUILD_opencv_aruco=OFF -D BUILD_opencv_bgsegm=OFF
-D BUILD_opencv_bioinspired=OFF -D BUILD_opencv_ccalib=OFF -D BUILD_opencv_cnn_3dobj=OFF -D BUILD_opencv_contrib_world=OFF -D BUILD_opencv_cvv=OFF -D BUILD_opencv_datasets=OFF
-D BUILD_opencv_dnn=OFF -D BUILD_opencv_dnns_easily_fooled=OFF -D BUILD_opencv_dpm=OFF -D BUILD_opencv_face=OFF -D BUILD_opencv_freetype=OFF -D BUILD_opencv_fuzzy=OFF
-D BUILD_opencv_hdf=OFF -D BUILD_opencv_line_descriptor=OFF -D BUILD_opencv_matlab=OFF -D BUILD_opencv_optflow=OFF -D BUILD_opencv_phase_unwrapping=OFF -D BUILD_opencv_plot=OFF -D BUILD_opencv_reg=OFF -D BUILD_opencv_rgbd=OFF
-D BUILD_opencv_saliency=OFF -D BUILD_opencv_sfm=OFF -D BUILD_opencv_stereo=OFF -D BUILD_opencv_structured_light=OFF -D BUILD_opencv_surface_matching=OFF -D BUILD_opencv_text=OFF -D BUILD_opencv_tracking=OFF -D BUILD_opencv_ximgproc=OFF
-D BUILD_opencv_xobject_detect=OFF -D BUILD_opencv_xphoto=OFF -D WITH_CUDA=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D BUILD_EXAMPLES=YES ..
Why this happens?
I experience the same behaviour also, guess it has to do with the fact that in the meanwhile your CUDA runtime could have changed and thus you always want binaries working exactly for that runtime.