Point Cloud Library on Ubuntu 16.04 LTS

Standard

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

 

33 thoughts on “Point Cloud Library on Ubuntu 16.04 LTS

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

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

  3. Ibrahim Shaikh

    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

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

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

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

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

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

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s