Breaking changes in VTK 8.9
Environment
- Operating System and version: Ubuntu 18.04
- Compiler: gcc-7
- PCL Version: 1.9.1
- VTK Version: 8.90.0
Context
Hi,
I am new to CMake and I could really use some help! I have been trying to build PCL in my Ubuntu PC, but it is not successful. Turns out, line 381 in CMakeLists.txt (pcl-pcl-1.9.1/CMakeLists.txt) has include(${VTK_USE_FILE}) which accepts only one argument (It only has one argument - ${VTK_USE_FILE}), but throws an error stating the number of arguments is not one. I am not sure what the variable VTK_USE_FILE contains. Also, 3 packages/modules - metslib, Qhull and PCAP are not found. I did install all the dependencies - Boost, FLANN, Eigen and VTK (all >= minimum version). See the output of the cmake command below.
~/pcl-pcl-1.9.1/build$ cmake -DCMAKE_BUILD_TYPE=Release ..
-- Using CPU native flags for SSE optimization: -march=native
-- -- GCC > 4.3 found, enabling -Wabi
-- Found OpenMP
-- Eigen found (include: /usr/include/eigen3, version: 3.3.4)
-- FLANN found (include: , lib: flann;flann_cpp)
-- Checking for module 'metslib'
-- No package 'metslib' found
-- Could NOT find Qhull (missing: QHULL_LIBRARIES QHULL_INCLUDE_DIRS)
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so found components: OpenGL GLX
-- VTK_MAJOR_VERSION 8, rendering backend: OpenGL
CMake Error at CMakeLists.txt:381 (include):
include called with wrong number of arguments. include() only takes one
file.
-- VTK found (include: , lib: VTK::WrappingTools;VTK::ViewsInfovis;VTK::CommonColor;VTK::RenderingContextOpenGL2;VTK::ViewsContext2D;VTK::loguru;VTK::TestingRendering;VTK::vtksys;VTK::TestingCore;VTK::RenderingVolumeOpenGL2;VTK::RenderingOpenGL2;VTK::glew;VTK::opengl;VTK::RenderingLabel;VTK::octree;VTK::RenderingLOD;VTK::RenderingImage;VTK::IOVeraOut;VTK::hdf5;VTK::IOTecplotTable;VTK::IOSegY;VTK::IOParallelXML;VTK::IOPLY;VTK::IOOggTheora;VTK::theora;VTK::ogg;VTK::IOMotionFX;VTK::pegtl;VTK::IOParallel;VTK::jsoncpp;VTK::exodusII;VTK::netcdf;VTK::RenderingParallel;VTK::IONetCDF;VTK::IOMINC;VTK::IOLSDyna;VTK::IOInfovis;VTK::libxml2;VTK::zlib;VTK::IOImport;VTK::IOGeometry;VTK::IOVideo;VTK::IOMovie;VTK::IOExportPDF;VTK::libharu;VTK::IOExportGL2PS;VTK::RenderingGL2PSOpenGL2;VTK::gl2ps;VTK::png;VTK::IOExport;VTK::IOExodus;VTK::IOEnSight;VTK::IOCityGML;VTK::pugixml;VTK::IOAsynchronous;VTK::IOAMR;VTK::InteractionImage;VTK::ImagingStencil;VTK::ImagingStatistics;VTK::ImagingMorphological;VTK::ImagingMath;VTK::IOSQL;VTK::sqlite;VTK::TestingIOSQL;VTK::GeovisCore;VTK::libproj;VTK::InfovisLayout;VTK::ViewsCore;VTK::InteractionWidgets;VTK::RenderingVolume;VTK::RenderingAnnotation;VTK::ImagingHybrid;VTK::ImagingColor;VTK::InteractionStyle;VTK::FiltersTopology;VTK::FiltersTexture;VTK::FiltersSelection;VTK::FiltersSMP;VTK::FiltersProgrammable;VTK::FiltersPoints;VTK::FiltersVerdict;VTK::verdict;VTK::FiltersParallelImaging;VTK::FiltersImaging;VTK::ImagingGeneral;VTK::FiltersHyperTree;VTK::FiltersHybrid;VTK::FiltersGeneric;VTK::TestingGenericBridge;VTK::FiltersFlowPaths;VTK::FiltersAMR;VTK::FiltersParallel;VTK::IOParallelExodus;VTK::FiltersModeling;VTK::DomainsChemistry;VTK::DomainsChemistryOpenGL2;VTK::ChartsCore;VTK::InfovisCore;VTK::FiltersExtraction;VTK::ParallelDIY;VTK::diy2;VTK::IOXML;VTK::IOXMLParser;VTK::expat;VTK::ParallelCore;VTK::IOLegacy;VTK::IOCore;VTK::doubleconversion;VTK::lz4;VTK::lzma;VTK::utf8;VTK::FiltersStatistics;VTK::eigen;VTK::ImagingFourier;VTK::ImagingSources;VTK::IOImage;VTK::DICOMParser;VTK::jpeg;VTK::metaio;VTK::tiff;VTK::RenderingContext2D;VTK::RenderingFreeType;VTK::freetype;VTK::kwiml;VTK::RenderingCore;VTK::FiltersSources;VTK::ImagingCore;VTK::FiltersGeometry;VTK::FiltersGeneral;VTK::CommonComputationalGeometry;VTK::FiltersCore;VTK::CommonExecutionModel;VTK::CommonDataModel;VTK::CommonSystem;VTK::CommonMisc;VTK::CommonTransforms;VTK::CommonMath;VTK::CommonCore
-- Could NOT find PCAP (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS)
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- filesystem
-- thread
-- date_time
-- iostreams
-- system
-- chrono
-- 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 incomplete, errors occurred!
See also "/home/cow/pcl-pcl-1.9.1/build/CMakeFiles/CMakeOutput.log".
Could you please let me know what might have gone wrong here?
Thanks!
Did you try building pcl with the latest master and see if the problem is still there?
Please add message("----> ${VTK_USE_FILE} <----") in the end of CMakeLists.txt so we can see the contents of that variable.
@jasjuang Hi! No, I didn't try that yet. I will try if this doesn't work and update here. Thank you!
@taketwo Hi! Thanks for your advice. I tried this and the variable ${VTK_USE_FILE} seems empty (Below is the output.). But I did install VTK successfully. I verified it with the CheckVTKVersion (https://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/CheckVTKVersion) example and it returned the version 8.9.0, which I assume means that the installation was successful?
/build$ cmake -DCMAKE_BUILD_TYPE=Release ..
-- Using CPU native flags for SSE optimization: -march=native
-- -- GCC > 4.3 found, enabling -Wabi
-- Found OpenMP
-- Eigen found (include: /usr/include/eigen3, version: 3.3.4)
-- FLANN found (include: , lib: flann;flann_cpp)
-- Checking for module 'metslib'
-- No package 'metslib' found
-- Could NOT find Qhull (missing: QHULL_LIBRARIES QHULL_INCLUDE_DIRS)
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so found components: OpenGL GLX
-- VTK_MAJOR_VERSION 8, rendering backend: OpenGL
CMake Error at CMakeLists.txt:381 (include):
include called with wrong number of arguments. include() only takes one
file.
-- VTK found (include: , lib: VTK::WrappingTools;VTK::ViewsInfovis;VTK::CommonColor;VTK::RenderingContextOpenGL2;VTK::ViewsContext2D;VTK::loguru;VTK::TestingRendering;VTK::vtksys;VTK::TestingCore;VTK::RenderingVolumeOpenGL2;VTK::RenderingOpenGL2;VTK::glew;VTK::opengl;VTK::RenderingLabel;VTK::octree;VTK::RenderingLOD;VTK::RenderingImage;VTK::IOVeraOut;VTK::hdf5;VTK::IOTecplotTable;VTK::IOSegY;VTK::IOParallelXML;VTK::IOPLY;VTK::IOOggTheora;VTK::theora;VTK::ogg;VTK::IOMotionFX;VTK::pegtl;VTK::IOParallel;VTK::jsoncpp;VTK::exodusII;VTK::netcdf;VTK::RenderingParallel;VTK::IONetCDF;VTK::IOMINC;VTK::IOLSDyna;VTK::IOInfovis;VTK::libxml2;VTK::zlib;VTK::IOImport;VTK::IOGeometry;VTK::IOVideo;VTK::IOMovie;VTK::IOExportPDF;VTK::libharu;VTK::IOExportGL2PS;VTK::RenderingGL2PSOpenGL2;VTK::gl2ps;VTK::png;VTK::IOExport;VTK::IOExodus;VTK::IOEnSight;VTK::IOCityGML;VTK::pugixml;VTK::IOAsynchronous;VTK::IOAMR;VTK::InteractionImage;VTK::ImagingStencil;VTK::ImagingStatistics;VTK::ImagingMorphological;VTK::ImagingMath;VTK::IOSQL;VTK::sqlite;VTK::TestingIOSQL;VTK::GeovisCore;VTK::libproj;VTK::InfovisLayout;VTK::ViewsCore;VTK::InteractionWidgets;VTK::RenderingVolume;VTK::RenderingAnnotation;VTK::ImagingHybrid;VTK::ImagingColor;VTK::InteractionStyle;VTK::FiltersTopology;VTK::FiltersTexture;VTK::FiltersSelection;VTK::FiltersSMP;VTK::FiltersProgrammable;VTK::FiltersPoints;VTK::FiltersVerdict;VTK::verdict;VTK::FiltersParallelImaging;VTK::FiltersImaging;VTK::ImagingGeneral;VTK::FiltersHyperTree;VTK::FiltersHybrid;VTK::FiltersGeneric;VTK::TestingGenericBridge;VTK::FiltersFlowPaths;VTK::FiltersAMR;VTK::FiltersParallel;VTK::IOParallelExodus;VTK::FiltersModeling;VTK::DomainsChemistry;VTK::DomainsChemistryOpenGL2;VTK::ChartsCore;VTK::InfovisCore;VTK::FiltersExtraction;VTK::ParallelDIY;VTK::diy2;VTK::IOXML;VTK::IOXMLParser;VTK::expat;VTK::ParallelCore;VTK::IOLegacy;VTK::IOCore;VTK::doubleconversion;VTK::lz4;VTK::lzma;VTK::utf8;VTK::FiltersStatistics;VTK::eigen;VTK::ImagingFourier;VTK::ImagingSources;VTK::IOImage;VTK::DICOMParser;VTK::jpeg;VTK::metaio;VTK::tiff;VTK::RenderingContext2D;VTK::RenderingFreeType;VTK::freetype;VTK::kwiml;VTK::RenderingCore;VTK::FiltersSources;VTK::ImagingCore;VTK::FiltersGeometry;VTK::FiltersGeneral;VTK::CommonComputationalGeometry;VTK::FiltersCore;VTK::CommonExecutionModel;VTK::CommonDataModel;VTK::CommonSystem;VTK::CommonMisc;VTK::CommonTransforms;VTK::CommonMath;VTK::CommonCore
-- Could NOT find PCAP (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS)
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- filesystem
-- thread
-- date_time
-- iostreams
-- system
-- chrono
-- 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 incomplete, errors occurred!
See also "/home/cow/pcl-pcl-1.9.1/build/CMakeFiles/CMakeOutput.log".
Maybe I should assign this variable a specific path or something. I am not sure which one. Hope you could help.
Thanks!
I did not find any explicit statements about this, but looking at the snippets posted in this thread, it seems like in the new VTK version there is no need to include VTK_USE_FILE anymore (and thus this variable is not defined).
Therefore, a quick solution for you is to simply delete the include(${VTK_USE_FILE}) line. The proper solution for PCL is to add an if/else similar to the one from the referenced thread.
Thanks, @taketwo !
I tried the quick solution. Build files were configured and generated successfully. However, when I executed make -j4, there were a lot of [-Wimplicit-fallthrough=] warnings while building the target pcl_io (in lzf.cpp). The make failed with errors while building target pcl_visualization.
Scanning dependencies of target pcl_visualization
[ 15%] Building CXX object visualization/CMakeFiles/pcl_visualization.dir/src/point_picking_event.cpp.o
[ 15%] Building CXX object sample_consensus/CMakeFiles/pcl_sample_consensus.dir/src/sac_model_registration.cpp.o
In file included from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/point_cloud_geometry_handlers.h:48:0,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/point_cloud_handlers.h:41,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/common/actor_map.h:40,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/interactor_style.h:44,
from /home/cow/pcl-pcl-1.9.1/visualization/src/point_picking_event.cpp:40:
/home/cow/VTK/Common/Core/vtkSmartPointer.h: In instantiation of ‘vtkSmartPointer<ArrayType>& vtkSmartPointer<ArrayType>::operator=(const vtkSmartPointer<ArrayType>&) [with T = vtkRendererCollection]’:
/home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/interactor_style.h:158:88: required from here
/home/cow/VTK/Common/Core/vtkSmartPointer.h:144:5: error: no matching function for call to ‘vtkSmartPointer<vtkRendererCollection>::operator=(vtkRendererCollection*)’
this->vtkSmartPointerBase::operator=(r.GetPointer());
^~~~
In file included from /home/cow/VTK/Common/Core/vtkSmartPointer.h:26:0,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/point_cloud_geometry_handlers.h:48,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/point_cloud_handlers.h:41,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/common/actor_map.h:40,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/interactor_style.h:44,
from /home/cow/pcl-pcl-1.9.1/visualization/src/point_picking_event.cpp:40:
/home/cow/VTK/Common/Core/vtkSmartPointerBase.h:70:24: note: candidate: vtkSmartPointerBase& vtkSmartPointerBase::operator=(vtkObjectBase*)
vtkSmartPointerBase& operator=(vtkObjectBase* r);
^~~~~~~~
/home/cow/VTK/Common/Core/vtkSmartPointerBase.h:70:24: note: no known conversion for argument 1 from ‘vtkRendererCollection*’ to ‘vtkObjectBase*’
/home/cow/VTK/Common/Core/vtkSmartPointerBase.h:71:24: note: candidate: vtkSmartPointerBase& vtkSmartPointerBase::operator=(const vtkSmartPointerBase&)
vtkSmartPointerBase& operator=(const vtkSmartPointerBase& r);
^~~~~~~~
/home/cow/VTK/Common/Core/vtkSmartPointerBase.h:71:24: note: no known conversion for argument 1 from ‘vtkRendererCollection*’ to ‘const vtkSmartPointerBase&’
In file included from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/point_cloud_geometry_handlers.h:48:0,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/point_cloud_handlers.h:41,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/common/actor_map.h:40,
from /home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/interactor_style.h:44,
from /home/cow/pcl-pcl-1.9.1/visualization/src/point_picking_event.cpp:40:
/home/cow/VTK/Common/Core/vtkSmartPointer.h: In instantiation of ‘T* vtkSmartPointer<ArrayType>::GetPointer() const [with T = vtkRendererCollection]’:
/home/cow/VTK/Common/Core/vtkSmartPointer.h:144:44: required from ‘vtkSmartPointer<ArrayType>& vtkSmartPointer<ArrayType>::operator=(const vtkSmartPointer<ArrayType>&) [with T = vtkRendererCollection]’
/home/cow/pcl-pcl-1.9.1/visualization/include/pcl/visualization/interactor_style.h:158:88: required from here
/home/cow/VTK/Common/Core/vtkSmartPointer.h:190:12: error: invalid static_cast from type ‘vtkObjectBase* const’ to type ‘vtkRendererCollection*’
return static_cast<T*>(this->Object);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
visualization/CMakeFiles/pcl_visualization.dir/build.make:62: recipe for target 'visualization/CMakeFiles/pcl_visualization.dir/src/point_picking_event.cpp.o' failed
make[2]: *** [visualization/CMakeFiles/pcl_visualization.dir/src/point_picking_event.cpp.o] Error 1
I will try installing with an older version of VTK and see if it helps.
Thanks again!
You can ignore the warnings. As for the error, apparently, there are some breaking changes in the new VTK version. Patches updating PCL code to be compatible are welcome.
Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.
Let's close this issue since we have other issues tracking VTK 9 support