introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.78k stars 787 forks source link

make error #592

Closed aaravrav142 closed 4 years ago

aaravrav142 commented 4 years ago

Hi, I am getting the following make error when building rtabmap from source on ubuntu 16 with ROS kinetic. I have previously source installed opencv 3.5 with extra features and CUDA= 1 with no error or build failures. Can you check what could be the problem

cmake .. output is as follows

~/extra_lib/rtabmap/build$ cmake ..
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- PCL definitions don't contain "-march=native", make sure all libraries using Eigen are also compiled without that flag to avoid some segmentation faults (with gdb referring to some Eigen functions).
-- Found Sqlite3: /usr/include /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Found OpenMP
-- Found OpenCV: /opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv
-- Found PCL: /usr/include/pcl-1.7;/usr/include/eigen3;/usr/include;/usr/include/ni;/usr/include/openni2;/usr/include/vtk-6.2;/usr/include/freetype2;/usr/include/x86_64-linux-gnu/freetype2;/usr/include/jsoncpp;/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent;/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include;/usr/lib/openmpi/include;/usr/lib/openmpi/include/openmpi;/usr/include/python2.7;/usr/include/x86_64-linux-gnu;/usr/include/hdf5/openmpi;/usr/include/libxml2;/usr/include/tcl
-- Found ZLIB: /usr/include
-- VTK_RENDERING_BACKEND=OpenGL
-- Found Freenect: /opt/ros/kinetic/include/libfreenect
-- Found OpenNI2: /usr/include/openni2
-- Found DC1394: /usr/include/dc1394
-- Old g2o version detected with c++03 interface (config file: /opt/ros/kinetic/include/g2o/config.h).
-- Found g2o: /opt/ros/kinetic/include;/usr/include/suitesparse;/usr/include/suitesparse
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   serialization
--   system
--   filesystem
--   thread
--   program_options
--   date_time
--   timer
--   chrono
--   regex
--   atomic
-- GTSAM include directory:  /usr/local/lib/cmake/GTSAM/../../../include
-- FlyCapture2_INCLUDE_DIR=FlyCapture2_INCLUDE_DIR-NOTFOUND
-- FlyCapture2_LIBRARY=FlyCapture2_LIBRARY-NOTFOUND
-- Triclops_INCLUDE_DIR=Triclops_INCLUDE_DIR-NOTFOUND
-- Triclops_LIBRARY=Triclops_LIBRARY-NOTFOUND
-- FlyCaptureBridge_LIBRARY=FlyCaptureBridge_LIBRARY-NOTFOUND
-- Found cvsba: /usr/local/include
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   filesystem
--   system
--   program_options
--   date_time
--   chrono
--   atomic
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   filesystem
--   system
--   program_options
--   date_time
--   chrono
--   atomic
-- Found libpointmatcher: /usr/local/include;/usr/include;/usr/include/eigen3;/usr/local/include
-- A library with BLAS API found.
-- Found CUDA: /usr/local/cuda-10.0 (found suitable version "10.0", minimum required is "10") 
-- Found ZED sdk: /usr/local/zed/include
-- Found CUDA: /usr/local/cuda-10.0 (found version "10.0") 
-- Found CUDA: /usr/local/cuda-10.0/include
-- Found RealSense: /opt/ros/kinetic/include
-- Found RealSense2: 
-- Found octomap 1.8.1: /opt/ros/kinetic/include
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.2.92 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.14.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
-- Using CATKIN_DEVEL_PREFIX: /home/arav/extra_lib/rtabmap/build/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.12", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/arav/extra_lib/rtabmap/build/test_results
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
CMake Warning (dev) at /usr/src/gmock/CMakeLists.txt:40 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    PROJECT_VERSION
    PROJECT_VERSION_MAJOR
    PROJECT_VERSION_MINOR
    PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/src/gtest/CMakeLists.txt:42 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    PROJECT_VERSION
    PROJECT_VERSION_MAJOR
    PROJECT_VERSION_MINOR
    PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python2 (found version "2.7.12") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.20
-- BUILD_SHARED_LIBS is on
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Found vins: /home/arav/catkin_ws/src/VINS-Fusion/vins_estimator/src;/opt/ros/kinetic/include;/usr/include;/opt/ros/kinetic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv;/home/arav/catkin_ws/src/VINS-Fusion/camera_models/include
-- Architecture: x86_64
-- Found Pthreads
-- --------------------------------------------
-- Info :
--   Version : 0.20.3
--   CMAKE_INSTALL_PREFIX = /usr/local
--   CMAKE_BUILD_TYPE =     Release
--   CMAKE_INSTALL_LIBDIR = lib
--   BUILD_APP =            ON
--   BUILD_TOOLS =          ON
--   BUILD_EXAMPLES =       ON
--   BUILD_SHARED_LIBS =    ON
--   CMAKE_CXX_FLAGS =  -fmessage-length=0  -fopenmp -std=c++11
--   FLANN_KDTREE_MEM_OPT = OFF
--   PCL_DEFINITIONS = -DEIGEN_USE_NEW_STDVECTOR;-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET;-DFLANN_STATIC;-Dqh_QHpointer
--   PCL_VERSION = 1.7.2
-- 
-- Optional dependencies ('*' affects some default parameters) :
--  *With OpenCV 3.3.1 xfeatures2d = YES, nonfree = YES (License: Non commercial)
--   With Qt 5.5.1            = YES (License: Open Source or Commercial)
--   With VTK 6.2              = YES (License: BSD)
--   With external SQLite3     = YES (License: Public Domain)
--   With ORB OcTree           = YES (License: GPLv3)
--   With SupertPoint          = NO (libtorch not found)
--   With Python3              = NO (WITH_PYMATCHER=OFF)
--   With Madgwick             = YES (License: GPL)
--   With FastCV               = NO (FastCV not found)
-- 
--  Solvers:
--   With TORO                 = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike])
--  *With g2o                  = YES (License: BSD)
--  *With GTSAM                = YES (License: BSD)
--  *With Ceres                = YES (License: BSD)
--   With VERTIGO              = YES (License: GPLv3)
--   With cvsba                = YES (License: GPLv2)
--  *With libpointmatcher      = YES (License: BSD)
-- 
--  Reconstruction Approaches:
--   With OCTOMAP              = YES (License: BSD)
--   With CPUTSDF              = NO (CPUTSDF not found)
--   With OpenChisel           = NO (open_chisel not found)
--   With AliceVision          = NO (WITH_ALICE_VISION=OFF)
-- 
--  Camera Drivers:
--   With Freenect             = YES (License: Apache v2 and/or GPLv2)
--   With OpenNI2              = YES (License: Apache v2)
--   With Freenect2            = NO (libfreenect2 not found)
--   With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found)
--   With Kinect for Azure     = NO (Kinect for Azure SDK not found)
--   With dc1394               = YES (License: LGPL)
--   With FlyCapture2/Triclops = NO (Point Grey SDK not found)
--   With ZED                  = YES
--   With RealSense            = YES (License: Apache-2)
--   With RealSenseSlam        = NO (WITH_REALSENSE_SLAM=OFF)
--   With RealSense2           = YES (License: Apache-2)
--   With MyntEyeS             = NO (mynteye s sdk not found)
-- 
--  Odometry Approaches:
--   With loam_velodyne        = NO (loam_velodyne not found)
--   With libfovis             = NO (libfovis not found)
--   With libviso2             = NO (libviso2 not found)
--   With dvo_core             = NO (dvo_core not found)
--   With okvis                = NO (okvis not found)
--   With msckf_vio            = NO (WITH_MSCKF_VIO=OFF)
--   With VINS-Fusion          = YES (License: GPLv3)
--   With ORB_SLAM2            = NO (WITH_G2O should be OFF as ORB_SLAM2 uses its own g2o version)
-- Show all options with: cmake -LA | grep WITH_
-- --------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/arav/extra_lib/rtabmap/build

build error is as follows

[ 82%] Built target rtabmap_gui
[ 82%] Linking CXX executable ../../../bin/rtabmap-reprocess
.../../../bin/librtabmap_core.so.0.20.3: undefined reference to `.cv::cuda::/DescriptorMatcher:.:createBFMatcher.(int/)../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher'(
int).'.
/....//....//.bin./librtabmap_core.so.0.20.3/bin:/ librtabmap_core.so.0.20.3undefined:  referenceundefined  toreference  `tocv: :`cudacv::::cudaORB::::ORBcreate:(:int,create (floatint,,  float, int, intint,,  intint,,  intint,,  intint,,  intint,,  intint,,  intbool,) 'bool
.).'/
....//....//bin./.librtabmap_core.so.0.20.3/:bin /undefinedlibrtabmap_core.so.0.20.3 reference:  undefinedto  reference`cv :to: xfeatures2d`:cv::matchGMS:(xfeatures2dcv::::matchGMSSize_(<cvint:>: Size_const<&int,> const cv::Size_&, <cvint:>: Size_const<&int,>  stdconst:&:,vector <stdcv::::vectorKeyPoint<,cv :std::KeyPoint:,allocator <stdcv::::allocatorKeyPoint<>cv :>: KeyPointconst>& ,>  stdconst:&:,vector <stdcv:::vector:KeyPoint, <cvstd::::allocator<cvKeyPoint, :std:::KeyPointallocator>< cv>: :constKeyPoint&>,  >std :const:vector&<,cv :std::DMatch:,vector <stdcv::::allocatorDMatch<,cv :std::DMatch:>allocator <>cv :const:&DMatch,>  std>: :constvector&<,cv :std::DMatch:,vector <stdcv::::allocatorDMatch<,cv :std::DMatch:allocator<> >cv&::DMatch, > bool,>& ,bool ,bool ,double )bool',
 .double.)/'.
.././..../bin//.librtabmap_core.so.0.20.3.:/ binundefined/ librtabmap_core.so.0.20.3reference:  toundefined  `referencecv :to: Mat`:cv::updateContinuityFlag:(Mat):':
updateContinuityFlag()'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::ORB::create(int, float, int, int, int, int, int, int, int, bool)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::xfeatures2d::matchGMS(cv::Size_<int> const&, cv::Size_<int> const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> >&, bool, bool, double)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::Mat::updateContinuityFlag()'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
tools/Camera/CMakeFiles/camera.dir/build.make:553: recipe for target '../bin/rtabmap-camera' failed
make[2]: *** [../bin/rtabmap-camera] Error 1
tools/KittiDataset/CMakeFiles/kitti_dataset.dir/build.make:553: recipe for target '../bin/rtabmap-kitti_dataset' failed
make[2]: *** [../bin/rtabmap-kitti_dataset] Error 1
CMakeFiles/Makefile2:2675: recipe for target 'tools/Camera/CMakeFiles/camera.dir/all' failed
make[1]: *** [tools/Camera/CMakeFiles/camera.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:2787: recipe for target 'tools/KittiDataset/CMakeFiles/kitti_dataset.dir/all' failed
make[1]: *** [tools/KittiDataset/CMakeFiles/kitti_dataset.dir/all] Error 2
tools/Recovery/CMakeFiles/recovery.dir/build.make:553: recipe for target '../bin/rtabmap-recovery' failed
make[2]: *** [../bin/rtabmap-recovery] Error 1
CMakeFiles/Makefile2:2955: recipe for target 'tools/Recovery/CMakeFiles/recovery.dir/all' failed
make[1]: *** [tools/Recovery/CMakeFiles/recovery.dir/all] Error 2
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::ORB::create(int, float, int, int, int, int, int, int, int, bool)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::xfeatures2d::matchGMS(cv::Size_<int> const&, cv::Size_<int> const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> >&, bool, bool, double)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::Mat::updateContinuityFlag()'
collect2: error: ld returned 1 exit status
tools/ConsoleApp/CMakeFiles/consoleApp.dir/build.make:553: recipe for target '../bin/rtabmap-console' failed
make[2]: *** [../bin/rtabmap-console] Error 1
CMakeFiles/Makefile2:2509: recipe for target 'tools/ConsoleApp/CMakeFiles/consoleApp.dir/all' failed
make[1]: *** [tools/ConsoleApp/CMakeFiles/consoleApp.dir/all] Error 2
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::ORB::create(int, float, int, int, int, int, int, int, int, bool)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::xfeatures2d::matchGMS(cv::Size_<int> const&, cv::Size_<int> const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> >&, bool, bool, double)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::Mat::updateContinuityFlag()'
collect2: error: ld returned 1 exit status
tools/EurocDataset/CMakeFiles/euroc_dataset.dir/build.make:554: recipe for target '../bin/rtabmap-euroc_dataset' failed
make[2]: *** [../bin/rtabmap-euroc_dataset] Error 1
CMakeFiles/Makefile2:2899: recipe for target 'tools/EurocDataset/CMakeFiles/euroc_dataset.dir/all' failed
make[1]: *** [tools/EurocDataset/CMakeFiles/euroc_dataset.dir/all] Error 2
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::ORB::create(int, float, int, int, int, int, int, int, int, bool)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::xfeatures2d::matchGMS(cv::Size_<int> const&, cv::Size_<int> const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> >&, bool, bool, double)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::Mat::updateContinuityFlag()'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::ORB::create(int, float, int, int, int, int, int, int, int, bool)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::xfeatures2d::matchGMS(cv::Size_<int> const&, cv::Size_<int> const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> >&, bool, bool, double)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::Mat::updateContinuityFlag()'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/build.make:553: recipe for target '../bin/rtabmap-rgbd_dataset' failed
tools/StereoEval/CMakeFiles/stereoEval.dir/build.make:553: recipe for target '../bin/rtabmap-stereoEval' failed
make[2]: *** [../bin/rtabmap-rgbd_dataset] Error 1
make[2]: *** [../bin/rtabmap-stereoEval] Error 1
CMakeFiles/Makefile2:2731: recipe for target 'tools/StereoEval/CMakeFiles/stereoEval.dir/all' failed
make[1]: *** [tools/StereoEval/CMakeFiles/stereoEval.dir/all] Error 2
CMakeFiles/Makefile2:2843: recipe for target 'tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/all' failed
make[1]: *** [tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/all] Error 2
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::cuda::ORB::create(int, float, int, int, int, int, int, int, int, bool)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::xfeatures2d::matchGMS(cv::Size_<int> const&, cv::Size_<int> const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, std::vector<cv::DMatch, std::allocator<cv::DMatch> >&, bool, bool, double)'
../../../bin/librtabmap_core.so.0.20.3: undefined reference to `cv::Mat::updateContinuityFlag()'
collect2: error: ld returned 1 exit status
tools/Reprocess/CMakeFiles/reprocess.dir/build.make:555: recipe for target '../bin/rtabmap-reprocess' failed
make[2]: *** [../bin/rtabmap-reprocess] Error 1
CMakeFiles/Makefile2:3011: recipe for target 'tools/Reprocess/CMakeFiles/reprocess.dir/all' failed
make[1]: *** [tools/Reprocess/CMakeFiles/reprocess.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
matlabbe commented 4 years ago

cmake is building against opencv binaries from kinetic:

Found OpenCV: /opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv

You are also building with VINS-Fusion:

--   With VINS-Fusion          = YES (License: GPLv3)

If VINS-Fusion has been built with your other OpenCV version with CUDA, then there is a problem of mismatch opencv version between rtabmap and its dependencies. If you do cmake -DWITH_VINS=OFF, is it able to build correctly with opencv binaries?

Note that even if you force rtabmap to build against your opencv version, make sure to rebuild also your cv_bridge package because you will have the same problems with rtabmap and rtabmap_ros not linking on same opencv version.

When you have a custom opencv setup like this, it is better to just uninstall all your opencv system binaries, and rebuild all packages depending on opencv so that everyone are linking on same opencv version.

aaravrav142 commented 4 years ago

Ok following your advice, I rebuilt all libraries again to properly link with the rtabmap and rtabmap_ros. It built successfully this time.

Thank you for the help.