qinglew / PCN-PyTorch

Implementation of PCN(Point Completion Network) in PyTorch.
141 stars 33 forks source link

sample/build make fatal error: pcl/visualization/pcl_visualizer.h: No such file or directory #include <pcl/visualization/pcl_visualizer.h> #15

Closed MarioCavero closed 2 years ago

MarioCavero commented 2 years ago

The first steps of compiling as well as in Render, seem to work fine. In Sample, the procedure is to install first CMake, then PCL and then VTK. I proceeded the same and got in the final step of compiling the file:

mario@mk-ub:~/PCN-PyTorch/sample/build$ make
Scanning dependencies of target mesh_sampling
[ 50%] Building CXX object CMakeFiles/mesh_sampling.dir/mesh_sampling.cpp.o
/home/mario/PCN-PyTorch/sample/mesh_sampling.cpp:39:10: fatal error: pcl/visualization/pcl_visualizer.h: No such file or directory
 #include <pcl/visualization/pcl_visualizer.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/mesh_sampling.dir/build.make:62: recipe for target 'CMakeFiles/mesh_sampling.dir/mesh_sampling.cpp.o' failed
make[2]: *** [CMakeFiles/mesh_sampling.dir/mesh_sampling.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mesh_sampling.dir/all' failed
make[1]: *** [CMakeFiles/mesh_sampling.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

It seems it has something to do with VTK. Installing it first does not do the trick. Maybe something needs to be added (A parth somewhere in PCL and CMakeLists.txt.

Any clue?

PCL CMake ..:

/Downloads/pcl/build$ cmake ..
-- Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE ClangFormat_VERSION) (Required is at least version "10")
-- Using CPU native flags for SSE optimization: -msse4.2 -mfpmath=sse -march=native
-- Found OpenMP, spec date 201511
-- Eigen found (include: /usr/include/eigen3, version: 3.3.4)
-- FLANN found (include: /usr/include, lib: /usr/lib/x86_64-linux-gnu/libflann_cpp.so)
-- Checking for module 'metslib'
--   No package 'metslib' found
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) 
-- QHULL found (include: /usr/include, lib: /usr/lib/x86_64-linux-gnu/libqhull_r.so)
-- Found CUDA Toolkit v11.6
-- CMAKE_CUDA_FLAGS:  -gencode arch=compute_87,code=compute_87
-- VTK version: 8.2.0
-- VTK rendering backend: OpenGL2
-- VTK Qt support: NOTFOUND
-- VTK include: /usr/local/include/vtk-8.2
-- VTK libs: 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
-- Qt version: 5.9.7
-- Could NOT find Pcap (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS) 
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   date_time
--   iostreams
--   system
--   regex
-- Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY) 
-- DOXYGEN_FOUND 
-- HTML_HELP_COMPILER 
-- Found CPack generators: DEB
-- PCL build with following flags:
--  -Wabi=11 -Wall -Wextra -Wno-unknown-pragmas -fno-strict-aliasing -Wno-format-extra-args -Wno-sign-compare -Wno-invalid-offsetof -Wno-conversion -msse4.2 -mfpmath=sse -march=native -mavx2 -fopenmp 
-- 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: Disabled manually.
--   apps: Disabled: visualization missing.
--   benchmarks: Disabled by default
--   outofcore: Requires visualization.
--   examples: Code examples are disabled by default.
--   people: Requires visualization.
--   simulation: Disabled: visualization missing.
--   global_tests: Disabled by default
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mario/Downloads/pcl/build

This is the part of the CMakeLists.txt under PCL that contains VTK:

# Reset VTK_FOUND to off
set(VTK_FOUND OFF)
# Find VTK - VTK has to be found before Qt, otherwise it can overwrite Qt variables
option(WITH_VTK "Build VTK-Visualizations" TRUE)
if(WITH_VTK)
  if(ANDROID)
    message(WARNING "VTK is not supported on Android.")
  else()
    include("${PCL_SOURCE_DIR}/cmake/pcl_find_vtk.cmake")
  endif()
endif()

# VTK can depend on Qt and search for its required version, so search after so we can overwrite Qt5_FOUND/Qt6_FOUND if the version we require is not found.
set(WITH_QT "AUTO" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)")
set_property(CACHE WITH_QT PROPERTY STRINGS "AUTO" "YES" "QT6" "QT5" "NO")
if(WITH_QT)
  include("${PCL_SOURCE_DIR}/cmake/pcl_find_qt.cmake")
endif()
MarioCavero commented 2 years ago

I opened a github issue in PCL's official github. It seems VTK should be installed before PCL (so the instructions should have VTK on top of PCL). This is due the dependence of PCL on VTK.

If not done like this. Once VTK is installed, PCL's build folder can be deleted, and the process should be done again with:


cd pcl
mkdir build && cd build
cmake ..
make -j4
sudo make install