VTK build error

I am trying to update my build however when i attempt to build with vtk vis on i get the following cmake error get_propery could not find TARGET G4visVtk. Has anyone come accross this. This happens with vtk 9.1 and 9.3
Cheers

Geant4 Version: 11.2.0 11.2.1 not showing up
_Operating System:_Debian 12
_Compiler/Version:_gcc 12.2
CMake Version:


Need a bit more information. What are your cmake build options?

static Debug build, global-dynamic, backtrace, multithreaded, gdml, opengl_x11,Qt,USolids and VTK. Did not buiild all vtk modules but did enable qt5

We’ll need to see the exact command used, and the output from CMake as it’s totally unclear where that error message is coming from.

Could you also clarify " Geant4 Version: 11.2.0 11.2.1 not showing up"? Do you mean you tried building 11.2.0 and get this error, but not with 11.2.1?

No 11.2.1 doesnt appear to exist in my git repo unless im not updating properly; Only 11.2.0. Its coming from the following line in the vtkModule.cmake file foreach (_vtk_autoinit_target IN LISTS _vtk_autoinit_TARGETS) get_property(_vtk_autoinit_target_type TARGET "${_vtk_autoinit_target}" PROPERTY TYPE) if (_vtk_autoinit_target_type STREQUAL "INTERFACE_LIBRARY") continue () endif ()

As both @bmorgan and I have already asked, please let us see your cmake options, and the resulting output.

Hi, I figured it out. It fails because im building a static version of geant4 (perhaps the static vtk im using is also a factor). The error suggests that its looking for G4visVTK being initialised prior to it being built which doesnt seem to happen in the static version. Sorry my cmake is messy with local paths. I thought this would be easier.
I have come accross this issue with qt also. It does not when built with shared libs. Applications I build against my static version sometimes through errors looking for something to have been initialised that seems to not be in the static versions. I am not sure if there is a flag that can be enabled to avoid this behaviour.

O.k. that looks like a bug in our build - could you please post the full output and error messages from the cmake command you ran so we can track this down please?

staticOnlyError.txt (2.1 KB)
There isnt much in here. It refuses to continue. Its a similar sort of issue as in this link

it references a target that has not yet been created.
https://enccs.github.io/cmake-workshop/targets/

Thanks! I think what’s happening is that your build is static only, so the G4visVtk target, which is the name of the shared library target naturally doesn’t exist. You could try editing source/CMakeLists.txt to change the target name to G4visVtk-static if you only want a static only build. That won’t work for a mixed shared/static build though, but we’ll prep a patch for this.

1 Like

Bugzilla ticket here to track and cross-ref in future: 2600 – Build of G4visVtk fails for static-only builds

1 Like

Thank you very much for your help. It is indeed a static only build. I followed your advice and it builds succesfully as you can hopefully see here:


It seems a bit laggy. Do you have any tips on speeding it up perhaps by building vtk differently? Also is it possible to save the results including tracking information in a .vtk file in order to explore it in something else?
Finally I am building static only versions as I have multiple applications that build against different geant4 versions and I dont want to deal with symbol errors. Do you have any tips on updating application builds from geant4 10 to 11 other than going through the patch notes?
Best regards

Nice!

I understand this is one of the objectives of the Vtk driver. As you might have already discovered there is a command /vis/vtk/export. I built example B1, ran 100 events, and /vis/vtk/export jpg vtk_test; I got a nice image. I tried /vis/vtk/export obj vtk_test and got several files. If I opened vtk_test.obj I got a nice image that I could browse, to some extent, but no trajectories.

I’ll alert the Vtk code author to see if he has any suggestions.

1 Like

Laggy response

This could be many things. Graphics card driver, operation over xwindows etc. Could you define your graphics platform so I can investigate. The compilation of VTK is only going to matter in how the graphics drivers are enabled. I.e if VTK is compiled with software only graphics it might be slow, if compiled with OpenGL and you have the drivers it will be very quick. A standard VTK from a package manager will probably have this all enabled appropriately.

Export formats

/vis/vtk/export vtp vtk_test

and I could load the output in preview as an example, which does include the track information. See the screenshot.

There are lots of 3D formats available vtp, obj, gltf, and vrml

Hi Stewart, thanks for the reply and thanks to everyone for your input I greatly appreciate your help.

I tried to run a profiler but its taking forever and it doesnt look like vtk is taking more cpu time but i didnt try to move the window as its so laggy through the profiler(basically frozen):


The export works really well in paraview no lag at all. Im using nvidia 550.54. The vtk opengl modules are set to default so I am not sure what that means right now but i haven’t enable vtk-m which seems to be more highly parallelised?
I built pyg4ometry with occt7.7.1 as it seemed to be compatible Open CASCADE Technology: Upgrade from older OCCT versions. I have some more questions relating to superimposing the electric field to the same gdml geometry in paraview and how to build pyg4ometry outside of a pip environment as a global package but i suppose its probably a question for another forum.

Ok. Lets take the pyg4ometry and fields discussion off this forum. Please send me a direct email and we can continue the discussion or set up a meeting.

Just to say, re representation of fields, there are commands /vis/scene/add/electricField and magnetic that draw arrows - quite primitive, but they should come out on the Vtk view. The commands take several parameters for fine tuning - use help or see Built-in Commands — Book For Application Developers 11.2 documentation.

1 Like

Also /vis/set/extentForField and volumeForField.

1 Like

Dear experts,

I am also facing an issue when trying to build with VTK:

In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPolylinePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataPolylinePipeline.cc:26:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:188:34: error: field ‘renderer’ has incomplete type ‘vtkSmartPointer<vtkRenderer>’
  188 |     vtkSmartPointer<vtkRenderer> renderer;
      |                                  ^~~~~~~~
In file included from /usr/include/vtk-9.1/vtkSystemIncludes.h:52,
                 from /usr/include/vtk-9.1/vtkDebugLeaksManager.h:29,
                 from /usr/include/vtk-9.1/vtkAutoInit.h:18,
                 from /usr/include/vtk-9.1/vtkRenderingCoreModule.h:50,
                 from /usr/include/vtk-9.1/vtkRenderer.h:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPolylinePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataPolylinePipeline.cc:26:
/usr/include/vtk-9.1/vtkOStreamWrapper.h:40:7: note: declaration of ‘class vtkSmartPointer<vtkRenderer>’
   40 | class vtkSmartPointer;
      |       ^~~~~~~~~~~~~~~
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPolylinePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataPolylinePipeline.cc:26:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:130:62: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘vtkSmartPointer<vtkRenderer>’
  130 |                    vtkSmartPointer<vtkRenderer> rendererIn = nullptr)
      |                                                              ^~~~~~~
      |                                                              |
      |                                                              std::nullptr_t
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:130:49: error: ‘rendererIn’ has incomplete type
  130 |                    vtkSmartPointer<vtkRenderer> rendererIn = nullptr)
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/vtk-9.1/vtkSystemIncludes.h:52,
                 from /usr/include/vtk-9.1/vtkDebugLeaksManager.h:29,
                 from /usr/include/vtk-9.1/vtkAutoInit.h:18,
                 from /usr/include/vtk-9.1/vtkRenderingCoreModule.h:50,
                 from /usr/include/vtk-9.1/vtkRenderer.h:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPolylinePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataPolylinePipeline.cc:26:
/usr/include/vtk-9.1/vtkOStreamWrapper.h:40:7: note: declaration of ‘class vtkSmartPointer<vtkRenderer>’
   40 | class vtkSmartPointer;
      |       ^~~~~~~~~~~~~~~
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkUtility.cc:29:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:188:34: error: field ‘renderer’ has incomplete type ‘vtkSmartPointer<vtkRenderer>’
  188 |     vtkSmartPointer<vtkRenderer> renderer;
      |                                  ^~~~~~~~
In file included from /usr/include/vtk-9.1/vtkSystemIncludes.h:52,
                 from /usr/include/vtk-9.1/vtkDebugLeaksManager.h:29,
                 from /usr/include/vtk-9.1/vtkAutoInit.h:18,
                 from /usr/include/vtk-9.1/vtkRenderingCoreModule.h:50,
                 from /usr/include/vtk-9.1/vtkRenderer.h:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkUtility.cc:29:
/usr/include/vtk-9.1/vtkOStreamWrapper.h:40:7: note: declaration of ‘class vtkSmartPointer<vtkRenderer>’
   40 | class vtkSmartPointer;
      |       ^~~~~~~~~~~~~~~
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkUtility.cc:29:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:130:62: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘vtkSmartPointer<vtkRenderer>’
  130 |                    vtkSmartPointer<vtkRenderer> rendererIn = nullptr)
      |                                                              ^~~~~~~
      |                                                              |
      |                                                              std::nullptr_t
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:130:49: error: ‘rendererIn’ has incomplete type
  130 |                    vtkSmartPointer<vtkRenderer> rendererIn = nullptr)
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/vtk-9.1/vtkSystemIncludes.h:52,
                 from /usr/include/vtk-9.1/vtkDebugLeaksManager.h:29,
                 from /usr/include/vtk-9.1/vtkAutoInit.h:18,
                 from /usr/include/vtk-9.1/vtkRenderingCoreModule.h:50,
                 from /usr/include/vtk-9.1/vtkRenderer.h:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkUtility.cc:29:
/usr/include/vtk-9.1/vtkOStreamWrapper.h:40:7: note: declaration of ‘class vtkSmartPointer<vtkRenderer>’
   40 | class vtkSmartPointer;
      |       ^~~~~~~~~~~~~~~
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstancePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataInstancePipeline.cc:26:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:188:34: error: field ‘renderer’ has incomplete type ‘vtkSmartPointer<vtkRenderer>’
  188 |     vtkSmartPointer<vtkRenderer> renderer;
      |                                  ^~~~~~~~
In file included from /usr/include/vtk-9.1/vtkSystemIncludes.h:52,
                 from /usr/include/vtk-9.1/vtkDebugLeaksManager.h:29,
                 from /usr/include/vtk-9.1/vtkAutoInit.h:18,
                 from /usr/include/vtk-9.1/vtkRenderingCoreModule.h:50,
                 from /usr/include/vtk-9.1/vtkRenderer.h:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstancePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataInstancePipeline.cc:26:
/usr/include/vtk-9.1/vtkOStreamWrapper.h:40:7: note: declaration of ‘class vtkSmartPointer<vtkRenderer>’
   40 | class vtkSmartPointer;
      |       ^~~~~~~~~~~~~~~
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstancePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataInstancePipeline.cc:26:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:130:62: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘vtkSmartPointer<vtkRenderer>’
  130 |                    vtkSmartPointer<vtkRenderer> rendererIn = nullptr)
      |                                                              ^~~~~~~
      |                                                              |
      |                                                              std::nullptr_t
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:130:49: error: ‘rendererIn’ has incomplete type
  130 |                    vtkSmartPointer<vtkRenderer> rendererIn = nullptr)
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/vtk-9.1/vtkSystemIncludes.h:52,
                 from /usr/include/vtk-9.1/vtkDebugLeaksManager.h:29,
                 from /usr/include/vtk-9.1/vtkAutoInit.h:18,
                 from /usr/include/vtk-9.1/vtkRenderingCoreModule.h:50,
                 from /usr/include/vtk-9.1/vtkRenderer.h:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstancePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataInstancePipeline.cc:26:
/usr/include/vtk-9.1/vtkOStreamWrapper.h:40:7: note: declaration of ‘class vtkSmartPointer<vtkRenderer>’
   40 | class vtkSmartPointer;
      |       ^~~~~~~~~~~~~~~
make[2]: *** [source/CMakeFiles/G4visVtk.dir/build.make:328: source/CMakeFiles/G4visVtk.dir/visualization/Vtk/src/G4VtkPolydataPolylinePipeline.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [source/CMakeFiles/G4visVtk.dir/build.make:104: source/CMakeFiles/G4visVtk.dir/visualization/Vtk/src/G4VtkUtility.cc.o] Error 1
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkUnstructuredGridPipeline.cc:48:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkUnstructuredGridPipeline.hh:40:10: fatal error: vtkStaticCleanUnstructuredGrid.h: No such file or directory
   40 | #include "vtkStaticCleanUnstructuredGrid.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [source/CMakeFiles/G4visVtk.dir/build.make:412: source/CMakeFiles/G4visVtk.dir/visualization/Vtk/src/G4VtkUnstructuredGridPipeline.cc.o] Error 1
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkStore.cc:58:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkUnstructuredGridPipeline.hh:40:10: fatal error: vtkStaticCleanUnstructuredGrid.h: No such file or directory
   40 | #include "vtkStaticCleanUnstructuredGrid.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [source/CMakeFiles/G4visVtk.dir/build.make:188: source/CMakeFiles/G4visVtk.dir/visualization/Vtk/src/G4VtkStore.cc.o] Error 1
make[2]: *** [source/CMakeFiles/G4visVtk.dir/build.make:272: source/CMakeFiles/G4visVtk.dir/visualization/Vtk/src/G4VtkPolydataInstancePipeline.cc.o] Error 1
In file included from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstancePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstanceTensorPipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataInstanceTensorPipeline.cc:26:
/mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:188:34: error: field ‘renderer’ has incomplete type ‘vtkSmartPointer<vtkRenderer>’
  188 |     vtkSmartPointer<vtkRenderer> renderer;
      |                                  ^~~~~~~~
In file included from /usr/include/vtk-9.1/vtkSystemIncludes.h:52,
                 from /usr/include/vtk-9.1/vtkDebugLeaksManager.h:29,
                 from /usr/include/vtk-9.1/vtkAutoInit.h:18,
                 from /usr/include/vtk-9.1/vtkRenderingCoreModule.h:50,
                 from /usr/include/vtk-9.1/vtkRenderer.h:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VVtkPipeline.hh:35,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataPipeline.hh:30,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstancePipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/include/private/G4VtkPolydataInstanceTensorPipeline.hh:29,
                 from /mnt/d/OneDrive/Libraries/GEANT4/geant4/source/visualization/Vtk/src/G4VtkPolydataInstanceTensorPipeline.cc:26:
/usr/include/vtk-9.1/vtkOStreamWrapper.h:40:7: note: declaration of ‘class vtkSmartPointer<vtkRenderer>’
   40 | class vtkSmartPointer;
      |       ^~~~~~~~~~~~~~~
[...]

I have no problem with CMAKE:

 sudo cmake -DCMAKE_INSTALL_PREFIX=../install/                                             -DGEANT4_BUILD_MULTITHREADED=ON                                                -DCMAKE_BUILD_TYPE=Release
  -DCMAKE_CXX_STANDARD=17                                                        -DGEANT4_INSTALL_DATA=ON                                                       -DGEANT4_INSTALL_DATASETS_TENDL=ON                                             -DCMAKE_INSTALL_DATADIR=/mnt/d/OneDrive/Libraries/G4Data                       -DGEANT4_USE_GDML=ON                                                           -DGEANT4_USE_INVENTOR_QT=ON                                                    -DGEANT4_USE_QT=ON                                                             -DGEANT4_USE_VTK=ON                                                            -DGEANT4_USE_RAYTRACER_X11=ON                                                  -DGEANT4_USE_OPENGL_X11=ON                                                     -DGEANT4_USE_SYSTEM_CLHEP=OFF
                      -DGEANT4_USE_SYSTEM_EXPAT=ON                                                   -DGEANT4_USE_SYSTEM_ZLIB=OFF                                                   /mnt/d/OneDrive/Libraries/GEANT4/geant4
-- Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL GLX
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Reusing dataset G4NDL (4.7)
-- Reusing dataset G4EMLOW (8.5)
-- Reusing dataset PhotonEvaporation (5.7)
-- Reusing dataset RadioactiveDecay (5.6)
-- Reusing dataset G4PARTICLEXS (4.0)
-- Reusing dataset G4PII (1.3)
-- Reusing dataset RealSurface (2.2)
-- Reusing dataset G4SAIDDATA (2.0)
-- Reusing dataset G4ABLA (3.3)
-- Reusing dataset G4INCL (1.2)
-- Reusing dataset G4ENSDFSTATE (2.3)
-- Reusing dataset G4TENDL (1.4)
-- The following Geant4 features are enabled:
CMAKE_CXX_STANDARD: Compiling against C++ Standard '17'
GEANT4_BUILD_MULTITHREADED: Build multithread enabled libraries
GEANT4_BUILD_TLS_MODEL: Building with TLS model 'initial-exec'
GEANT4_USE_SYSTEM_EXPAT: Using system EXPAT library
GEANT4_USE_GDML: Building Geant4 with GDML support
GEANT4_USE_INVENTOR_QT: Build OpenInventor Qt Driver
GEANT4_USE_VTK: Using VTK for visualisation
GEANT4_USE_OPENGL_X11: Build Geant4 OpenGL driver with X11 support
GEANT4_USE_RAYTRACER_X11: Build RayTracer driver with X11 support
GEANT4_USE_QT: Build Geant4 with Qt5 support
GEANT4_USE_QT3D: Build Geant4 Qt3D driver

-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/geant4/build

Am I missing something ?
I try to compile G4.11.2.1 with vtk9.1:

libvtk9-dev is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
libvtk9-java is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
libvtk9-qt-dev is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
libvtk9.1 is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
libvtk9.1-qt is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
python3-vtk9 is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
vtk9 is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
vtk9-doc is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).
vtk9-examples is already the newest version (9.1.0+really9.1.0+dfsg2-3build1).

Maybe the vtk you are using wasnt compiled using c++17