Skip to content

Add missing -DDISABLE_VTK to WITH_QT=OFF build - #790

Closed
oseiskar wants to merge 1 commit into
introlab:masterfrom
oseiskar:master
Closed

oseiskar wants to merge 1 commit into
introlab:masterfrom
oseiskar:master

Conversation

@oseiskar

Copy link
Copy Markdown

Otherwise complains about missing VTK headers like this

rtabmap/corelib/src/Parameters.cpp:45:10: fatal error: 'vtkVersion.h' file not found
#include <vtkVersion.h>
         ^~~~~~~~~~~~~~
1 error generated.

@matlabbe

matlabbe commented Dec 5, 2021

Copy link
Copy Markdown
Member

See also #618
Which PCL version are you using? Normally PCL will add -DDISABLE_VTK in PCL_DEFINITIONS, which is forwarded to rtabmap build.

@oseiskar

oseiskar commented Dec 6, 2021

Copy link
Copy Markdown
Author

Right, sorry. I am using a self-built PCL 1.12.0 with static linking and minimal features, i.e.,

cmake -DPCL_SHARED_LIBS=OFF \
  -DWITH_LIBUSB=OFF \
  -DWITH_OPENNI=OFF \
  -DWITH_OPENNI2=OFF \
  -DWITH_PNG=OFF \
  -DWITH_QHULL=OFF \
  -DWITH_PCAP=OFF \
  -DWITH_CUDA=OFF \
  #  ... + Boost flags
  -DBUILD_tools=OFF \
  -DBUILD_stereo=OFF \
  -DBUILD_io=ON \
  -DBUILD_kdtree=ON \
  -DBUILD_search=ON \
  -DBUILD_surface=ON \
  -DBUILD_filters=ON \
  -DBUILD_registration=ON \
  -DBUILD_sample_consensus=ON \
  -DBUILD_segmentation=ON \
  -DWITH_OPENGL=OFF \
  -DWITH_VTK=OFF \
  -DBUILD_visualization=OFF ..

Then I'm building RTABMap like this

cmake -DBUILD_SHARED_LIBS=OFF \
  -DWITH_QT=OFF \
  -DPCL_FLANN_REQUIRED_TYPE=STATIC \
  -DPCL_SHARED_LIBS=OFF \
  # ... lots of -D feature flags and some Eigen flags
  -DBUILD_EXAMPLES=OFF \
  -DBUILD_APP=OFF \
  -DBUILD_TOOLS=OFF \
  -DBUILD_DOCS=OFF \
  -DBUILD_TESTS=OFF \
    ..

If I would have to guess, probably the static linking breaks the automatic -DDISABLE_VTK mechanism somehow. However, with the patch in this PR, I can build RTABMap (on Ubuntu 20) and the resulting rtabmap_core lib works.

@windelbouwman

Copy link
Copy Markdown
Contributor

I noticed that this preprocessor define was remove in PCL version 1.10.

See this issue: #795

matlabbe added a commit that referenced this pull request May 28, 2022
@matlabbe

Copy link
Copy Markdown
Member

See pull request #871, it handles also the case when PCL is built with VTK (without qt stuff) just for VTK filtering algorithms

@matlabbe matlabbe closed this May 28, 2022
matlabbe added a commit that referenced this pull request May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants