2019/10/17 按照這個博文的流程操做,最後測試成功了:https://blog.csdn.net/weixin_41991128/article/details/83864713
php
先安裝依賴項,參考https://zhuanlan.zhihu.com/p/58615079
注意版本多是舊的,apt-get時可能找不到,這時候能夠用*代替數字,
而後按官網的安裝教程:http://www.pointclouds.org/documentation/tutorials/compiling_pcl_posix.phplinux
個人運行結果:ios
$ cmake .. -- The C compiler identification is GNU 7.4.0 -- The CXX compiler identification is GNU 7.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info m-- Detecting CXX compiler ABI info - done -- Detecting CXX compile features ake-- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Using CPU native flags for SSE optimization: -march=native -- Performing Test HAVE_MM_MALLOC -- Performing Test HAVE_MM_MALLOC - Success -- Performing Test HAVE_POSIX_MEMALIGN -- Performing Test HAVE_POSIX_MEMALIGN - Success -- Performing Test HAVE_SSE4_2_EXTENSIONS -- Performing Test HAVE_SSE4_2_EXTENSIONS - Success -- Performing Test HAVE_SSE4_1_EXTENSIONS -- Performing Test HAVE_SSE4_1_EXTENSIONS - Success -- Performing Test HAVE_SSSE3_EXTENSIONS -- Performing Test HAVE_SSSE3_EXTENSIONS - Success -- Performing Test HAVE_SSE3_EXTENSIONS -- Performing Test HAVE_SSE3_EXTENSIONS - Success -- Performing Test HAVE_SSE2_EXTENSIONS -- Performing Test HAVE_SSE2_EXTENSIONS - Success -- Performing Test HAVE_SSE_EXTENSIONS -- Performing Test HAVE_SSE_EXTENSIONS - Success -- -- GCC > 4.3 found, enabling -Wabi -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5") -- Found OpenMP -- Checking for module 'eigen3' -- Found eigen3, version 3.3.4 -- Found Eigen: /usr/include/eigen3 -- Eigen found (include: /usr/include/eigen3, version: 3.3.4) -- Checking for module 'flann>=1.7.0' -- Found flann, version 1.9.1 -- FLANN found (include: , lib: flann;flann_cpp) -- Found LIBUSB_1: /usr/lib/x86_64-linux-gnu/libusb-1.0.so -- Checking for module 'libusb-1.0' -- Found libusb-1.0, version 1.0.21 -- Found USB_10: /usr/lib/x86_64-linux-gnu/libusb-1.0.so -- Found OpenNI: /usr/lib/libOpenNI.so -- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so) -- Found OpenNI2: /usr/lib/libOpenNI2.so -- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so) -- Could NOT find FZAPI (missing: FZAPI_LIBS FZAPI_INCLUDE_DIRS) -- Fotonic camera support: not building because FZAPI not found -- Could NOT find ENSENSO (missing: ENSENSO_LIBRARIES ENSENSO_INCLUDE_DIRS) -- IDS-Imaging Ensenso camera support: not building because Ensenso not found -- Could NOT find davidSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) -- David Vision Systems SDK support: not building because davidSDK not found -- Could NOT find DSSDK (missing: DSSDK_LIBRARIES DSSDK_INCLUDE_DIRS) -- DepthSense SDK support: not building because DSSDK not found -- Could NOT find RSSDK (missing: RSSDK_LIBRARIES RSSDK_INCLUDE_DIRS) -- RealSense SDK support: not building because RSSDK not found -- Checking for module 'metslib' -- No package 'metslib' found -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") -- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) -- Found Qhull: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so -- QHULL found (include: /usr/include, lib: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so) -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA Toolkit v10.0 -- CUDA NVCC target flags: -gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_53,code=sm_53;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75 CMake Warning at CMakeLists.txt:366 (find_package): By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "VTK", but CMake did not find one. Could not find a package configuration file provided by "VTK" with any of the following names: VTKConfig.cmake vtk-config.cmake Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set "VTK_DIR" to a directory containing one of the above files. If "VTK" provides a separate development package or SDK, be sure it has been installed. -- Found PCAP: /usr/lib/x86_64-linux-gnu/libpcap.so -- Boost version: 1.65.1 -- Found the following Boost libraries: -- filesystem -- thread -- date_time -- iostreams -- chrono -- system -- atomic -- regex -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- DOXYGEN_FOUND -- HTML_HELP_COMPILER -- Found CPack generators: DEB -- The following subsystems will be built: -- common -- kdtree -- octree -- search -- sample_consensus -- filters -- 2d -- geometry -- io -- features -- ml -- segmentation -- surface -- registration -- keypoints -- tracking -- recognition -- stereo -- tools -- The following subsystems will not be built: -- visualization: VTK was not found. -- apps: No reason -- outofcore: Disabled manually. -- examples: Code examples are disabled by default. -- people: Disabled manually. -- simulation: Disabled by default. -- global_tests: No reason -- Configuring done -- Generating done -- Build files have been written to: /home/aming/文檔/pcl/pcl-pcl-1.9.1/build
能夠看到最後幾行中顯示 visualization: VTK was not found.那就先安裝一下VTK(https://vtk.org/download/,這裏略)c++
再放一編cmake的結果git
cmake -DCMAKE_BUILD_TYPE=Release .. -- The C compiler identification is GNU 7.4.0 -- The CXX compiler identification is GNU 7.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") -- Using CPU native flags for SSE optimization: -march=native -- Performing Test HAVE_MM_MALLOC -- Performing Test HAVE_MM_MALLOC - Success -- Performing Test HAVE_POSIX_MEMALIGN -- Performing Test HAVE_POSIX_MEMALIGN - Success -- Performing Test HAVE_SSE4_2_EXTENSIONS -- Performing Test HAVE_SSE4_2_EXTENSIONS - Success -- Performing Test HAVE_SSE4_1_EXTENSIONS -- Performing Test HAVE_SSE4_1_EXTENSIONS - Success -- Performing Test HAVE_SSSE3_EXTENSIONS -- Performing Test HAVE_SSSE3_EXTENSIONS - Success -- Performing Test HAVE_SSE3_EXTENSIONS -- Performing Test HAVE_SSE3_EXTENSIONS - Success -- Performing Test HAVE_SSE2_EXTENSIONS -- Performing Test HAVE_SSE2_EXTENSIONS - Success -- Performing Test HAVE_SSE_EXTENSIONS -- Performing Test HAVE_SSE_EXTENSIONS - Success -- -- GCC > 4.3 found, enabling -Wabi -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5") -- Found OpenMP -- Checking for module 'eigen3' -- Found eigen3, version 3.3.4 -- Found Eigen: /usr/include/eigen3 -- Eigen found (include: /usr/include/eigen3, version: 3.3.4) -- Checking for module 'flann>=1.7.0' -- Found flann, version 1.9.1 -- FLANN found (include: , lib: flann;flann_cpp) -- Found LIBUSB_1: /usr/lib/x86_64-linux-gnu/libusb-1.0.so -- Checking for module 'libusb-1.0' -- Found libusb-1.0, version 1.0.21 -- Found USB_10: /usr/lib/x86_64-linux-gnu/libusb-1.0.so -- Found OpenNI: /usr/lib/libOpenNI.so -- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so) -- Found OpenNI2: /usr/lib/libOpenNI2.so -- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so) -- Could NOT find FZAPI (missing: FZAPI_LIBS FZAPI_INCLUDE_DIRS) -- Fotonic camera support: not building because FZAPI not found -- Could NOT find ENSENSO (missing: ENSENSO_LIBRARIES ENSENSO_INCLUDE_DIRS) -- IDS-Imaging Ensenso camera support: not building because Ensenso not found -- Could NOT find davidSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) -- David Vision Systems SDK support: not building because davidSDK not found -- Could NOT find DSSDK (missing: DSSDK_LIBRARIES DSSDK_INCLUDE_DIRS) -- DepthSense SDK support: not building because DSSDK not found -- Could NOT find RSSDK (missing: RSSDK_LIBRARIES RSSDK_INCLUDE_DIRS) -- RealSense SDK support: not building because RSSDK not found -- Checking for module 'metslib' -- No package 'metslib' found -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") -- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34") -- Found Qhull: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so -- QHULL found (include: /usr/include, lib: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so) -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found CUDA Toolkit v10.0 -- CUDA NVCC target flags: -gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_53,code=sm_53;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_72,code=sm_72;-gencode;arch=compute_75,code=sm_75 -- VTK_MAJOR_VERSION 8, rendering backend: OpenGL2 -- VTK found (include: /usr/local/include/vtk-8.2, lib: vtksys;vtkCommonCore;vtkCommonMath;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkCommonDataModel;vtkCommonColor;vtkCommonExecutionModel;vtkCommonComputationalGeometry;vtkFiltersCore;vtkFiltersGeneral;vtkImagingCore;vtkImagingFourier;vtkFiltersStatistics;vtkFiltersExtraction;vtkInfovisCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingCore;vtkzlib;vtkfreetype;vtkRenderingFreeType;vtkRenderingContext2D;vtkChartsCore;vtkDICOMParser;vtkdoubleconversion;vtklz4;vtklzma;vtkIOCore;vtkIOLegacy;vtkexpat;vtkIOXMLParser;vtkDomainsChemistry;vtkglew;vtkRenderingOpenGL2;vtkDomainsChemistryOpenGL2;vtkIOXML;vtkParallelCore;vtkFiltersAMR;vtkFiltersFlowPaths;vtkFiltersGeneric;vtkImagingSources;vtkFiltersHybrid;vtkFiltersHyperTree;vtkImagingGeneral;vtkFiltersImaging;vtkFiltersModeling;vtkFiltersParallel;vtkFiltersParallelImaging;vtkFiltersPoints;vtkFiltersProgrammable;vtkFiltersSMP;vtkFiltersSelection;vtkFiltersTexture;vtkFiltersTopology;verdict;vtkFiltersVerdict;vtkmetaio;vtkjpeg;vtkpng;vtktiff;vtkIOImage;vtkImagingHybrid;vtkInfovisLayout;vtkInteractionStyle;vtkImagingColor;vtkRenderingAnnotation;vtkRenderingVolume;vtkInteractionWidgets;vtkViewsCore;vtklibproj;vtkGeovisCore;vtkhdf5_src;vtkhdf5_hl_src;vtkIOAMR;vtkIOAsynchronous;vtkpugixml;vtkIOCityGML;vtkIOEnSight;vtknetcdf;vtkexodusII;vtkIOExodus;vtkgl2ps;vtkRenderingGL2PSOpenGL2;vtkIOExport;vtkIOExportOpenGL2;vtklibharu;vtkIOExportPDF;vtkIOGeometry;vtkIOImport;vtklibxml2;vtkIOInfovis;vtkIOLSDyna;vtkIOMINC;vtkogg;vtktheora;vtkIOMovie;vtkIONetCDF;vtkIOPLY;vtkjsoncpp;vtkIOParallel;vtkIOParallelXML;vtksqlite;vtkIOSQL;vtkIOSegY;vtkIOTecplotTable;vtkIOVeraOut;vtkIOVideo;vtkImagingMath;vtkImagingMorphological;vtkImagingStatistics;vtkImagingStencil;vtkInteractionImage;vtkRenderingContextOpenGL2;vtkRenderingImage;vtkRenderingLOD;vtkRenderingLabel;vtkRenderingVolumeOpenGL2;vtkViewsContext2D;vtkViewsInfovis -- Found PCAP: /usr/lib/x86_64-linux-gnu/libpcap.so -- Boost version: 1.65.1 -- Found the following Boost libraries: -- filesystem -- thread -- date_time -- iostreams -- chrono -- system -- atomic -- regex -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- DOXYGEN_FOUND -- HTML_HELP_COMPILER -- Found CPack generators: DEB -- The following subsystems will be built: -- common -- kdtree -- octree -- search -- sample_consensus -- filters -- 2d -- geometry -- io -- features -- ml -- segmentation -- visualization -- surface -- registration -- keypoints -- tracking -- recognition -- stereo -- outofcore -- people -- tools -- The following subsystems will not be built: -- apps: No reason -- examples: Code examples are disabled by default. -- simulation: Disabled by default. -- global_tests: No reason -- Configuring done -- Generating done -- Build files have been written to: /home/aming/文檔/pcl/pcl-pcl-1.9.1/build
能夠看到還有不少沒安裝的,但不影響使用。
注意到openni已經被找到(-- Found OpenNI: /usr/lib/libOpenNI.so ),若是找不到,後面按照官網The OpenNI Grabber Framework in PCL運行時會出錯。
所以若是沒找到,能夠嘗試github
sudo apt-get install libopenni-dev sudo apt-get install libopenni2-dev
之後若是運行程序報錯缺乏某個文件,能夠經過cmake來檢查是否少裝了某個依賴項。sql
---2019.10.25
我在跑PCL tutorial openni_grabber時make時遇到error,一直解決不了,最後改用github上的openni_grabber才成功跑出來結果。json