koide3 / small_gicp

Efficient and parallel algorithms for point cloud registration [C++, Python]
MIT License
318 stars 40 forks source link

Default PCL shipped with ROS Noetic is incompatible with the PCL interface usage in the CMakeLists #33

Open nkhedekar opened 3 months ago

nkhedekar commented 3 months ago

Error Log

Click here for full output ```bash 1.740 CMake Error at CMakeLists.txt:62 (set_target_properties): 1.740 Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword 1.740 "optimized". The INTERFACE_LINK_LIBRARIES property may contain 1.740 configuration-sensitive generator-expressions which may be used to specify 1.740 per-configuration rules. ``` ```bash small_gicp$ docker build -t sg_image --build-arg BASE_IMAGE=ros:noetic -f docker/Dockerfile.build.gcc . [+] Building 2.5s (10/11) docker:default => [internal] load build definition from Dockerfile.build.gcc 0.0s => => transferring dockerfile: 595B 0.0s => [internal] load metadata for docker.io/library/ros:noetic 0.4s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/8] FROM docker.io/library/ros:noetic@sha256:20b337f10f4275a6d589388cf8f72a7216de2ba3632b10d9d05c205c65446b8a 0.0s => [internal] load build context 0.0s => => transferring context: 41.57kB 0.0s => CACHED [2/8] RUN apt-get update && apt-get install --no-install-recommends -y && apt-get install --no-install-recommends -y wget nano build-essential git cmake libeigen3-dev libfmt-dev libtbb-dev libomp-dev libgtest-dev ros-noetic-pcl-ros && apt-get clean && rm 0.0s => [3/8] COPY . /root/small_gicp 0.0s => [4/8] WORKDIR /root/small_gicp/build 0.0s => [5/8] RUN rm -rf ./* 0.2s => ERROR [6/8] RUN cmake .. -DBUILD_WITH_TBB=ON -DBUILD_WITH_PCL=ON 1.8s ------ > [6/8] RUN cmake .. -DBUILD_WITH_TBB=ON -DBUILD_WITH_PCL=ON: 0.370 -- The C compiler identification is GNU 9.4.0 0.402 -- The CXX compiler identification is GNU 9.4.0 0.405 -- Check for working C compiler: /usr/bin/cc 0.469 -- Check for working C compiler: /usr/bin/cc -- works 0.471 -- Detecting C compiler ABI info 0.593 -- Detecting C compiler ABI info - done 0.615 -- Detecting C compile features 0.615 -- Detecting C compile features - done 0.620 -- Check for working CXX compiler: /usr/bin/c++ 0.758 -- Check for working CXX compiler: /usr/bin/c++ -- works 0.760 -- Detecting CXX compiler ABI info 0.894 -- Detecting CXX compiler ABI info - done 0.916 -- Detecting CXX compile features 0.917 -- Detecting CXX compile features - done 1.214 -- Found OpenMP_C: -fopenmp (found version "4.5") 1.368 -- Found OpenMP_CXX: -fopenmp (found version "4.5") 1.369 -- Found OpenMP: TRUE (found version "4.5") 1.387 -- Checking for module 'eigen3' 1.396 -- Found eigen3, version 3.3.7 1.449 -- Found Eigen: /usr/include/eigen3 (Required is at least version "3.1") 1.449 -- Eigen found (include: /usr/include/eigen3, version: 3.3.7) 1.505 -- Found Boost: /usr/include (found suitable version "1.71.0", minimum required is "1.55.0") found components: system filesystem date_time iostreams regex 1.519 -- Checking for module 'flann' 1.528 -- Found flann, version 1.9.1 1.588 -- Found FLANN: /usr/lib/x86_64-linux-gnu/libflann_cpp.so 1.650 -- The imported target "vtkParseOGLExt" references the file 1.650 "/usr/bin/vtkParseOGLExt-7.1" 1.650 but this file does not exist. Possible reasons include: 1.650 * The file was deleted, renamed, or moved to another location. 1.650 * An install or uninstall procedure did not complete successfully. 1.650 * The installation package was faulty and contained 1.650 "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake" 1.650 but not all the files it references. 1.650 1.651 -- The imported target "vtkRenderingPythonTkWidgets" references the file 1.651 "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so" 1.651 but this file does not exist. Possible reasons include: 1.651 * The file was deleted, renamed, or moved to another location. 1.651 * An install or uninstall procedure did not complete successfully. 1.651 * The installation package was faulty and contained 1.651 "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake" 1.651 but not all the files it references. 1.651 1.652 -- The imported target "vtk" references the file 1.652 "/usr/bin/vtk" 1.652 but this file does not exist. Possible reasons include: 1.652 * The file was deleted, renamed, or moved to another location. 1.652 * An install or uninstall procedure did not complete successfully. 1.652 * The installation package was faulty and contained 1.652 "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake" 1.652 but not all the files it references. 1.652 1.652 -- The imported target "pvtk" references the file 1.652 "/usr/bin/pvtk" 1.652 but this file does not exist. Possible reasons include: 1.652 * The file was deleted, renamed, or moved to another location. 1.652 * An install or uninstall procedure did not complete successfully. 1.652 * The installation package was faulty and contained 1.652 "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake" 1.652 but not all the files it references. 1.652 1.664 -- Checking for module 'libusb-1.0' 1.666 -- No package 'libusb-1.0' found 1.668 -- Could NOT find USB_10 (missing: USB_10_LIBRARY USB_10_INCLUDE_DIR) 1.668 -- OpenNI disabled because libusb-1.0 not found. 1.668 ** WARNING ** io features related to openni will be disabled 1.670 -- Checking for module 'libusb-1.0' 1.672 -- No package 'libusb-1.0' found 1.673 -- Could NOT find USB_10 (missing: USB_10_LIBRARY USB_10_INCLUDE_DIR) 1.673 -- OpenNI 2 disabled because libusb-1.0 not found. 1.674 ** WARNING ** io features related to openni2 will be disabled 1.674 ** WARNING ** io features related to pcap will be disabled 1.674 ** WARNING ** io features related to png will be disabled 1.682 ** WARNING ** io features related to libusb-1.0 will be disabled 1.682 -- LIBUSB_1_LIBRARY (missing: LIBUSB_1_INCLUDE_DIR) 1.685 -- Checking for module 'libusb-1.0' 1.687 -- No package 'libusb-1.0' found 1.688 -- Could NOT find USB_10 (missing: USB_10_LIBRARY USB_10_INCLUDE_DIR) 1.688 -- OpenNI disabled because libusb-1.0 not found. 1.688 ** WARNING ** visualization features related to openni will be disabled 1.691 -- Checking for module 'libusb-1.0' 1.693 -- No package 'libusb-1.0' found 1.694 -- Could NOT find USB_10 (missing: USB_10_LIBRARY USB_10_INCLUDE_DIR) 1.694 -- OpenNI 2 disabled because libusb-1.0 not found. 1.694 ** WARNING ** visualization features related to openni2 will be disabled 1.706 -- Found Qhull: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so 1.706 -- QHULL found (include: /usr/include, lib: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so) 1.709 -- Checking for module 'libusb-1.0' 1.711 -- No package 'libusb-1.0' found 1.712 -- Could NOT find USB_10 (missing: USB_10_LIBRARY USB_10_INCLUDE_DIR) 1.712 -- OpenNI disabled because libusb-1.0 not found. 1.712 ** WARNING ** apps features related to openni will be disabled 1.721 -- looking for PCL_COMMON 1.721 -- Found PCL_COMMON: /usr/lib/x86_64-linux-gnu/libpcl_common.so 1.721 -- looking for PCL_KDTREE 1.722 -- Found PCL_KDTREE: /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so 1.722 -- looking for PCL_OCTREE 1.723 -- Found PCL_OCTREE: /usr/lib/x86_64-linux-gnu/libpcl_octree.so 1.723 -- looking for PCL_SEARCH 1.724 -- Found PCL_SEARCH: /usr/lib/x86_64-linux-gnu/libpcl_search.so 1.724 -- looking for PCL_SAMPLE_CONSENSUS 1.725 -- Found PCL_SAMPLE_CONSENSUS: /usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so 1.725 -- looking for PCL_FILTERS 1.725 -- Found PCL_FILTERS: /usr/lib/x86_64-linux-gnu/libpcl_filters.so 1.726 -- looking for PCL_2D 1.726 -- Found PCL_2D: /usr/include/pcl-1.10 1.726 -- looking for PCL_GEOMETRY 1.726 -- Found PCL_GEOMETRY: /usr/include/pcl-1.10 1.726 -- looking for PCL_IO 1.727 -- Found PCL_IO: /usr/lib/x86_64-linux-gnu/libpcl_io.so 1.727 -- looking for PCL_FEATURES 1.728 -- Found PCL_FEATURES: /usr/lib/x86_64-linux-gnu/libpcl_features.so 1.728 -- looking for PCL_ML 1.728 -- Found PCL_ML: /usr/lib/x86_64-linux-gnu/libpcl_ml.so 1.729 -- looking for PCL_SEGMENTATION 1.729 -- Found PCL_SEGMENTATION: /usr/lib/x86_64-linux-gnu/libpcl_segmentation.so 1.729 -- looking for PCL_VISUALIZATION 1.730 -- Found PCL_VISUALIZATION: /usr/lib/x86_64-linux-gnu/libpcl_visualization.so 1.730 -- looking for PCL_SURFACE 1.731 -- Found PCL_SURFACE: /usr/lib/x86_64-linux-gnu/libpcl_surface.so 1.731 -- looking for PCL_REGISTRATION 1.731 -- Found PCL_REGISTRATION: /usr/lib/x86_64-linux-gnu/libpcl_registration.so 1.732 -- looking for PCL_KEYPOINTS 1.732 -- Found PCL_KEYPOINTS: /usr/lib/x86_64-linux-gnu/libpcl_keypoints.so 1.733 -- looking for PCL_TRACKING 1.733 -- Found PCL_TRACKING: /usr/lib/x86_64-linux-gnu/libpcl_tracking.so 1.734 -- looking for PCL_RECOGNITION 1.734 -- Found PCL_RECOGNITION: /usr/lib/x86_64-linux-gnu/libpcl_recognition.so 1.734 -- looking for PCL_STEREO 1.735 -- Found PCL_STEREO: /usr/lib/x86_64-linux-gnu/libpcl_stereo.so 1.735 -- looking for PCL_APPS 1.736 -- Found PCL_APPS: /usr/lib/x86_64-linux-gnu/libpcl_apps.so 1.736 -- looking for PCL_IN_HAND_SCANNER 1.737 -- Found PCL_IN_HAND_SCANNER: /usr/include/pcl-1.10 1.737 -- looking for PCL_POINT_CLOUD_EDITOR 1.737 -- Found PCL_POINT_CLOUD_EDITOR: /usr/include/pcl-1.10 1.737 -- looking for PCL_OUTOFCORE 1.738 -- Found PCL_OUTOFCORE: /usr/lib/x86_64-linux-gnu/libpcl_outofcore.so 1.738 -- looking for PCL_PEOPLE 1.739 -- Found PCL_PEOPLE: /usr/lib/x86_64-linux-gnu/libpcl_people.so 1.740 -- Found PCL: pcl_common;pcl_kdtree;pcl_octree;pcl_search;pcl_sample_consensus;pcl_filters;pcl_io;pcl_features;pcl_ml;pcl_segmentation;pcl_visualization;pcl_surface;pcl_registration;pcl_keypoints;pcl_tracking;pcl_recognition;pcl_stereo;pcl_apps;pcl_outofcore;pcl_people;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;vtkChartsCore;vtkCommonColor;vtkCommonCore;vtksys;vtkCommonDataModel;vtkCommonMath;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkCommonExecutionModel;vtkFiltersGeneral;vtkCommonComputationalGeometry;vtkFiltersCore;vtkInfovisCore;vtkFiltersExtraction;vtkFiltersStatistics;vtkImagingFourier;vtkImagingCore;vtkalglib;vtkRenderingContext2D;vtkRenderingCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingFreeType;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/x86_64-linux-gnu/libz.so;vtkFiltersModeling;vtkImagingSources;vtkInteractionStyle;vtkInteractionWidgets;vtkFiltersHybrid;vtkImagingColor;vtkImagingGeneral;vtkImagingHybrid;vtkIOImage;vtkDICOMParser;vtkmetaio;/usr/lib/x86_64-linux-gnu/libjpeg.so;/usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libtiff.so;vtkRenderingAnnotation;vtkRenderingVolume;vtkIOXML;vtkIOCore;vtkIOXMLParser;/usr/lib/x86_64-linux-gnu/libexpat.so;vtkIOGeometry;vtkIOLegacy;vtkIOPLY;vtkRenderingLOD;vtkViewsContext2D;vtkViewsCore;vtkRenderingContextOpenGL2;vtkRenderingOpenGL2;FLANN::FLANN 1.740 CMake Error at CMakeLists.txt:62 (set_target_properties): 1.740 Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword 1.740 "optimized". The INTERFACE_LINK_LIBRARIES property may contain 1.740 configuration-sensitive generator-expressions which may be used to specify 1.740 per-configuration rules. 1.740 1.740 1.742 -- Configuring incomplete, errors occurred! 1.742 See also "/root/small_gicp/build/CMakeFiles/CMakeOutput.log". ------ Dockerfile.build.gcc:18 -------------------- 16 | RUN rm -rf ./* 17 | 18 | >>> RUN cmake .. -DBUILD_WITH_TBB=ON -DBUILD_WITH_PCL=ON 19 | RUN cmake --build . -j$(nproc) 20 | -------------------- ERROR: failed to solve: process "/bin/sh -c cmake .. -DBUILD_WITH_TBB=ON -DBUILD_WITH_PCL=ON" did not complete successfully: exit code: 1 ```

Steps to reproduce

  1. Add ros-noetic-pcl-ros in the packages to be installed in the dockerfile.
  2. Add the -DBUILD_WITH_PCL=ON flag
  3. Build the docker image with ros:noetic image
nkhedekar commented 3 months ago

This may be relevant: https://github.com/PointCloudLibrary/pcl/pull/3341 The bundled PCL is 1.10.0 in ROS noetic which should have the fix (https://github.com/PointCloudLibrary/pcl/commit/2e4cc61c0e485226dc3bc814678ee67f7b632875) but perhaps I'm missing something

koide3 commented 3 months ago

Dealing with old PCL is always tough... Fortunately, -DBUILD_WITH_PCL=ON is only required for building test, example, and benchmark programs. small_gicp and its helper library do not depend on PCL, you can keep it disabled.

Note that small_gicp's PCL interface (small_gicp::RegistrationPCL) has a compatibility issue with PCL older than 1.11 that uses boost::shared_ptr but not std::shared_ptr. We may need to slightly change the code to use it with an older PCL.

nkhedekar commented 3 months ago

Yep. The latter could perhaps be fixed by something on the lines of

#include <pcl/pcl_config.h>

#if PCL_VERSION_COMPARE(<, 1, 11, 0)
 typedef shared_ptr boost::shared_ptr
#else
 typedef shared_ptr std::shared_ptr
#endif

and then just use shared_ptr everywhere

LimHyungTae commented 1 month ago

@nkhedekar That's a pretty nice solution, bro!

zhangxu0089 commented 2 days ago

Yep. The latter could perhaps be fixed by something on the lines of

#include <pcl/pcl_config.h>

#if PCL_VERSION_COMPARE(<, 1, 11, 0)
 typedef shared_ptr boost::shared_ptr
#else
 typedef shared_ptr std::shared_ptr
#endif

and then just use shared_ptr everywhere

add to which file?