windows下编译pcl-master源码(带GPU)
参考博客
1.http://pointclouds.org/documentation/tutorials/compiling_pcl_windows.php#compiling-pcl-windows
2. https://blog.csdn.net/artista/article/details/50897833
编译步骤
1. 第一步:下载pcl-master https://github.com/PointCloudLibrary/pcl
Eigen
Boost
Flann
Openni2
Qhull
Vtk
(第三方库我打算用pcl1.8的预编译库,即先安装好预编译的pcl1.8,因为预编译的1.8版本不包含gpu和cuda模块所以决定自己编译一遍)
2. 第二步:安装cuda
3.第三步:以管理员身份运行cmake(不知是否必要)
4.第四步:设置一些cmake找不到的变量
1.EIGEN_INCLUDE_DIR D:/pcl/3rdParty/Eigen/eigen3
Configure
2.Boost_INCLUDE_DIR D:/pcl/3rdParty/Boost/include/boost-1_59
5.CONFIGURE
全部勾选上
出现错误:
CMake Error at C:/ProgramFiles/CMake/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message):
Unable to find the requested Boost libraries.
Boost version: 1.59.0
Boost include path: D:/pcl/3rdParty/Boost/include/boost-1_59
Could not find the following static Boost libraries:
boost_filesystem
boost_thread
boost_date_time
boost_iostreams
boost_chrono
boost_system
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
cmake/pcl_find_boost.cmake:41 (find_package)
CMakeLists.txt:419 (include)
解决办法:
手动将boost库一个一个添加进去
因为预编译的第三方库没有分好类,于是手动分类又添加了两个路径
CMake Error at C:/ProgramFiles/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137(message):
Could NOT find Gtest (missing: GTEST_INCLUDE_DIR GTEST_SRC_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378(_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindGtest.cmake:35 (find_package_handle_standard_args)
test/CMakeLists.txt:11 (find_package)
取消掉globaltest
Cmake成功
-------------------------------------------------
打开vs2013工程再编译一下
Debug x64
1.All-build 重新生成
除了(example_nurbs_viewer_surface失败其他都成功了)
就不管那个了,因为主要用到gpu和cuda
2.INSTALL重新生成
Releasex64 进行同样的操作
---------------解析---------------
1.Cmake中CMAKE_INSTALL_PREFIX C:/Program Files/PCL
放了编译出来的库(当前环境下(vs2013)可以用的东西(动态库,可执行文件,静态库))
动态库放在了bin里面
静态库放在了lib里面
2.whereto build the binaries:D:/pcl-master/build
存放的是cmake出来的文件(工程文件)即:构建样例工程及源码的文件