0.背景
PCL をソースコードからインストールするのは、vtk、flann、boost、eigen などの依存ライブラリがあり、インストールが容易ではないため、apt を使用してインストールします。
以下の内容は主にブログ「【Ubuntu】UbuntuにPCLをインストールする(PCLのインストール/PCLのアンインストール/PCLのバージョン確認/PCLのエラー処理関連操作)(史上最も詳しい)」を参考にしています。
1. aptでインストールされるバージョン
次のコマンドを使用して、現在の ubuntu バージョンを確認します。apt を使用して、最も高い PCL バージョンをインストールします。Ubuntu 20 は、最も高い PCL バージョン 1.10 のみをインストールできます。
sudo apt-get install libpcl-dev
結果は次のとおりです
2. apt ソースを更新する
通常、この手順は無視してかまいませんが、pcl を適切にインストールできないことがわかった場合は、ソースを検討してください。私のソース (私は Ubuntu 20 であることに注意してください。Ubuntu の他のバージョンについては、対応するソースを自分で見つけてください。非常に簡単です)は次のとおりです
sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list
以下のソースを保存します
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
アップデートの操作は以下の通りです
sudo apt-get update
3.apt installコマンド
sudo apt-get install build-essential
sudo apt-get install libpcl-dev
4. テスト
apt-cache show libpcl-dev
問題なければ以下はバージョン1.10です