PCL学习笔记(一):Ubuntu20.04安装pcl
1、安装依赖
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
以上有些安装包可能有些已经升级了,可以通过命令apt-cache search + 包名寻找最新版本的安装包,再安装
2、安装VTK
在https://vtk.org/download/下载VTK源码包,下载最新的即可。解压缩
注意该cmake的路径
mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=/usr make -j4 sudo make install
3、下载源码
https://github.com/PointCloudLibrary/pcl
这里我用gitee下的
解决git clone慢的方法参考:https://blog.csdn.net/xy_zhangchn/article/details/81558144
https://gitee.com/zhonglinlin/pcl
4、添加环境变量
cd pcl mkdir release cd release
cmake ../ -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_apps=ON -DBUILD_examples=ON
make -j8
5、安装
sudo make install
6、关于错误
(1)、
/usr/bin/ld: ../lib/libpcl_kdtree.so.1.12.1.99: undefined reference to `LZ4_resetStreamHC' /usr/bin/ld: ../lib/libpcl_kdtree.so.1.12.1.99: undefined reference to `LZ4_setStreamDecode' /usr/bin/ld: ../lib/libpcl_kdtree.so.1.12.1.99: undefined reference to `LZ4_decompress_safe' /usr/bin/ld: ../lib/libpcl_kdtree.so.1.12.1.99: undefined reference to `LZ4_decompress_safe_continue' /usr/bin/ld: ../lib/libpcl_kdtree.so.1.12.1.99: undefined reference to `LZ4_compress_HC_continue'
/pcl/build/kdtree/CMakeFiles/pcl_kdtree.dir/下的link.txt里在末尾写上:-llz4
参考:https://blog.csdn.net/suyunzzz/article/details/96722184