Ubuntu18.04安装PCL保姆级教程

系统环境:Ubuntu18.04.6 LTS

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.9 libflann-dev
     sudo apt-get install libeigen3-dev
     sudo apt-get install libboost-all-dev

     sudo apt-get install vtk6 libvtk6.3 libvtk6-dev libvtk6.3-qt libvtk6-qt-dev 
     # 上面这一步可能提示找不到库 可以试试vtk7.1

     sudo apt-get install libvtk7.1-qt libvtk7.1 libvtk7-qt-dev
     #这一行要是也不行就看我下面问题3,直接从源码装VTK7.1即可

     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 libopenni-dev libopenni2-dev
     sudo apt-get install openjdk-8-jdk openjdk-8-jre

注:这两行建议可以先不装,在后文按照我的方法从源码安装VTK7.1,否则使用如下命令删除VTK会删除ROS!!!先不要轻易remove!!!

sudo apt-get install vtk6 libvtk6.3 libvtk6-dev libvtk6.3-qt libvtk6-qt-dev

sudo apt-get install libvtk7.1-qt libvtk7.1 libvtk7-qt-dev

先别慌,上面VTK6应该已经装不上了,VTK7.1装了就装了,不用remove(从源码装可以覆盖,我的ROS就没了,哭死),直接按照我下面的方法从源码装VTK7.1可以覆盖。

sudo apt-get remove xxxxx

sudo apt-get autoremove xxxxx

sudo aptitude remove xxx

 仅提供一种卸载的方法,慎用!

2.下载最新源码:

git clone https://github.com/PointCloudLibrary/pcl.git

 需要特殊版本的用户请前往:GitHub - PointCloudLibrary/pcl: Point Cloud Library (PCL)Point Cloud Library (PCL). Contribute to PointCloudLibrary/pcl development by creating an account on GitHub.https://github.com/PointCloudLibrary/pcl 

3.编译源码:

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 ..
#上面这句可能会出现VTK问题 解决方案见下文
make #多核编译会出现internal compiler error: 已杀死
sudo make install

问题1:找不到 “VTK”

 Ubuntu18.04安装PCL保姆级教程_第1张图片-- The

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was de

你可能感兴趣的:(PCL,ubuntu,linux,c++)