ubuntu 14.04 PCL 源码 编译 安装

来源:互联网 发布:淘宝店促销活动方案 编辑:程序博客网 时间:2024/06/06 02:30


啊~~~折腾了一中午,总算折腾完了,纪念一下,就当是记录博文的开始。

环境:Ubuntu 14.04LTS,全新的虚拟机,基本没有安装任何东西。(连G++都没安)
  PCL 1.7.2
首先,需要从github上面下载源码:https://github.com/PointCloudLibrary/pcl
将源码随便解压到一个地方(最好不要有中文路径)

然后我们配置需要的环境
通过查阅http://www.pointclouds.org/downloads/source.html,我们可以看到需要配置许多的东西,一个一个来。
首先配置一系列需要安装的库以及工具:
sudo apt-get install cmake
sudo apt-get install g++
sudo apt-get install libboost1.55-all-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libflann-dev
sudo apt-get install python
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libudev-dev
sudo apt-get install openjdk-6-jdk
sudo apt-get install freeglut3-dev
sudo apt-get install doxygen
sudo apt-get install graphviz
sudo apt-get install libpng12-dev
sudo apt-get install libgtest-dev
sudo apt-get install libxmu-dev
sudo apt-get install libxi-dev
sudo apt-get install libpcap-dev
sudo apt-get install libqhull-dev
sudo apt-get install libvtk5-qt4-dev
里面有一些不需要安装的,比如doxygen、graphviz等,但是为了完全安装,暂且将所有功能都安装。

安装OpenNI(这个是可选的)
ps:不知道为什么,该死的OpenNI半年前已经停止维护了,但是github上面还有,网址如下:
https://github.com/OpenNI/OpenNI,按照github上面的编译方法进行编译就可以了。
如果想用primesense来采集数据的话可以按照这个链接进行https://github.com/PointCloudLibrary/Sensor。

现在我们就可以编译PCL了
之后为了方便,我安装了cmake-curses-gui
sudo apt-get install cmake-curses-gui
然后进入PCL安装目录,进入build文件夹
cmake ..
然后再
ccmake ..
之后就可以对编译进行控制,决定是否编译其中的一些项目(之前要按“t”键来进入高级选项)
需要注意一下OpenNI相关的路径是否齐全,否则可能会导致编译失败。

在cmake的时候会出一些问题如下:
The imported target "vtkPythonCore" references the file   "/usr/lib/libvtkPythonCore.so.5.8.0"but this file does not exist.  Possible reasons include:* The file was deleted, renamed, or moved to another location.* An install or uninstall procedure did not complete successfully.* The installation package was faulty and contained   "/usr/lib/vtk-5.8/VTKTargets-release.cmake"
我们的解决方法如下:
sudo apt-get install python-vtk
sudo apt-get install libvtk-java

由于是虚拟机,没有办法跑cuda,所以在BUILD_CUDA和BUILD_GPU这两个选项都是OFF,同时我们采用的是OpenNI,所以说BUILD_OPENNI2这一项也是OFF。

之后按'c'进行确认,如果无误就可以按'g'进行生成,退出之后输入make就可以生成了,整体生成时间大概在半个小时以上。

0 0
原创粉丝点击