introlab / rtabmap

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

compile failed when set CMAKE_BUILD_TYPE to Debug #339

Closed Maxinjun closed 6 years ago

Maxinjun commented 6 years ago

Hi, I want to debug the lrtabmap, but it occur a issue when I set CMAKE_BUILD_TYPE to Debug, log as following, -- 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 imported target "vtk" references the file "/usr/bin/vtk" but this file does not exist. Possible reasons include:

-- 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: /usr/local/include;/usr/local/include/opencv -- Found PCL: /usr/include/pcl-1.7;/usr/local/include/eigen3;/usr/include;/usr/include/ni;/usr/include/openni2;/usr/include/vtk-6.2;/usr/include/x86_64-linux-gnu;/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/freetype2;/usr/include/x86_64-linux-gnu/freetype2;/usr/include/jsoncpp;/usr/include/hdf5/openmpi;/usr/include/libxml2;/usr/include/python2.7;/usr/include/tcl -- Found ZLIB: /usr/include -- VTK_RENDERING_BACKEND=OpenGL -- Found freenect2: /home/maxj/freenect2/include -- Found OpenNI2: /usr/include/openni2 -- Found DC1394: /usr/include/dc1394 CMake Warning at cmake_modules/FindG2O.cmake:122 (MESSAGE): Latest g2o version detected with c++11 interface (config file: /usr/local/include/g2o/config.h). Make sure g2o is built with "-DBUILD_WITH_MARCH_NATIVE=OFF" to avoid segmentation faults caused by Eigen. Call Stack (most recent call first): CMakeLists.txt:349 (FIND_PACKAGE)

-- Found g2o: /usr/local/include;/usr/include/suitesparse;/usr/include/suitesparse -- GTSAM include directory: /usr/local/lib/cmake/GTSAM/../../../include;/usr/include;/usr/local/include/eigen3 -- 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 -- Found octomap 1.9.0: /usr/local/include -- Found Pthreads ========OCTOMAP_FOUND===================


-- Info : -- Version : 0.18.1 -- CMAKE_INSTALL_PREFIX = /usr/local -- CMAKE_BUILD_TYPE = Debug -- 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 -- PCL_DEFINITIONS = -DEIGEN_USE_NEW_STDVECTOR;-DEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET;-DFLANN_STATIC;-Dqh_QHpointer -- Optional dependencies ('' affects some default parameters) : -- With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = YES (License: Non commercial) -- With external SQLite3 = YES (License: Public Domain) -- With Freenect = NO (libfreenect not found) -- With OpenNI2 = YES (License: Apache v2) -- With Freenect2 = YES (License: Apache v2 and/or GPLv2) -- With Kinect for Windows 2 = NO (Kinect for Windows 2 SDK not found) -- With dc1394 = YES (License: LGPL) -- With FlyCapture2/Triclops = NO (Point Grey SDK not found) -- With TORO = YES (License: Creative Commons [Attribution-NonCommercial-ShareAlike]) -- With g2o = YES (License: BSD) -- With GTSAM = YES (License: BSD) -- With VERTIGO = YES (License: GPLv3) -- With cvsba = YES (License: GPLv2) -- *With libpointmatcher = NO (libpointmatcher not found) -- With loam_velodyne = NO (loam_velodyne not found) -- With ZED = NO (ZED sdk not found) -- With RealSense = NO (librealsense not found) -- With RealSense2 = NO (librealsense2 not found) -- With OCTOMAP = YES (License: BSD) -- With CPUTSDF = NO (CPUTSDF not found) -- With OpenChisel = NO (open_chisel 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 ORB_SLAM2 = NO (WITH_G2O should be OFF as ORB_SLAM2 uses its own g2o version) -- With Qt5 = YES (License: Open Source or Commercial)


-- Configuring done -- Generating done -- Build files have been written to: /home/maxj/SLAM/rtabmap/build [ 5%] Built target rtabmap_utilite [ 6%] Built target res_tool [ 7%] Built target imagesJoiner [ 7%] Built target extractObject [ 43%] Built target rtabmap_core [ 43%] Linking CXX executable ../../../bin/rtabmap-reprocess [ 46%] Linking CXX executable ../../../bin/rtabmap-kitti_dataset [ 46%] Linking CXX executable ../../../bin/rtabmap-bow_mapping [ 46%] Linking CXX executable ../../../bin/rtabmap-stereoEval [ 46%] Linking CXX executable ../../../bin/rtabmap-camera [ 44%] Linking CXX executable ../../../bin/rtabmap-recovery [ 46%] Linking CXX executable ../../../bin/rtabmap-console [ 46%] Linking CXX executable ../../../bin/rtabmap-rgbd_dataset [ 46%] Linking CXX executable ../../../bin/rtabmap-euroc_dataset [ 47%] Linking CXX executable ../../../bin/rtabmap-detectMoreLoopClosures [ 48%] Linking CXX executable ../../../bin/rtabmap-rgbd_camera [ 48%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/DatabaseViewer.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference to rtabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/Recovery/CMakeFiles/recovery.dir/build.make:474: recipe for target '../bin/rtabmap-recovery' failed make[2]: *** [../bin/rtabmap-recovery] Error 1 CMakeFiles/Makefile2:1043: recipe for target 'tools/Recovery/CMakeFiles/recovery.dir/all' failed make[1]: *** [tools/Recovery/CMakeFiles/recovery.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 48%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/CloudViewer.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference tortabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/Camera/CMakeFiles/camera.dir/build.make:474: recipe for target '../bin/rtabmap-camera' failed make[2]: [../bin/rtabmap-camera] Error 1 CMakeFiles/Makefile2:707: recipe for target 'tools/Camera/CMakeFiles/camera.dir/all' failed make[1]: [tools/Camera/CMakeFiles/camera.dir/all] Error 2 [ 48%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/ExportCloudsDialog.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference to rtabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/KittiDataset/CMakeFiles/kitti_dataset.dir/build.make:474: recipe for target '../bin/rtabmap-kitti_dataset' failed make[2]: *** [../bin/rtabmap-kitti_dataset] Error 1 CMakeFiles/Makefile2:875: recipe for target 'tools/KittiDataset/CMakeFiles/kitti_dataset.dir/all' failed make[1]: *** [tools/KittiDataset/CMakeFiles/kitti_dataset.dir/all] Error 2 [ 49%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/GraphViewer.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference tortabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status examples/BOWMapping/CMakeFiles/bow_mapping.dir/build.make:474: recipe for target '../bin/rtabmap-bow_mapping' failed make[2]: [../bin/rtabmap-bow_mapping] Error 1 CMakeFiles/Makefile2:1583: recipe for target 'examples/BOWMapping/CMakeFiles/bow_mapping.dir/all' failed make[1]: [examples/BOWMapping/CMakeFiles/bow_mapping.dir/all] Error 2 [ 49%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/ParametersToolBox.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference to rtabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/EurocDataset/CMakeFiles/euroc_dataset.dir/build.make:475: recipe for target '../bin/rtabmap-euroc_dataset' failed make[2]: *** [../bin/rtabmap-euroc_dataset] Error 1 CMakeFiles/Makefile2:987: recipe for target 'tools/EurocDataset/CMakeFiles/euroc_dataset.dir/all' failed make[1]: *** [tools/EurocDataset/CMakeFiles/euroc_dataset.dir/all] Error 2 ../../../bin/librtabmap_cored.so.0.18.1: undefined reference tortabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/DetectMoreLoopClosures/CMakeFiles/detectMoreLoopClosures.dir/build.make:474: recipe for target '../bin/rtabmap-detectMoreLoopClosures' failed make[2]: [../bin/rtabmap-detectMoreLoopClosures] Error 1 CMakeFiles/Makefile2:1155: recipe for target 'tools/DetectMoreLoopClosures/CMakeFiles/detectMoreLoopClosures.dir/all' failed make[1]: [tools/DetectMoreLoopClosures/CMakeFiles/detectMoreLoopClosures.dir/all] Error 2 [ 49%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/DepthCalibrationDialog.cpp.o [ 49%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_MainWindow.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference to rtabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/Reprocess/CMakeFiles/reprocess.dir/build.make:476: recipe for target '../bin/rtabmap-reprocess' failed make[2]: *** [../bin/rtabmap-reprocess] Error 1 CMakeFiles/Makefile2:1099: recipe for target 'tools/Reprocess/CMakeFiles/reprocess.dir/all' failed make[1]: *** [tools/Reprocess/CMakeFiles/reprocess.dir/all] Error 2 [ 50%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/__/include/rtabmap/gui/moc_PreferencesDialog.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference tortabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/ConsoleApp/CMakeFiles/consoleApp.dir/build.make:474: recipe for target '../bin/rtabmap-console' failed make[2]: [../bin/rtabmap-console] Error 1 CMakeFiles/Makefile2:541: recipe for target 'tools/ConsoleApp/CMakeFiles/consoleApp.dir/all' failed make[1]: [tools/ConsoleApp/CMakeFiles/consoleApp.dir/all] Error 2 [ 50%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_DatabaseViewer.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference to rtabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/build.make:474: recipe for target '../bin/rtabmap-rgbd_dataset' failed make[2]: *** [../bin/rtabmap-rgbd_dataset] Error 1 CMakeFiles/Makefile2:931: recipe for target 'tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/all' failed make[1]: *** [tools/RgbdDataset/CMakeFiles/rgbd_dataset.dir/all] Error 2 [ 50%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/__/include/rtabmap/gui/moc_ImageView.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference tortabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/StereoEval/CMakeFiles/stereoEval.dir/build.make:474: recipe for target '../bin/rtabmap-stereoEval' failed make[2]: [../bin/rtabmap-stereoEval] Error 1 CMakeFiles/Makefile2:819: recipe for target 'tools/StereoEval/CMakeFiles/stereoEval.dir/all' failed make[1]: [tools/StereoEval/CMakeFiles/stereoEval.dir/all] Error 2 [ 50%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_PdfPlot.cpp.o ../../../bin/librtabmap_cored.so.0.18.1: undefined reference to `rtabmap::RtabmapColorOcTree::RtabmapColorOcTreeMemberInit' collect2: error: ld returned 1 exit status tools/CameraRGBD/CMakeFiles/rgbd_camera.dir/build.make:474: recipe for target '../bin/rtabmap-rgbd_camera' failed make[2]: [../bin/rtabmap-rgbd_camera] Error 1 CMakeFiles/Makefile2:763: recipe for target 'tools/CameraRGBD/CMakeFiles/rgbd_camera.dir/all' failed make[1]: [tools/CameraRGBD/CMakeFiles/rgbd_camera.dir/all] Error 2 [ 51%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_StatsToolBox.cpp.o [ 51%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_ProgressDialog.cpp.o [ 52%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/utilite/moc_UPlot.cpp.o [ 52%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/utilite/moc_UImageView.cpp.o [ 52%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_CloudViewer.cpp.o [ 53%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_OdometryViewer.cpp.o [ 53%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_LoopClosureViewer.cpp.o [ 53%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_DataRecorder.cpp.o [ 54%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_CameraViewer.cpp.o [ 54%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_CalibrationDialog.cpp.o [ 54%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_ExportDialog.cpp.o [ 55%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_PostProcessingDialog.cpp.o [ 55%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_ExportCloudsDialog.cpp.o [ 55%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_ExportBundlerDialog.cpp.o [ 56%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_MapVisibilityWidget.cpp.o [ 56%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_GraphViewer.cpp.o [ 57%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_CreateSimpleCalibrationDialog.cpp.o [ 57%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_ParametersToolBox.cpp.o [ 57%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_DepthCalibrationDialog.cpp.o [ 58%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/3rdParty/moc_QMultiComboBox.cpp.o [ 58%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_TexturingState.cpp.o [ 58%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir//include/rtabmap/gui/moc_RecoveryState.cpp.o [ 59%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/__/include/rtabmap/gui/moc_EditDepthArea.cpp.o [ 59%] Building CXX object guilib/src/CMakeFiles/rtabmap_gui.dir/qrc_GuiLib.cpp.o [ 59%] Linking CXX shared library ../../../bin/librtabmap_guid.so [ 86%] Built target rtabmap_gui Makefile:149: recipe for target 'all' failed make: *** [all] Error 2

I checked that OCTOMAP_FOUND is true and I add "#include <rtabmap/core/OctoMap.h>" but it can not work BTW it compile successully when CMAKE_BUILD_TYPE is true.

Maxinjun commented 6 years ago

I uninstall OctoMap and it works fine, I do not get the reason ^^

matlabbe commented 6 years ago

I reproduced the same error in Debug mode. Instead of uninstalling OctoMap, you could also just uncheck WITH_OCTOMAP option with cmake-gui, or add -DWITH_OCTOMAP=OFF on cmake command line.

Anyway, I fixed the error in this commit.

Thx for reporting! Mathieu