Ubuntu14.04/Ubuntu16.04 + PCL + Boost + Eigen3 + QT5 + VTK6.3.0 配置安装

在PCL官方的说明文档里给明了PCL的所依赖的三方库: PCL官方安装
包括:Boost、Eigen、FLANN、VTK,其中VTK又依赖与QT5。

下面介绍各个库的安装方法。

一、PCL

参考我的这篇博客:https://blog.csdn.net/huoxingrenhdh/article/details/83780506

二、Boost

boost安装只需要下面一行即可

sudo apt-get update
sudo apt-get install libboost-all-dev

三、Eigen3

sudo apt-get update
sudo apt-get install libeigen3-dev

四、QT5

(1)首先在https://www.qt.io/download-open-source/#section-2中通过邮箱注册下载得到 qt-opensource-linux-x64-5.2.1.run
(2)然后在qt-opensource-linux-x64-5.2.1.run所在的目录下打开终端,执行下面两行代码:

chmod +x qt-opensource-linux-x64-5.2.1.run
./qt-opensource-linux-x64-5.2.1.run

就会出现Qt安装对话框,然后默认安装。

五、VTK

1)VTK之前还要先安装好OpenGL和cmake-gui等

sudo apt-get install libgl1-mesa-dev
sudo apt-get install libxt-dev
sudo apt install cmake-curses-gui

2)下载VTK:安装包
3)准备编译文件目录:在vtk目录下建立build文件夹,

cd build
ccmake ..

4)编译过程
Ubuntu14.04/Ubuntu16.04 + PCL + Boost + Eigen3 + QT5 + VTK6.3.0 配置安装_第1张图片
注意设置:BUILD_SHARE_LIBS 选择ON,其它的可以不做更改。
再次按c进行配置确认,按g保存配置。

5)执行make:过程漫长

sudo make

6)安装

sudo make -j 8 install

7)添加环境变量 .bash_profile, .bashrc, or .profile file

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/vtk-6.3"
PYTHONPATH="$PYTHONPATH:/usr/local/lib/vtk-6.3"

安装完成!

六、错误处理

如果在cmake的时候发现有以下错误:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:26
 (find_package):
   Could not find a package configuration file provided by "Qt5Designer" with
   any of the following names:

     Qt5DesignerConfig.cmake
     qt5designer-config.cmake

   Add the installation prefix of "Qt5Designer" to CMAKE_PREFIX_PATH or set
   "Qt5Designer_DIR" to a directory containing one of the above files.  If
   "Qt5Designer" provides a separate development package or SDK, be sure it
   has been installed.
   Call Stack (most recent call first):
   GUISupport/Qt/CMakeLists.txt:113 (find_package)

这就意思就是要添加Qt5Designer的安装路径的前缀到CMAKE_PREFIX_PATH
解决方式:

export CMAKE_PREFIX_PATH=/home/hdh/Qt5.9.1/5.9.1/gcc_64/lib/cmake/

参考文档:
https://blog.csdn.net/wanguku/article/details/60476469
https://blog.csdn.net/jiangjiang_jian/article/details/80104603

你可能感兴趣的:(Ubuntu)