Point Cloud Library on Ubuntu 16.04 LTS


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
           -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \
           -DCMAKE_INSTALL_PREFIX=/usr ..

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


53 thoughts on “Point Cloud Library on Ubuntu 16.04 LTS

  1. Prarthana Bataju

    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.

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

  3. Akash

    I get this error after running cmake

    The following sub-systems will not be built:
    visualization: VTK not found

    Please help

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

  5. Jorgen

    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!

  6. Rico

    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!



  7. B S Nagabhushana

    This guide was extremely useful to me. I could install PCL on ubuntu 16.04. However, the following support could not be installed:
    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.

  8. Funky

    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

  9. M H

    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!

  10. Kevin

    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,

  11. Ibrahim Shaikh

    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

    • CH.Hsu

      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”

  12. SLAM Dev

    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

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

  14. 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
    -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \

  15. Shantnu Kakkar

    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′

  16. Leonard

    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?

  17. Kristijan

    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?

  18. Marten

    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

Leave a Reply