Skip to content
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

ubuntu build make error #1950

Open
zkailinzhang opened this issue Dec 24, 2018 · 21 comments
Open

ubuntu build make error #1950

zkailinzhang opened this issue Dec 24, 2018 · 21 comments
Labels
incomplete question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org/

Comments

@zkailinzhang
Copy link

make -j8 error

Scanning dependencies of target opencv_test_ximgproc
/home/zkl/zklcode/code/pycv/opencv_contrib/modules/xfeatures2d/test/test_rotation_and_scale_invariance.cpp:7:82: fatal error: features2d/test/test_detectors_invariance.impl.hpp: No such file or directory
compilation terminated.
Scanning dependencies of target opencv_perf_xfeatures2d
modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/build.make:110: recipe for target 'modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_rotation_and_scale_invariance.cpp.o' failed
make[2]: *** [modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_rotation_and_scale_invariance.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Scanning dependencies of target opencv_test_aruco
[ 86%] Building CXX object modules/aruco/CMakeFiles/opencv_test_aruco.dir/test/test_misc.cpp.o
CMakeFiles/Makefile2:14780: recipe for target 'modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/all' failed
make[1]: *** [modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

@middlto
Copy link

middlto commented Apr 18, 2019

I meet a similar error, any suggestion?

cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=<opencv_contrib/modules> <opencv>

make -j4

/home/middlto/opencv/opencv-4.1.0/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp:51:62: fatal error: features2d/test/test_detectors_regression.impl.hpp: No such file or directory
 #include "features2d/test/test_detectors_regression.impl.hpp"

Opencv and opencv_contrib are both 4.1.0.

@alalek
Copy link
Member

alalek commented Apr 18, 2019

Complete compiler command line is required via VERBOSE=1 make.

@middlto
Copy link

middlto commented Apr 18, 2019

I solved it by copying opencv/modules/features2d to my build directory.

@nihuizhidao
Copy link

nihuizhidao commented May 30, 2019

I solved it by copying opencv/modules/features2d to my build directory.

@middlto
Hi middlto, many thanks to your answer, but I'm confused by your expression, can you explain more about this, do you mean copying opencv/modules/features2d/test into opencv/build/modules/features2d/test or ? Cause I still got error when make after doing this.

@lihuate
Copy link

lihuate commented Jul 1, 2019

I also have this problem.

@adong7639
Copy link

adong7639 commented Jul 3, 2019

I solve this problem

we can't find these file
//#include "features2d/test/test_detectors_regression.impl.hpp"
//#include "features2d/test/test_descriptors_regression.impl.hpp"

then modify the relative path to absolute path

#include "/data/raid/project/software/opencv4.0.0/modules/features2d/test/test_detectors_regression.impl.hpp"
#include "/data/raid/project/software/opencv4.0.0/modules/features2d/test/test_descriptors_regression.impl.hpp"

@alalek
Copy link
Member

alalek commented Jul 3, 2019

There are special lines to handle that.

Request is still the same:

Complete compiler command line is required via VERBOSE=1 make

@PeerXu
Copy link

PeerXu commented Jul 28, 2019

I got the error too.
Here is the log with VERBOSE=1 make

cd /home/pi/opt/opencv-4.1.0/build/modules/xfeatures2d && /usr/bin/c++  -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__OPENCV_TESTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MAC
ROS -I/home/pi/opt/opencv-4.1.0/build -I/home/pi/opt/opencv-4.1.0/modules/ts/include -I/home/pi/op
t/opencv_contrib-4.1.0/modules/xfeatures2d/include -I/home/pi/opt/opencv-4.1.0/modules/imgcodecs/include -I/home/pi/opt/opencv-4.1.0/modules/videoio/include -I/home/pi/opt/opencv-4.1.0/modules/core/include -I/home/pi/opt/opencv-4.1.0/modules/flann/include -I/home/pi/opt/opencv-4.1.0/modules/imgproc/include -I/home/pi/opt/opencv-4.1.0/modules/ml/include -I/home/pi/opt/opencv-4.1.0/modules/highgui/include -I/home/pi/opt/opencv-4.1.0/modules/features2d/include -I/home/pi/opt/opencv-4.1.0/modules/calib3d/include -I/home/pi/opt/opencv_contrib-4.1.0/modules/shape/include  -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG -fPIE   -std=c++11  -Winvalid-pch  -include "/home/pi/opt/opencv-4.1.0/build/modules/xfeatures2d/test_precomp.hpp" -o CMakeFiles/opencv_test_xfeatures2d.dir/test/test_features2d.cpp.o -c /home/pi/opt/opencv_contrib-4.1.0/modules/xfeatures2d/test/test_features2d.cpp             
/home/pi/opt/opencv_contrib-4.1.0/modules/xfeatures2d/test/test_features2d.cpp:51:10: fatal error: features2d/test/test_detectors_regression.impl.hpp: No such file or directory                   
 #include "features2d/test/test_detectors_regression.impl.hpp"                                   
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                   
compilation terminated.
make[2]: *** [modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/build.make:76: modules/xf
eatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_features2d.cpp.o] Error 1             

@alalek
Copy link
Member

alalek commented Aug 1, 2019

For some reason there is missing -I/home/pi/opt/opencv-4.1.0/modules compiler option in command line.

What is CMake version used?
Could you try to build without PCH support: cmake -DENABLE_PRECOMPILED_HEADERS=OFF ...?

@PeerXu
Copy link

PeerXu commented Aug 7, 2019

It seems like cmake building break by network problem. When I delete build folder and rebuild again, the problem is gone.

@gaunthan
Copy link

I solve this problem

we can't find these file
//#include "features2d/test/test_detectors_regression.impl.hpp"
//#include "features2d/test/test_descriptors_regression.impl.hpp"

then modify the relative path to bsolute path

#include "/data/raid/project/software/opencv4.0.0/modules/features2d/test/test_detectors_regression.impl.hpp"
#include "/data/raid/project/software/opencv4.0.0/modules/features2d/test/test_descriptors_regression.impl.hpp"

Same problem, and solved it by your method! Thanks!

It is a workaround to make the compilation continue. 😄

@alalek
Copy link
Member

alalek commented Oct 30, 2019

Workaround1: cmake -DBUILD_TESTS=OFF ...
Workaround2: cmake -DBUILD_opencv_xfeatures2d=OFF ...

What is version of CMake used?

@gaunthan
Copy link

Workaround: cmake -DBUILD_TESTS=OFF ...

What is version of CMake used?

Cmake 3.10.2.

And here is the command I used under directory opencv-4.1.2/build:

cmake -DOPENCV_EXTRA_MODULES_PATH=/home/kerry/workspace/opencv_contrib-4.1.2/modules -DOPENCV_GENERATE_PKGCONFIG=ON ..

Repositories are downloaded from corresponding release page.

@alalek
Copy link
Member

alalek commented Oct 31, 2019

Still can't reproduce with:

  • CMake 3.14.5
  • CMake 3.10.0

Please check for these lines in CMake output (no errors are expected)

-- xfeatures2d/boostdesc: Download: boostdesc_bgm.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
-- xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
-- xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
-- xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
-- xfeatures2d/vgg: Download: vgg_generated_48.i
-- xfeatures2d/vgg: Download: vgg_generated_64.i
-- xfeatures2d/vgg: Download: vgg_generated_80.i
-- xfeatures2d/vgg: Download: vgg_generated_120.i

and check "Unavailable" list of modules - xfeatures2d should not be in this list.
If it is there, then probably it is network problem (missing required external files)

@hzc1111
Copy link

hzc1111 commented Nov 4, 2019

我通过将opencv / modules / features2d复制到构建目录中来解决该问题。

yes,it works!just do it——Copy the 'features2d' directory from ‘’opencv / modules /‘’ to ‘build/’.
Thanks for solving my problem.

@thesamplecode
Copy link

i add “include_directories("${CMAKE_CURRENT_SOURCE_DIR}/modules")” in CMakelist.txt。it works also

walkthetalk added a commit to walkthetalk/meta-walkthetalk that referenced this issue Nov 24, 2019
please see: opencv/opencv_contrib#1950

Signed-off-by: Yi Qingliang <niqingliang2003@gmail.com>
@tellw
Copy link

tellw commented Dec 12, 2019

@nihuizhidao cp -r ~/opencv/modules/features2d ~/opencv/build
although i don't know how it works

@rossburton
Copy link

Looks like this mostly happens if there isn't any networking during the configure step.

@winman
Copy link

winman commented Jun 27, 2020

edit the file:
opencv/build/modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/build.make
by adding "-I/path/to/opencv/modules/" to the cpp.o rules

@xwr96
Copy link

xwr96 commented Sep 19, 2020

I solved it by copying opencv/modules/features2d to my build directory.

great!it solve my problem!

@karishmathumu
Copy link

Complete compiler command line is required via VERBOSE=1 make.

this worked and solved my errors while cmake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org/
Projects
None yet
Development

No branches or pull requests