ubuntu16.04使用prebuilt binaries 方法安装点云库PCL

网上的许多PCL安装教程都提到网络原因导致按官网教程无法成功安装PCL,因而提出使用源码安装之。不久前在服务器上成功用prebuilt文件安装了PCL,今天在另一台电脑上却装不上。

思来想去可能是更换了软件源的原因(更换软件源的方法网上很多,这里不再叙述),做了个简单的实验测试,实验见下文。得出结论官网(源网址http://pointclouds.org/downloads/linux.html)所示用prebuilt安装的方法可行。

当我选用以下阿里云软件源时,/etc/apt/sources.list内容如下

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

输入命令,如安装PCL依赖库的命令之一sudo apt-get install libvtk5.10-qt4 libvtk5.10 libvtk5-dev,显示结果如下图
在这里插入图片描述
当我仅将软件源修改为如下ubuntu 16.04系统预置的软件源时(更换软件源时请注意备份^_^)

#deb cdrom:[Ubuntu 16.04.6 LTS _Xenial Xerus_ - Release amd64 (20190227)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

输入相同命令,显示结果如下
在这里插入图片描述
出现了下载对应软件模块的界面(忽略截图中的无用内容,当时没截到有用信息)

修改好软件源后,安装过程见下文

官网列出的ubuntu14.04的PCL所需命令如下。

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all

在安装过程中则提示了ubuntu16.04安装输入的命令与14.04略有不同,列如下。

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-dev

输入上文的官网命令可以直接一步完成PCL安装。

PCL安装过程中遇到的其他问题
一、库文件libGL.so或libEGL.so无法链接
在这里插入图片描述
解决问题可分为以下几部分
1.寻找该文件是否存在。

ls /usr/lib/x86_64-linux-gnu | grep -i libegl

2.若存在损坏的libGL.so文件,删除之。

3.将libGL.so.1文件链接到libGL.so文件上。
输入命令ls -l /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGL.so.1
即可解决问题。

二、Ubuntu16.04安装pcl出现cannot find -lvtkproj4错误
在CMakeList.txt文件的add_excutable(..)语句前添加如下语句

list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章