Skip to content

make error with opencv-3.4.0: fatal error: opencv2/xfeatures2d/cuda.hpp: No such file or directory #1534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BKZero opened this issue Jan 26, 2018 · 14 comments

Comments

@BKZero
Copy link

BKZero commented Jan 26, 2018

System information (version)

my cmake configuration is:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/opt/local/ \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D INSTALL_C_EXAMPLES=ON \
    -D PYTHON_EXCUTABLE=/usr/bin/python \
    -D OPENCV_EXTRA_MODULES_PATH=~/Program/opencv-3.4.0/opencv_contrib-3.4.0/modules \
    -D WITH_CUDA=OFF \
    -D WITH_CUFFT=OFF \
    -D WITH_CUBLAS=OFF \
    -D WITH_TBB=ON \
    -D WITH_V4L=ON \
    -D WITH_QT=ON \
    -D WITH_GTK=ON \
    -D WITH_OPENGL=ON \
    -D BUILD_EXAMPLES=ON ..

but when i make -j8, i got error:

Scanning dependencies of target opencv_sfm_pch_dephelp
Generating MOC source opencv_cvv_autogen/YMUSIMSHSW/moc_overlayfilterwidget.cpp
[ 10%] Built target opencv_test_videostab_pch_dephelp
[ 10%] Building CXX object modules/optflow/CMakeFiles/opencv_optflow_pch_dephelp.dir/opencv_optflow_pch_dephelp.cxx.o
Scanning dependencies of target numeric
[ 10%] Building CXX object modules/optflow/CMakeFiles/opencv_test_optflow_pch_dephelp.dir/opencv_test_optflow_pch_dephelp.cxx.o
[ 10%] Linking CXX static library ../../lib/libopencv_xfeatures2d_pch_dephelp.a
[ 10%] Building CXX object modules/sfm/CMakeFiles/opencv_sfm_pch_dephelp.dir/opencv_sfm_pch_dephelp.cxx.o
[ 10%] Linking CXX static library ../../lib/libopencv_perf_xfeatures2d_pch_dephelp.a
[ 10%] Building CXX object modules/sfm/src/libmv/libmv/numeric/CMakeFiles/numeric.dir/numeric.cc.o
[ 10%] Built target opencv_xfeatures2d_pch_dephelp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_histogram.cpp
Scanning dependencies of target opencv_stitching_pch_dephelp
[ 10%] Built target opencv_perf_xfeatures2d_pch_dephelp
[ 10%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching_pch_dephelp.dir/opencv_stitching_pch_dephelp.cxx.o
[ 10%] Generate files for Python bindings and documentation
In file included from /home/zero/Program/opencv-3.4.0/modules/stitching/include/opencv2/stitching.hpp:49:0,
                 from /home/zero/Program/opencv-3.4.0/modules/stitching/src/precomp.hpp:59,
                 from /home/zero/Program/opencv-3.4.0/build/modules/stitching/opencv_stitching_pch_dephelp.cxx:1:
/home/zero/Program/opencv-3.4.0/modules/stitching/include/opencv2/stitching/detail/matchers.hpp:52:42: fatal error: opencv2/xfeatures2d/cuda.hpp: No such file or directory
 #  include "opencv2/xfeatures2d/cuda.hpp"
                                          ^
compilation terminated.
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_histogramoptpanel.cpp
[ 10%] Linking CXX static library ../../lib/libopencv_bgsegm_pch_dephelp.a
[ 10%] Linking CXX static library ../../lib/libopencv_perf_ximgproc_pch_dephelp.a
[ 10%] Built target opencv_bgsegm_pch_dephelp
[ 10%] Generating precomp.hpp.gch/opencv_core_RELEASE.gch
[ 10%] Linking CXX static library ../../lib/libopencv_ximgproc_pch_dephelp.a
[ 10%] Built target opencv_perf_ximgproc_pch_dephelp
[ 10%] Generating precomp.hpp.gch/opencv_ts_RELEASE.gch
[ 10%] Built target opencv_ximgproc_pch_dephelp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_cvvkeypoint.cpp
[ 10%] Generating precomp.hpp.gch/opencv_imgproc_RELEASE.gch
make[2]: *** [modules/stitching/CMakeFiles/opencv_stitching_pch_dephelp.dir/opencv_stitching_pch_dephelp.cxx.o] Error 1
make[1]: *** [modules/stitching/CMakeFiles/opencv_stitching_pch_dephelp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 10%] Building CXX object modules/sfm/src/libmv/libmv/numeric/CMakeFiles/numeric.dir/poly.cc.o
[ 10%] Linking CXX static library ../../lib/libopencv_test_bgsegm_pch_dephelp.a
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_cvvmatch.cpp
[ 10%] Linking CXX static library ../../lib/libopencv_test_aruco_pch_dephelp.a
[ 10%] Linking CXX static library ../../lib/libopencv_test_ximgproc_pch_dephelp.a
[ 10%] Built target opencv_test_bgsegm_pch_dephelp
[ 10%] Built target opencv_test_aruco_pch_dephelp
[ 10%] Built target opencv_test_ximgproc_pch_dephelp
[ 10%] Linking CXX static library ../../lib/libopencv_face_pch_dephelp.a
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_cvvpointmatch.cpp
[ 10%] Built target opencv_face_pch_dephelp
[ 10%] Linking CXX static library ../../lib/libopencv_perf_optflow_pch_dephelp.a
[ 10%] Linking CXX static library ../../lib/libopencv_optflow_pch_dephelp.a
[ 10%] Built target opencv_perf_optflow_pch_dephelp
[ 11%] Linking CXX static library ../../lib/libopencv_test_face_pch_dephelp.a
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_falsecolorkeypointpen.cpp
[ 11%] Built target opencv_optflow_pch_dephelp
[ 11%] Built target opencv_test_face_pch_dephelp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointintervallselection.cpp
[ 11%] Linking CXX static library ../../../../../../lib/libnumeric.a
[ 11%] Built target numeric
[ 12%] Linking CXX static library ../../lib/libopencv_sfm_pch_dephelp.a
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointmanagement.cpp
[ 12%] Linking CXX static library ../../lib/libopencv_test_optflow_pch_dephelp.a
[ 12%] Built target opencv_sfm_pch_dephelp
[ 12%] Built target opencv_test_optflow_pch_dephelp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointselection.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointselectionselector.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointsettings.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointsettingsselector.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointshowsetting.cpp
[ 12%] Built target gen_opencv_python_source
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_keypointvaluechooser.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchintervallselection.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchmanagement.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchscene.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchselection.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchselectionselector.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchsettings.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchsettingsselector.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_matchshowsetting.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_rawview_window.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_showinrawviewwidget.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_singlecolorkeypointpen.cpp
Generating MOC source opencv_cvv_autogen/76EPU3OZ3M/moc_singlecolormatchpen.cpp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_signalslot.cpp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_stfl_query_widget.cpp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_stfl_query_widget_completer.cpp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_stfl_query_widget_lineedit.cpp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_synczoomwidget.cpp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_zoomableimage.cpp
Generating MOC source opencv_cvv_autogen/FU2MQGIDOS/moc_zoomableimageoptpanel.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_defaultfilterview.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_dual_filter_view.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_filter_view.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_image_view.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_linematchview.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_match_view.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_pointmatchview.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_rawview.cpp
[ 12%] Built target pch_Generate_opencv_ts
[ 12%] Built target pch_Generate_opencv_imgproc
[ 12%] Built target pch_Generate_opencv_core
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_singlefilterview.cpp
Generating MOC source opencv_cvv_autogen/3JYSCEOBDA/moc_translationsmatchview.cpp
Generating MOC compilation opencv_cvv_autogen/moc_compilation.cpp
[ 12%] Built target opencv_cvv_autogen
make: *** [all] Error 2


the error line is:
In file included from /home/zero/Program/opencv-3.4.0/modules/stitching/include/opencv2/stitching.hpp:49:0,
                 from /home/zero/Program/opencv-3.4.0/modules/stitching/src/precomp.hpp:59,
                 from /home/zero/Program/opencv-3.4.0/build/modules/stitching/opencv_stitching_pch_dephelp.cxx:1:
/home/zero/Program/opencv-3.4.0/modules/stitching/include/opencv2/stitching/detail/matchers.hpp:52:42: fatal error: opencv2/xfeatures2d/cuda.hpp: No such file or directory
 #  include "opencv2/xfeatures2d/cuda.hpp"
                                          ^
compilation terminated.
@BKZero
Copy link
Author

BKZero commented Jan 26, 2018

I have search for other issue about this problem and try those solution but it does not work for me. and most of them is for opencv 3.2

@cshang412
Copy link

i met the same problem , i have no idea

@PumayHui
Copy link

PumayHui commented Aug 2, 2018

the same problem...

@Firststep2014
Copy link

Firststep2014 commented Aug 2, 2018

I've come across the same issue, and solved by

cmake -DBUILD_opencv_xfeatures2d=OFF ..

according to #1131

@telesoho
Copy link

telesoho commented Nov 6, 2018

the same problem for 3.4.3

@orzel
Copy link

orzel commented Jul 14, 2019

-DBUILD_opencv_xfeatures2d=OFF is not a "solution". The contrib xfeatures2d is not supposed to depend on CUDA, does it ?

@northeastsquare
Copy link

解决办法:
在CMakeLists.txt增加以下内容:

INCLUDE_DIRECTORIES("/works/opencv-3.4.0/opencv_contrib-3.4.0/modules/xfeatures2d/include")
1
CMakeLists.txt文件所在路径为:

<你的路径>/opencv-3.4.0/modules/stitching/ CMakeLists.txt
————————————————
版权声明:本文为CSDN博主「Colin.Tan」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_33475105/article/details/82819850

@zhangyugsy
Copy link

My solution is that copying the folder"modules/xfeatures2d/include/opencv2/" to the area where the error occurs.

@renjiahao0928
Copy link

I used the way that copying the folder"modules/xfeatures2d/include/opencv2/" to the area ,however ,I failed.so,who has the better way?

@shaber2017
Copy link

I used the way that copying the folder"modules/xfeatures2d/include/opencv2/" to the area ,however ,I failed.so,who has the better way?

copy folder? I copy the complete path where cuda.hpp is to the area where the error, I get success on make.

@renjiahao0928
Copy link

I used the way that copying the folder"modules/xfeatures2d/include/opencv2/" to the area ,however ,I failed.so,who has the better way?

copy folder? I copy the complete path where cuda.hpp is to the area where the error, I get success on make.

could you please show your complete path to me? i really don't know where the path of the cuda.hpp is.thanks

@shaber2017
Copy link

I used the way that copying the folder"modules/xfeatures2d/include/opencv2/" to the area ,however ,I failed.so,who has the better way?

copy folder? I copy the complete path where cuda.hpp is to the area where the error, I get success on make.

could you please show your complete path to me? i really don't know where the path of the cuda.hpp is.thanks

okay, I added this path "/home/cw/mytool/opencv-3.4.6/opencv_contrib-3.4.6/modules/xfeatures2d/include/opencv2/xfeatures2d/cuda.hpp" replacing 52 line that is "opencv2/xfeatures2d/cuda.hpp" in file which path is "opencv-3.4.0/modules/stitching/include/opencv2/stitching/detail/matchers.hpp"

@rancheng
Copy link

what I did in my docker is to do this:

sed -i '6i  INCLUDE_DIRECTORIES\(\"/root/opencv_contrib-3.4.1/modules/xfeatures2d/include\"\)' /root/opencv/modules/stitching/CMakeLists.txt

Please modify the line number 6i and /root/opencv_contrib-3.4.1 based on your custom version.

@yeyanan93
Copy link

yeyanan93 commented Aug 5, 2022

@rancheng If I just write
sed -i '6i INCLUDE_DIRECTORIES("/root/opencv_contrib-3.4.1/modules/xfeatures2d/include")' /root/opencv/modules/stitching/CMakeLists.txt
Can it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests