Compile and install PCL from Ubuntu source code

PCL can be installed through commands on ubuntu apt install libpcl-dev, but the general version is relatively old, so I like to download the latest code and then compile and install

Proceed as follows:

  • Install dependencies and third-party libraries: Boost, Eigen, FlANN, VTK, (OpenNI, QHull)

    # 必装:其中eigen和vtk一直在更新,安装名称中的数字可能会发生变化
    apt install build-essential libboost-all-dev libeigen3-dev libvtk7-dev
    # FLANN
    git clone --depth=1 https://github.com/flann-lib/flann.git
    cd flann
    mkdir build
    cd build
    cmake ..
    make -j7
    make install	# 记得使用sudo权限或者切换到root账号
    cd ../..
    
    # 可选。如果想要外接摄像头的话需要
    apt install libqhull-dev lisusb-1.0-0 libopenni2-dev libopenni-dev
    

    If you encounter the following problems when installing the flann library

    • An error is reported during cmake No SOURCES given to target: flann, refer to this link`

    • When making, if an error is reported undefined reference to 'LZ4_resetStreamHC', and the word matlab appears later, add a parameter when making cmake, that is

      cmake -DBUILD_MATLAB_BINDINGS=OFF ..
      

      Please add a picture description

  • Install PCL

    git clone -b pcl-1.12.1 https://github.com/PointCloudLibrary/pcl.git
    cd pcl && mkdir build && cd build
    cmake ..
    # 如果想要安装Debug版本,运行命令cmake -DCMAKE_BUILD_TYPE=Debug..
    
    make -j2 
    make install	# 记得使用sudo权限或者切换到root账号
    

    Note: gitThe parameter -b in the command is followed by the version number (or tag), and the way to view the latest tag is as follows. Of course, you can also choose to download the latest version of the compressed package directly from releases and then decompress it.
    insert image description here

Guess you like

Origin blog.csdn.net/OTZ_2333/article/details/124648148