【问题标题】:Compiling PCL 1.7 on Ubuntu 16.04 , errors in CMake generated Makefile在 Ubuntu 16.04 上编译 PCL 1.7,CMake 中的错误生成 Makefile
【发布时间】:2016-09-19 01:23:10
【问题描述】:

我正在尝试让 PCL 1.7(点云库,而不是其他 pcl)在 Ubuntu 16.04 上运行。我最终希望用于 C++ 的东西,但现在我只是想让这些示例正常工作。我正在使用 Ubuntu (GNU 5.3.1) 和 Cmake 3.5.2 版附带的默认编译器。我一直在遵循 PCL 网站上的指示(herehere),但目前我停留在让 Cmake 构建它想要构建的东西之后使用“make”命令的地步。这是我得到的错误

[ 50%] Building CXX object CMakeFiles/pcd_write.dir/pcd_write.cpp.o
<command-line>:0:15: warning: missing whitespace after the macro name
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'pcd_write'.  Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pcd_write.dir/all' failed
make[1]: *** [CMakeFiles/pcd_write.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

当我构建东西时,Cmake 也会给我警告,这些都在这里。它们不会阻止它运行,但它们可能是相关的。

-- Found OpenNI2: /usr/lib/libOpenNI2.so  
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- 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.

另外,如果它是相关的,当它给我关于 VTK 的类似警告时,我做了一件可能很愚蠢的事情。它告诉我 /user/bin/vtk 已重命名或其他什么,它确实如此。这个版本的 VTK 自称为 vtk6。我试图在makefile中找到并更改它,以便Cmake知道寻找vtk6,但我无法在任何地方找到它,所以我进入bin并制作了一个名为vtk的vtk6副本,它停止了给我一个警告。

我正在使用的其他相关版本是 eigen3 3.2.92、boost 1.58.0、flan 1.8.4、vtk6 和 libopenni2 版本 2.2.0.3

同样,不确定其中有多少实际上是重要的,但最好是过于具体而不是过于模糊的 IMO。

【问题讨论】:

    标签: c++ ubuntu makefile cmake point-cloud-library


    【解决方案1】:

    此错误仍在 16.04 中,但有一个解决方法。

    1. sudo apt install libproj-dev

    2. 将以下行添加到您的 CMakeLists.txt 文件中:
      list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

    第一个提供必要的libproj.so,第二个修复链接到不存在(和不必要的)libvtkproj4 时的错误。

    关于不存在的引用文件的其他错误似乎是无害的(或者至少我的项目编译尽管有相同的错误)。

    欲了解更多信息,请参阅:
    https://bugs.launchpad.net/ubuntu/+source/pcl/+bug/1573174
    https://bugs.launchpad.net/ubuntu/+source/vtk6/+bug/1573234

    【讨论】:

      【解决方案2】:

      这为我解决了这个问题:

      sudo apt-get install libproj-dev
      

      来源:https://github.com/PointCloudLibrary/pcl/issues/1828

      【讨论】:

        【解决方案3】:

        vtk6 的安装似乎有问题

        在这里描述: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819741

        快速而肮脏的修复: 在请求的目录中创建符号链接 libproj.so:

        sudo ln -s  /usr/lib/x86_64-linux-gnu/libproj.so.<your-version> /usr/lib/x86_64-linux-gnu/libproj.so
        

        【讨论】:

        • 这似乎是错误之一,不幸的是,您建议的快速而肮脏的修复没有奏效。我将尝试找到旧版本的 VTK,看看是否可行。我稍后会报告结果。
        • 使用 VTK 6.3 消除了一些错误,但还不足以让它正常工作。我已经尝试了足够多的新事物最好将我的新问题完全作为一个新问题发布。致所有可能会来的人:对不起,这不太奏效。
        • @BrandonPowers:您可能想在此处发布新问题的链接。我的 pcl 1.7 在类似的架构上编译,所以我可以帮助你。
        • @BrandonPowers,我想知道您是否设法解决了这个问题?我面临同样的问题(也在 16.04)。我通过符号链接处理了libprojvtk 问题,但我的系统上不存在libvtkRenderingPythonTkWidgets.so。您是否发布了另一个问题?谢谢。
        【解决方案4】:

        这是安装 PCL 时 Ubuntu 的问题。但是对于这两个问题还有另一种解决方案

        1. /usr/lib/cmake/vtk-6.2/VTKTargets.cmake

        sudo update-alternatives --install /usr/bin/vtk vtk /usr/bin/vtk6 10

        1. libvtkRenderingPythonTkWidgets.so

        sudo ln -s /usr/lib/python2.7/dist-packages/vtk/libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so /usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so

        【讨论】:

          猜你喜欢
          • 2016-12-07
          • 2016-08-30
          • 1970-01-01
          • 1970-01-01
          • 2019-06-17
          • 1970-01-01
          • 2016-10-13
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多