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

OpenCV 3.2.0 build issue with CUDA 8.0 odometry.cpp:41:45: fatal error: unsupported/Eigen/MatrixFunctions: No such file or directory #8402

Closed
halt9 opened this issue Mar 16, 2017 · 6 comments
Labels

Comments

@halt9
Copy link

halt9 commented Mar 16, 2017

I'm using 3.2.0 (on contrib as well) and CUDA 8.0 on 64-bit Ubuntu 16.04. My cmake command is:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D WITH_CUDA=ON \
    -D ENABLE_FAST_MATH=1 \
    -D CUDA_FAST_MATH=1 \
    -D WITH_CUBLAS=1 \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
    -D BUILD_EXAMPLES=ON ..

Which leads to the error:

/home/username/opencv_contrib/modules/rgbd/src/odometry.cpp:41:45: fatal error: unsupported/Eigen/MatrixFunctions: No such file or directory
compilation terminated.
modules/rgbd/CMakeFiles/opencv_rgbd.dir/build.make:62: recipe for target 'modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o' failed
make[2]: *** [modules/rgbd/CMakeFiles/opencv_rgbd.dir/src/odometry.cpp.o] Error 1
CMakeFiles/Makefile2:18631: recipe for target 'modules/rgbd/CMakeFiles/opencv_rgbd.dir/all' failed
make[1]: *** [modules/rgbd/CMakeFiles/opencv_rgbd.dir/all] Error 2

I've looked for the fixes on similar issues like #6676, #6500, #6592 etc. and they don't work.

I'm willing to switch to 3.1.0 but that has similar build issues. Eigen (libeigen3-dev) is installed, by the way. Cmake outputs: Use Eigen: YES (ver 3.2.1)

System information (version)
  • OpenCV => 3.2.0
  • Operating System / Platform => 64-bit Ubuntu 16.04
  • Compiler => gcc 5.4.0

Output of Cmake:


-- Detected version of GNU GCC: 54 (504)
-- FP16: Feature disabled
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Checking for module 'libavresample'
--   No package 'libavresample' found
-- Checking for module 'libgphoto2'
--   No package 'libgphoto2' found
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/username/opencv/build/3rdparty/ippicv/ippicv_lnx
-- CUDA detected: 8.0
-- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-D_FORCE_INLINES
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing:  Atlas_CLAPACK_INCLUDE_DIR)
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Found apache ant 1.9.6: /usr/bin/ant
-- Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Caffe:   NO
-- Protobuf:   YES
-- Glog:   NO
-- Looking for tiny_dnn.h
-- Looking for tiny_dnn.h - not found
-- Module opencv_dnn_modern disabled because tiny-dnn was not found
-- freetype2:   YES
-- harfbuzz:    YES
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
-- Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
-- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
-- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
-- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
-- freetype2:   YES
-- harfbuzz:    YES
-- Checking for modules 'tesseract;lept'
--   No package 'tesseract' found
--   No package 'lept' found
-- Tesseract:   NO
-- Check contents of vgg_generated_48.i ...
-- Check contents of vgg_generated_64.i ...
-- Check contents of vgg_generated_80.i ...
-- Check contents of vgg_generated_120.i ...
-- Check contents of boostdesc_bgm.i ...
-- Check contents of boostdesc_bgm_bi.i ...
-- Check contents of boostdesc_bgm_hd.i ...
-- Check contents of boostdesc_binboost_064.i ...
-- Check contents of boostdesc_binboost_128.i ...
-- Check contents of boostdesc_binboost_256.i ...
-- Check contents of boostdesc_lbgm.i ...
--
-- General configuration for OpenCV 3.2.0-dev =====================================
--   Version control:               3.2.0-313-g502aa1f
--
--   Extra modules:
--     Location (extra):            /home/username/opencv_contrib/modules
--     Version control (extra):     3.2.0-144-g34f910b
--
--   Platform:
--     Timestamp:                   2017-03-16T17:30:57Z
--     Host:                        Linux 4.4.0-64-generic x86_64
--     CMake:                       3.5.1
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               RELEASE
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /usr/bin/c++  (ver 5.4.0)
--     C++ flags (Release):         -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 -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -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 -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):
--     Linker flags (Debug):
--     ccache:                      NO
--     Precompiled headers:         YES
--     Extra dependencies:          /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libtiff.so /usr/lib/x86_64-linux-gnu/libjasper.so /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so gtk-3 gdk-3 pangocairo-1.0 pango-1.0 atk-1.0 cairo-gobject cairo gdk_pixbuf-2.0 gio-2.0 gobject-2.0 glib-2.0 gthread-2.0 gstbase-0.10 gstreamer-0.10 gmodule-2.0 xml2 gstvideo-0.10 gstapp-0.10 gstriff-0.10 gstpbutils-0.10 dc1394 avcodec avformat avutil swscale freetype harfbuzz /usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5.so /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libsz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so dl m pthread rt cudart nppc nppi npps cublas cufft -L/usr/local/cuda/lib64
--     3rdparty dependencies:       libwebp libprotobuf
--
--   OpenCV modules:
--     To be built:                 cudev core cudaarithm flann hdf imgproc ml reg surface_matching video cudabgsegm cudafilters cudaimgproc cudawarping dnn freetype fuzzy imgcodecs photo shape videoio cudacodec highgui objdetect plot ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo datasets rgbd stereo superres tracking videostab xfeatures2d ximgproc aruco optflow phase_unwrapping stitching structured_light java python2
--     Disabled:                    world contrib_world
--     Disabled by dependency:      -
--     Unavailable:                 python3 viz cnn_3dobj cvv dnn_modern matlab sfm
--
--   GUI:
--     QT:                          NO
--     GTK+ 3.x:                    YES (ver 3.18.9)
--     GThread :                    YES (ver 2.48.2)
--     GtkGlExt:                    NO
--     OpenGL support:              NO
--     VTK support:                 NO
--
--   Media I/O:
--     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
--     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.54)
--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.6)
--     JPEG 2000:                   /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
--     OpenEXR:                     /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2.2.0)
--     GDAL:                        NO
--     GDCM:                        NO
--
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  YES (ver 2.2.4)
--     FFMPEG:                      YES
--       avcodec:                   YES (ver 55.68.100)
--       avformat:                  YES (ver 55.44.100)
--       avutil:                    YES (ver 52.90.101)
--       swscale:                   YES (ver 2.6.100)
--       avresample:                NO
--     GStreamer:
--       base:                      YES (ver 0.10.36)
--       video:                     YES (ver 0.10.36)
--       app:                       YES (ver 0.10.36)
--       riff:                      YES (ver 0.10.36)
--       pbutils:                   YES (ver 0.10.36)
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     Aravis SDK:                  NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    NO/YES
--     XIMEA:                       NO
--     Xine:                        NO
--     gPhoto2:                     NO
--
--   Parallel framework:            pthreads
--
--   Other third-party libraries:
--     Use IPP:                     9.0.1 [9.0.1]
--          at:                     /home/username/opencv/build/3rdparty/ippicv/ippicv_lnx
--     Use IPP Async:               NO
--     Use VA:                      NO
--     Use Intel VA-API/OpenCL:     NO
--     Use Lapack:                  NO
--     Use Eigen:                   YES (ver 3.2.1)
--     Use Cuda:                    YES (ver 8.0)
--     Use OpenCL:                  YES
--     Use OpenVX:                  NO
--     Use custom HAL:              NO
--
--   NVIDIA CUDA
--     Use CUFFT:                   YES
--     Use CUBLAS:                  YES
--     USE NVCUVID:                 NO
--     NVIDIA GPU arch:             20 30 35 37 50 52 60 61
--     NVIDIA PTX archs:
--     Use fast math:               YES
--
--   OpenCL:                        <Dynamic loading of OpenCL library>
--     Include path:                /home/username/opencv/3rdparty/include/opencl/1.2
--     Use AMDFFT:                  NO
--     Use AMDBLAS:                 NO
--
--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.12)
--     Libraries:                   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.12)
--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.0)
--     packages path:               lib/python2.7/dist-packages
--
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.5.2)
--
--   Python (for build):            /usr/bin/python2.7
--
--   Java:
--     ant:                         /usr/bin/ant (ver 1.9.6)
--     JNI:                         /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
--     Java wrappers:               YES
--     Java tests:                  YES
--
--   Matlab:                        Matlab not found or implicitly disabled
--
--   Documentation:
--     Doxygen:                     /usr/bin/doxygen (ver 1.8.11)
--
--   Tests and samples:
--     Tests:                       YES
--     Performance tests:           YES
--     C/C++ Examples:              YES
--
--   Install path:                  /usr/local
--
--   cvconfig.h is in:              /home/username/opencv/build
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/username/opencv/build

@alalek
Copy link
Member

alalek commented Mar 16, 2017

There are several workarounds/options:

  1. disable rgbd module (cmake -DBUILD_opencv_rgbd=OFF ...)
  2. disable eigen support (cmake -DWITH_EIGEN=OFF ...)
  3. try to disable CUDA, but probably this will not help.
  4. into odometry.cpp add "#undef HAVE_EIGEN" statement after including of precomp.hpp.

BTW, We are able to build OpenCV with Eigen on Ubuntu 16.04 (but Eigen version is 3.2.92)

@halt9
Copy link
Author

halt9 commented Mar 16, 2017

I have Eigen v3.3 installed, so I have no idea where cmake is pulling that 3.2.1 from...

@alalek
Copy link
Member

alalek commented Mar 16, 2017

Try to build from scratch (clean build directory) - CMake caches some things.

@halt9
Copy link
Author

halt9 commented Mar 17, 2017

That didn't solve my issue, but that's probably on my end.

That being said, -DWITH_EIGEN=OFF did solve my issue and I don't really need Eigen, so this issue is effectively resolved for me.

@arpu
Copy link

arpu commented Mar 27, 2017

hi
i use this on fedora 23 maybe it helps on ubuntu too
(custom installed gcc 5.3)

cmake -DENABLE_PRECOMPILED_HEADERS=OFF -D CUDA_NVCC_FLAGS='-std=c++11 -ccbin /opt/gcc-5.3.0/bin/g++ -D_FORCE_INLINES -Xcompiler -D__CORRECT_ISO_CPP11_MATH_H_PROTO -Xcompiler -D__CORRECT_ISO_CPP11_MATH_H_PROTO --expt-relaxed-constexpr' ..

@halt9 halt9 closed this as completed May 11, 2017
@mshabunin mshabunin added invalid and removed category: build/install category: contrib Target patches to **opencv_contrib** repository: https://github.com/opencv/opencv_contrib labels Sep 5, 2017
@craigstar
Copy link

craigstar commented Jan 27, 2018

I met this problem and I solved it easily!
Just read the error message, it says header file unsupported/Eigen/MatrixFunctions not Found!

so with eigen3 we downloaded, (use apt-get, default location is usr/include/eigen3/) there are two folders in eigen3/, 1. Eigen, 2. unsupported. (my Eigen is 3.2.92).

Solution: copy both of these folders to /usr/include. (I assume you have already put Eigen in /usr/include, that's what tutorial usually says. leaving unsupported in usr/include/eigen3 folder is like hiding it, system can not find it.)

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

No branches or pull requests

5 participants