官方安装文档
https://pcl.readthedocs.io/projects/tutorials/en/master/compiling_pcl_posix.html#compiling-pcl-posix
依赖的安装
在安装文档中写了pcl的依赖库
-
vtk的下载地址https://vtk.org/download/,这里我下载的是9.2.6,然后cmake make ,sudo make install 即可
- 报错没有opengl 使用sudo apt-get install --reinstall libgl1-mesa-dev
- X11_Xt_LIB could not be found ,执行sudo apt-get install libxt-dev
- 8.2.0编译时报错multiple definition of
exodus_unused_symbol_dummy_1
,然后更换版本到9.2.6 - cmake的时候X11::Xcursor not found,使用sudo apt-get install libxcursor-dev后解决
-
eigen可以使用sudo apt-get install libeigen3-dev来安装
-
boost可使用sudo apt-get install libboost-all-dev来安装
-
flann可以使用sudo apt-get install libflann-dev
pcl安装
首先下载源码
git clone https://github.com/PointCloudLibrary/pcl.git
Please note that cmake might default to a debug build. If you want to compile a release build of PCL with enhanced compiler optimizations, you can change the build target to “Release” with “-DCMAKE_BUILD_TYPE=Release”:
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
sudo make install
pcl编译中的报错
cmake阶段
1.Could NOT find Pcap
sudo apt-get install libpcap-dev
2.No package ‘glut’ found
-- No package 'glut' found
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package):
Could not find a package configuration file provided by "boost_filesystem"
(requested version 1.74.0) with any of the following names:
boost_filesystemConfig.cmake
boost_filesystem-config.cmake
Add the installation prefix of "boost_filesystem" to CMAKE_PREFIX_PATH or
set "boost_filesystem_DIR" to a directory containing one of the above
files. If "boost_filesystem" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component)
/usr/share/cmake-3.22/Modules/FindBoost.cmake:594 (find_package)
cmake/pcl_find_boost.cmake:30 (find_package)
CMakeLists.txt:423 (include)
执行以下安装glut
sudo apt-get install build-essential
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libglut-dev
运行4后若出现 E:Unable to locate package libglut-dev, 可安装freeglut库(一个开源的glut库)替代:
sudo apt-get install freeglut3-dev
做了以上操作发现还是不能解决,细读报错发现说是boost相关,检查发现是忘装boost了,装后成功