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")
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章