构建 MRPT 库时 cmake 配置失败

Posted

技术标签:

【中文标题】构建 MRPT 库时 cmake 配置失败【英文标题】:cmake configuration failed while building MRPT library 【发布时间】:2020-02-22 10:38:30 【问题描述】:

我正在尝试安装 MRPT,尤其是在 PL-SLAM 文档中推荐的提交 0c3d605c3c;但是,我在构建 repo 时总是遇到 cmake 错误。有没有办法解决这个问题?您的帮助将不胜感激。

系统信息:

Linux rock 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Cmake 输出:

-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:33 (cmake_policy):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Architecture (uname -m): x86_64
-- Kernel name (uname -s): Linux
CMake Error at cmakemodules/script_detect_gcc.cmake:16 (LIST):
  LIST GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:83 (include)


CMake Error at cmakemodules/script_detect_gcc.cmake:17 (LIST):
  LIST GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:83 (include)


-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Looking for timegm
-- Looking for timegm - found
-- Looking for _mkgmtime
-- Looking for _mkgmtime - not found
-- Looking for alloca
-- Looking for alloca - not found
-- Looking for gettid
-- Looking for gettid - not found
-- Looking for sincos
-- Looking for sincos - found
-- Looking for lrint
-- Looking for lrint - found
-- Looking for erf
-- Looking for erf - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for linux/serial.h
-- Looking for linux/serial.h - found
-- Looking for linux/input.h
-- Looking for linux/input.h - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for winsock2.h
-- Looking for winsock2.h - not found
-- Looking for windows.h>
#include <winusb.h
-- Looking for windows.h>
#include <winusb.h - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long double
-- Check size of long double - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so  
-- Found wxWidgets: -L/usr/lib/x86_64-linux-gnu;-pthread;;;-lwx_baseu-3.0;-lwx_gtk2u_core-3.0;-lwx_gtk2u_gl-3.0;-lwx_gtk2u_adv-3.0;-lwx_gtk2u_aui-3.0;-lwx_gtk2u_html-3.0 (found version "3.0.4") 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so  
-- Performing Test PCAP_LINKS_SOLO
-- Performing Test PCAP_LINKS_SOLO - Success
-- Looking for pcap_get_pfring_id
-- Looking for pcap_get_pfring_id - not found
fatal: not a git repository (or any parent up to mount point /mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- 
-- List of MRPT libs/modules to be built (and dependencies):
-- -----------------------------------------------------------------
--   mrpt-base :  
--   mrpt-bayes : mrpt-base   (header-only)
--   mrpt-detectors : mrpt-vision;mrpt-maps;mrpt-gui;mrpt-slam;mrpt-base;mrpt-opengl;mrpt-obs 
--   mrpt-graphs : mrpt-base   (header-only)
--   mrpt-graphslam : mrpt-graphs;mrpt-base   (header-only)
--   mrpt-gui : mrpt-opengl;mrpt-base 
--   mrpt-hmtslam : mrpt-slam;mrpt-graphslam;mrpt-graphs;mrpt-vision;mrpt-maps;mrpt-base;mrpt-obs;mrpt-opengl 
--   mrpt-hwdrivers : mrpt-base;mrpt-maps;mrpt-obs;mrpt-gui;mrpt-opengl;mrpt-maps;mrpt-vision 
--   mrpt-kinematics : mrpt-opengl;mrpt-base 
--   mrpt-maps : mrpt-obs;mrpt-opengl;mrpt-base 
--   mrpt-nav : mrpt-graphs;mrpt-maps;mrpt-kinematics;mrpt-obs;mrpt-opengl;mrpt-base 
--   mrpt-reactivenav : mrpt-nav;mrpt-graphs;mrpt-maps;mrpt-obs;mrpt-opengl;mrpt-base   (meta-lib)
--   mrpt-obs : mrpt-opengl;mrpt-base 
--   mrpt-opengl : mrpt-base 
--   mrpt-slam : mrpt-bayes;mrpt-graphs;mrpt-vision;mrpt-tfest;mrpt-maps;mrpt-obs;mrpt-opengl;mrpt-base 
--   mrpt-tfest : mrpt-base 
--   mrpt-scanmatching : mrpt-tfest;mrpt-base   (meta-lib)
--   mrpt-topography : mrpt-base;mrpt-obs;mrpt-opengl;mrpt-tfest 
--   mrpt-vision : mrpt-obs;mrpt-opengl;mrpt-base;mrpt-opengl 
-- 
-- +===========================================================================+
-- |         Resulting configuration for MRPT 1.5.0                            |
-- +===========================================================================+
--  _________________________ PLATFORM _____________________________
--  Host                        : Linux5.3.0-40-genericx86_64
--  Is the system big endian?   :  No 
--  Word size (32/64 bit)       : 64
--  CMake version               : 3.10.2
--  CMake generator             : Unix Makefiles
--  CMake build tool            : /usr/bin/make
date: invalid date ‘@’
--  MRPT SOURCE_DATE_EPOCH      :  ()
--  Compiler                    : GNU
--  Configuration               : Release
-- C++ flags (Release):     -isystem /usr/include/wx-3.0 -I /usr/include/wx-3.0 -isystem /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -isystem /usr/local/include/eigen3  -pthread -Wreturn-type -Wextra -Wno-unused-parameter  -Wall -Wno-long-long -Wno-variadic-macros -Wno-write-strings -std=c++11 -pthread  -O3 -mtune=native  -msse2 -funroll-loops -mfpmath=sse -msse3 -mssse3 -msse4.1 -msse4.2  -O3 -DNDEBUG
-- 
--  __________________________ OPTIONS _____________________________
--  Build MRPT as a shared library?   : Yes 
--  Use SIMD optimizations?           : SSE2=1 SSE3=1 SSE4.1=1 SSE4.2=1 SSE4a=0 [Automatic]
--  Install prefix                    : /usr/local
--  C++ config header                 : /mnt/data/mrpt/build/include/mrpt-config/unix/
-- 
--  ______________________ OPTIONAL LIBRARIES ______________________
--  Assimp (3D models)                   : Yes (System) [Version: 4.1.0]
--  eigen3                               : Yes (System) [Version: 3.1.0]
--  ffmpeg libs (Video streaming)        : Yes (System) [avcodec 57.107.100, avutil 55.78.100, avformat 57.83.100]
--  gtest (Google unit testing library)  : Yes (Built-in) 
--  Intel threading lib (TBB)            :  No 
--  lib3ds (3DStudio scenes)             : Yes (Built-in) 
--  libclang (for ConvertUTF)            : Yes (Built-in) 
--  libjpeg (jpeg)                       : Yes (System) 
--  liblas (ASPRS LAS LiDAR format)      :  No 
--  mexplus                              :  No 
--  OpenCV (Image manipulation)          : Yes (System) [Version: 4.2.0]
--  OpenGL                               : Yes (System) 
--  GLUT                                 : Yes (System) 
--  PCAP (Wireshark logs for Velodyne)   : Yes (System) 
--  PCL (Pointscloud library)            :  No [Version: ]
--  SuiteSparse                          : Yes 
--  wxWidgets                            : Yes (System) 
--  zlib (compression)                   : Yes (System) 
--  yamlcpp (YAML file format)           : Yes (System) [Version: 0.5.2]
-- 
--  _______________________ WRAPPERS/BINDINGS ______________________
--  Matlab / mex files         :  No [Version: ]
--  Python bindings (pymrpt)   : Yes 
--   - dep: Boost found?       : Yes 
--   - dep: PythonLibs found?  : Yes 
-- 
--  _____________________ HARDWARE & SENSORS _______________________
--  libdc1394-2 (FireWire capture)       : Yes (System) 
--  DUO3D Camera libs                    :  No 
--  libftdi (USB)                        : Yes (System) [Version: ]
--  National Instruments...
--  ...NIDAQmx?                          :  No 
--  ...NIDAQmx Base?                     :  No 
--  NITE2 library                        :  No 
--  OpenKinect libfreenect               : Yes (System) 
--  OpenNI2                              :  No 
--  PGR FlyCapture2                      :  No 
--  PGR Triclops                         :  No 
--  Phidgets                             :  No 
--  RoboPeak LIDAR                       : Yes 
--  SwissRanger 3/4000 3D camera         :  No 
--  Videre SVS stereo camera             :  No 
--  libudev (requisite for XSensMT4)     : Yes (System) 
--  xSENS MT 3rd generation              : Yes (Built-in) 
--  xSENS MT 4th generation              : Yes (Built-in) 
--  Intersense sensors                   :  No 
-- 
-- Configuring incomplete, errors occurred!
See also "/mnt/data/mrpt/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/data/mrpt/build/CMakeFiles/CMakeError.log".

【问题讨论】:

看起来他们在past 中有这样的问题。尝试使用较新的版本。 嗨@Tsyvarev,PL-SLAM 算法在他们的文档中写的那个提交上进行了测试;因此,该版本不太可能存在问题。 " 该版本不太可能存在问题。" - 您提到的提交日期为 2016 年。它根本无法针对仅在 2017 年发布的 gcc 版本 7 进行测试。(特别是在 2018 年底发布的 gcc 7.4)。 【参考方案1】:

有一个待处理的拉取请求here 解决了所有这些问题,但作者还没有合并它......显然他离开了这个行业并且太忙了:-)

签出该 PR 的代码并试一试。

依赖 stvo-pl 和 this pr 的情况完全相同。

【讨论】:

以上是关于构建 MRPT 库时 cmake 配置失败的主要内容,如果未能解决你的问题,请参考以下文章

当我链接动态库而不是静态库时,CMake 有效

在 CMake 中为多个配置混合构建标志

在构建Android库时,我可以使用什么模式来支持Activity中已配置的回调

CMake 多配置生成器使用错误的构建目录

为啥在 CMake 配置和生成完成后使用 CLion 构建 OpenCV 时会出现错误?

为 python 安装 Dlib 库时出错