My previous blog post described how to build PCL on Ubunut 14.04 LTS. Now Ubuntu has advanced to 16.04 LTS and PCL to version 1.8, so this post is dedicated to making this upgrade simple.
Update: a prebuilt DEB file for PCL 1.8 for Ubunut 16.04 is available here.
To install it, do
sudo dpkg -i PCL-1.8.0-Linux.deb
Now, if you like to try build it yourself, continue.
Setup Prerequisites
To prepare the software development on Ubuntu we need setup some prerequisite tools:
sudo apt-get update sudo apt-get install git build-essential linux-libc-dev sudo apt-get install cmake cmake-gui sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev sudo apt-get install mpi-default-dev openmpi-bin openmpi-common sudo apt-get install libflann1.8 libflann-dev sudo apt-get install libeigen3-dev sudo apt-get install libboost-all-dev sudo apt-get install libvtk5.10-qt4 libvtk5.10 libvtk5-dev sudo apt-get install libqhull* libgtest-dev sudo apt-get install freeglut3-dev pkg-config sudo apt-get install libxmu-dev libxi-dev sudo apt-get install mono-complete sudo apt-get install qt-sdk openjdk-8-jdk openjdk-8-jre
Build Point Cloud Library
Point Cloud Library is obtained by:
git clone https://github.com/PointCloudLibrary/pcl.git
Now you should find pcl
in your directory. Go into it and create a release directory and follow the cmake
build process:
cd pcl mkdir release cd release cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \ -DCMAKE_INSTALL_PREFIX=/usr .. make
The make
will take some time, so go get a cup of coffee or take that long overdue shower. Once the build finishes, install it by:
sudo make install
Here is a video tutorial on installing PCL in Ubuntu following the above and other necessary steps and include PCL Visualisation too.
Please have a look.
Hello larry,
Following your tutorial steps and others tutorial, I have made a video tutorial on installing PCL in Ubuntu.If you allow me then I will like to share my youtube link below the comments that might help others to solve the same problems.
Thank you in advance
Best Regards,
Prarthana
I get this error after running cmake
The following sub-systems will not be built:
visualization: VTK not found
Please help
VTK May have advanced to a new version.
Thanks for sharing ! By the way, how do I set up environment for debugging codes using pcl, such as development IDE (VS code or other IDE app). Any suggestion for it? Look forward to your reply. Thanks a lot.
Hi Larry,
I used your pre-compiled .deb package, but now i would like to compile my own from source. How do I remove the installed .deb package? I’m quite new to developing on linux 🙂 Thanks in advance!
You might try Google it.
Larry,
I also installed pre-compiled .deb package via:
$ sudo dpkg -i PCL-1.8.0-Linux.deb
and then I want to install from source. So I removed it with .deb package as:
$ sudo dpkg –remove
where is name by which the package installed, to find the name of package do this:
$ sudo apt-cache search pcl
it was installed as pcl only, so do;
$ sudo dpkg –remove pcl
Then follow the instructions to build from source as given here or refer to this answer:
https://askubuntu.com/questions/916260/how-to-install-point-cloud-library-v1-8-pcl-1-8-0-on-ubuntu-16-04-2-lts-for
Hi Larry,
Thank you for this post.
I’m having problems with “Linking CXX executable ../../bin/pcl_hdl_viewer_simple”.
I always get the following errors:
[ 41%] Linking CXX executable ../../bin/pcl_hdl_viewer_simple
CMakeFiles/pcl_hdl_viewer_simple.dir/hdl_viewer_simple.cpp.o: In function `void boost::this_thread::sleep<boost::date_time::subsecond_duration >(boost::date_time::subsecond_duration const&)’:
hdl_viewer_simple.cpp:(.text._ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000000EEEEEvRKT_[_ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000000EEEEEvRKT_]+0x2aa): undefined reference to `boost::this_thread::hidden::sleep_until(timespec const&)’
collect2: error: ld returned 1 exit status
visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/build.make:133: recipe for target ‘bin/pcl_hdl_viewer_simple’ failed
make[2]: *** [bin/pcl_hdl_viewer_simple] Error 1
CMakeFiles/Makefile2:1292: recipe for target ‘visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/all’ failed
make[1]: *** [visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/all] Error 2
Makefile:160: recipe for target ‘all’ failed
make: *** [all] Error 2
Could you please help me solve this?
Thank you in advance!
Regards,
Rico
Rico, it looks like you are missing some boost libraries.
Hello
I have this same problem, could you solve it?
I met the same problem, and try to install boost libraries, but it not works.
Hello
I have this same problem,is solved now?
This guide was extremely useful to me. I could install PCL on ubuntu 16.04. However, the following support could not be installed:
OpenNI2
FZAPI
ENSENSO
DSDK
DSSDK
RSSDK
These are HW related support (I guess) and should be okay. – Any inputs in this regard appreciated.
The build process could not build the following for reasons as follows:
cloud_compose – requires QVTK
point_cloud_editor – requires Qt4
in_hand_scanner – OpenNI not found
optronic_viewer – Qt not found
3d_reec_framework – OpenNI not found
modeler – VTK not built with Qt support
I guess this might cause problem, moving forward – Any inputs appreciated
Following subsystems did not built:
simulation – disabled by default
global_tests – No reason
I guess I need simulation subsystem and global_tests even for nominal hand-on on PCL – Any inputs in this regard, please
The build process did not find the package metslib – No clue on what this is and what is the impact – Support please.
Thanks for all the support.
Thank you for this guide, I was finally able to build pcl thanks to you! I had lot of trouble with including path to boost library. I’m running Ubuntu 16.10 and these are the packages I needed to install:
sudo apt install git build-essential linux-libc-dev cmake cmake-gui libusb-1.0-0-dev libusb-dev libudev-dev mpi-default-dev openmpi-bin openmpi-common libflann1.9 libflann-dev libeigen3-dev libboost-all-dev libvtk6.3-qt libvtk6.3 libvtk6-dev libqhull* libgtest-dev freeglut3-dev pkg-config libxmu-dev libxi-dev mono-complete qt-sdk openjdk-8-jdk openjdk-8-jre
I was going to install from your pre-built executable. But looks like it doesn’t find the installed files:
CMake Error at /usr/share/pcl-1.8/PCLConfig.cmake:45 (message):
PCL can not be found on this machine
Call Stack (most recent call first):
/usr/share/pcl-1.8/PCLConfig.cmake:774 (pcl_report_not_found)
CMakeLists.txt:4 (find_package)
— Configuring incomplete, errors occurred!
Same problem
Hi, thanks very much for this nicely written guide! The problem that I encountered was:
”
CMake Error: The source directory “/home/yanbo/pcl/release” does not appear to contain CMakeLists.txt.
Specify –help for usage, or press the help button on the CMake GUI.
”
What is the solution for this error? If a CMakeLists.txt is indeed needed, would you please post the contents in this file?
Thanks very much and looking forward to your reply,
Best regards,
In the release directory,
$ cmake-gui ..
or
$ cmake ..
Hi,
I am getting below error can u help me.
/home/shaikh/pcl-master/gpu/kinfu_large_scale/src/world_model.cpp:44:16: error: expected constructor, destructor, or type conversion before ‘(’ token
PCL_INSTANTIATE(WorldModel, (pcl::PointXYZ)(pcl::PointXYZI));
^
gpu/kinfu_large_scale/CMakeFiles/pcl_gpu_kinfu_large_scale.dir/build.make:184: recipe for target ‘gpu/kinfu_large_scale/CMakeFiles/pcl_gpu_kinfu_large_scale.dir/src/world_model.cpp.o’ failed
make[2]: *** [gpu/kinfu_large_scale/CMakeFiles/pcl_gpu_kinfu_large_scale.dir/src/world_model.cpp.o] Error 1
CMakeFiles/Makefile2:10423: recipe for target ‘gpu/kinfu_large_scale/CMakeFiles/pcl_gpu_kinfu_large_scale.dir/all’ failed
make[1]: *** [gpu/kinfu_large_scale/CMakeFiles/pcl_gpu_kinfu_large_scale.dir/all] Error 2
Makefile:160: recipe for target ‘all’ failed
make: *** [all] Error 2
I also met the problem in pcl-1.8.1rc2, fixed by cherry-pick a commit b3f3f5:”need to include instantiate.hpp to use PCL_INSTANTIATE”
Hello I would recommend using make -j7 as it becomes 10 times faster and uses your other cores.
Hello , Thank you for the tutorial it is interesting. I want to know if you have a tutorial explains how to install kinect V1 on ubuntu 16.04 lts x84
Thanks in advance
First install PCL on Ubuntu 16.04 by following the below,
https://larrylisky.com/2014/03/03/installing-pcl-on-ubuntu/
then checkout this page:
https://emotionrobots.com/2015/06/07/running-a-pcl-demo-with-microsoft-kinect-scott/
Thanks for the nice guidance. However, I am having the same trouble as Matt (visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/build.make:255: recipe for target ‘bin/pcl_hdl_viewer_simple’ failed
make[2]: *** [bin/pcl_hdl_viewer_simple] Error 1
).
I then tried your prebuilt binary and seems it set up the pcl. However, when I try to import PCL python can’t still find the module. Could you please suggest >
Python access to PCL require python binding. This can be created using a auto-wrapper generator like SWIG3.0. This is however beyond the scope of my blog.
Hi Larry,
The post is great. Can you show how to compile VTK7.1?
VTK5 is kind of old.
It seems like you can just update to VTK7 using apt and do a fresh cmake to have it automatically find the package.
https://launchpad.net/~elvstone/+archive/ubuntu/vtk7
Hi thanks heaps for the doco. Can I suggest moving the update to the top of the page? 😀
Also, to make the manual install idiot-proof, you might add “cd pcl” and line-continuation, as in:
cd pcl
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \
-DCMAKE_INSTALL_PREFIX=/usr ..
make
Good suggestions.
Please, can you help me?
I’m try install the PCL following your tutorials, but in 18% the make fails.
Output text >> http://pastebin.com/Hmpe7KgZ
I’ve installed the OpenNI like the first tutorial (from Ubuntu 14.04)
Thanks.
@LUCA did you install OPENNI? For OpenNI installation see: https://larrylisky.com/2014/03/03/installing-pcl-on-ubuntu/.
I am getting the following error at 16%:
[ 16%] Linking CXX executable ../../bin/pcl_convert_pcd_ascii_binary
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0′
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0′
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_num_locks@OPENSSL_1.0.0′
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_current_compression@OPENSSL_1.0.0′
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_free@OPENSSL_1.0.0′
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0′
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_version@OPENSSL_1.0.0′
See if this link helps…
http://stackoverflow.com/questions/35393206/linking-errors-with-qt-pcl-and-vtk
Hi, It seems to have been installed. VTK and libopenni arenb’t working as well as, QHULL, which I need for a project
@AVI For OpenNI installation see: https://larrylisky.com/2014/03/03/installing-pcl-on-ubuntu/. For VTK and QHULL they should be already installed if you follow the instruction in the blog.
Also I think PCL has updated the ubuntu package to 1.8, so you can just try ‘sudo apt-get install libpcl-dev’.
when installing the pcl from the DEB file i get some messages saying. This also happens when i try to compile
¨The imported target “vtkPythonCore” references the file “/usr/lib/libvtkPythonCore.so.5.10.1”
but this file does not exist.
This happens when the VTK libraries are installed. Is there a solution for this?
Try fix it with:
sudo apt-get -f install
make failed at 29% outputting the following – http://pastebin.com/10n5Gh4g – any help much appreciated as the PCL prebuilt binaries don’t seem to work anymore when running 16.04 Ubuntu.
See my update in the blog for a link to download PCL-1.8.0-Linux.deb.
Thanks for that. So do I install the prerequisite tools and then skip straight to the DEB?
Yes. If there are anything else missing dpkg will tell you.
I followed that and when I run cmake for the basic tutorial I get the following error http://pastebin.com/vYhBmPRg. I’ve been trying to get PCL installed and tried so many different methods. I’ve just had no luck with any of them!
There is a link to a prebuilt binary near the end of my blog.
On executing command:
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
i get ssl error:
ssl.SSLError: unknown error (_ssl.c:3053)
Can you please help me workaround it?
Sounds like a SSL certification issue. Google https://ubuntuforums.org/showthread.php?t=2113326 and others like it for solution.
THANK YOU. I can’t appreciate it more for this help I am used working on windows so I did not know how to find solution ie. what to search on stackoverflow.
You might want to add -j n (where n is the number of cpu cores you want to use) as this increases the compilation speed massively
This guide was extremely helpful to me! Great to have a list of all the required packages/steps to take.
Agreed! This was beautifully done. Thank you