Ubuntu16.04之后安装pcl可以直接apt-get
1sudo apt-getinstall libpcl-dev pcl-tools //但是目前只能安装1.7,更高版本参照一下步骤
安装之前,准备一些依赖库,如果某个依赖库安装过,跳过即可,看好在安装,切记不能安装多个不同版本的库!!!
sudo apt-getinstall git build-essential linux-libc-dev
sudo apt-getinstall cmake cmake-gui
sudo apt-getinstall libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt-getinstall mpi-default-dev openmpi-bin openmpi-common
sudo apt-getinstall libflann1.9 libflann-dev
sudo apt-getinstall libeigen3-dev
sudo apt-getinstall libboost-all-dev
sudo apt-getinstall libvtk5.10-qt4 libvtk5.10 libvtk5-dev //最好在官网下载最新版,编译完成,详情见 https://www.cnblogs.com/haijian/p/12417017.html
sudo apt-getinstall libqhull* libgtest-dev
sudo apt-getinstall freeglut3-dev pkg-config
sudo apt-getinstall libxmu-dev libxi-dev
sudo apt-getinstall mono-complete
sudo apt-getinstall qt-sdk openjdk-11-jdk openjdk-11-jre
克隆PCL
git clone https://github.com/PointCloudLibrary/pcl.git //如果需要指定版本,打开网址,选择版本,指定源码下载
打开pcl文件夹,进行编译
cd pcl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \
-DCMAKE_INSTALL_PREFIX=/usr ..
sudo make -j4
sudo make install
安装完成
----------补加-----------
Cmake安装可能出现问题,安装的另一种方法:
(1)官网下载压缩包
1https://cmake.org/download/
(2)解压
(3)软连接
sudo mv cmake-3.12.2 /opt/cmake
sudo ln -sf /opr/cmake/bin/* /usr/bin/
(4)测试
cmake --version