Compiling PCL 1.7 on Ubuntu 16.04 , errors in CMake generated Makefile
Asked Answered
W

4

11

I'm trying to get PCL 1.7 (The point cloud library, not the other pcl) working on Ubuntu 16.04. I eventually hope to use for C++ stuff, but right now I'm just trying to get the examples working. I'm using the default compilers that came with Ubuntu (GNU 5.3.1), and Cmake version 3.5.2. I've been following the directions on PCL's website (here and here), but am currently stuck at the point where I use the 'make' command after letting Cmake build the things it wants to build. This is the error I get

[ 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 also gives me warnings when I'm building things, and those are here. They don't stop it from running, but they might be relevant.

-- 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.

Also, in case it's relevant, I did a potentially stupid thing earlier when it was giving me similar warnings about VTK. It was telling me that /user/bin/vtk was renamed or something, and it was. This version of VTK called itself vtk6. I tried to root around in the makefiles to find that and change it so Cmake would know to look for vtk6, but I couldn't find it anywhere, so I went into the bin and made a copy of vtk6 named vtk, and it stopped giving me a warning.

Other relevant versions of stuff I'm using are eigen3 3.2.92, boost 1.58.0, flan 1.8.4, vtk6, and libopenni2 version 2.2.0.3

Again, not sure how much of this is actually important, but better to be too specific than too vague IMO.

Wheaton answered 22/5, 2016 at 0:27 Comment(0)
D
15

This bug is still in 16.04, but there is a workaround.

  1. sudo apt install libproj-dev

  2. add the following line to your CMakeLists.txt file:
    list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

The first provides the necessary libproj.so, and the second fixes errors when linking against a nonexistent (and unnecessary) libvtkproj4.

The other errors about referenced files not existing appear to be harmless (or at least my project compiles despite having the same errors).

for more information, see:
https://bugs.launchpad.net/ubuntu/+source/pcl/+bug/1573174
https://bugs.launchpad.net/ubuntu/+source/vtk6/+bug/1573234

Dessau answered 14/10, 2016 at 4:8 Comment(0)
A
3

This solved the issue for me:

sudo apt-get install libproj-dev

Source: https://github.com/PointCloudLibrary/pcl/issues/1828

Antiquated answered 25/7, 2017 at 10:3 Comment(0)
S
2

There seems to be an issue with the installation with vtk6

described here : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819741

quick and dirty fix: make a symbolic link libproj.so in the requested directory:

sudo ln -s  /usr/lib/x86_64-linux-gnu/libproj.so.<your-version> /usr/lib/x86_64-linux-gnu/libproj.so
Splashy answered 23/5, 2016 at 10:7 Comment(4)
That does seem to be one of the errors, unfortunately the quick and dirty fix you suggested didn't work. I'm going to try and find an older version of VTK and see if that works. I'll report back later with results.Wheaton
Using VTK 6.3 got rid of a few of the errors, but not enough to get it working. I've tried enough new things It'd be best to post my new issues as a new question entirely. To all who may come after: sorry, this didn't quite work.Wheaton
@BrandonPowers: you might want to post the link of the new question here. I got my pcl 1.7 compiled on a similar architecture so I might be able to help you out.Splashy
@BrandonPowers, I was wondering whether you managed to resolve this? I'm facing the same issue (also on 16.04). I dealt with the libproj and vtk problems via symlink but libvtkRenderingPythonTkWidgets.so doesn't exist on my system. Did you post another question? Thanks.Maryellen
C
0

This is an issue with Ubuntu when installing PCL. but there is an alternative solution for the two problems

  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

Calibre answered 21/6, 2021 at 22:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.