I’m trying to build G4 with VTK support. I have built VTK 9.1 (latest) from source (the only way to get a vtk-config.cmake file?), but I get this during G4 compilation:
/root/src/source/interfaces/common/src/G4Qt.cc:43:10: fatal error: QVTKOpenGLNativeWidget.h: No such file or directory
43 | #include "QVTKOpenGLNativeWidget.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [source/CMakeFiles/G4interfaces.dir/build.make:219: source/CMakeFiles/G4interfaces.dir/interfaces/common/src/G4Qt.cc.o] Error 1
This is probably not relevant to your problem, but I would not put Geant4 source under /root/ - using root is dangerous. Also, there is normally another level of (sub-)directory, geant4-v11.0.0, if you have downloaded in the canonical way:
A side note: it seems to me that the only way to have vtk-config.cmake installed (this is what CMake looks for when configuring the G4 build) is to build VTK from source. I tried installing official binaries but could not make VTK discoverable by G4.
@allison Doesn’t Homebrew do build-from-source? I haven’t had to install anything new in a while, but my memory is that it downloads a tarball, and does a compile-link-install build. Maybe it depends on the particular package…
Yes, the Homebrew bottle comes from a source build. What is a bit unfortunate is that (as far as I understand) the official VTK Python Wheels do not ship with the CMake config file.
FYI: I’m struggling to build VTK with Qt support in my Docker container. I opened a new topic on the VTK forum.
In general getting Vtk working from within docker is a challenge. Can I ask what your host system is? If it a Mac as the old OpenGL Xwindows support on Mac means a software renderer will have to be used.
I have fragments of docker files that might be able to help you, I’ll dig links to them for you