GEANT4 and Qt5 Drivers

Hello!! I am trying to make Geant4.11.02 run on my laptop. I am currently running my B1 example, but the output is wrong - could you help me, please, with some advice? I am not certain about this, but could the issue be related to the path towards the Qt5 drivers?

Note: The screenshot with the output is here.

1 Like

Hi Alexandru

tells me you have not built with any graphics drivers. See Building and Installing from Source — Geant4 Installation Guide 11.0 documentation. I’d go for the Qt driver

-DGEANT4_USE_QT=ON

but you may also need

-DCMAKE_PREFIX_PATH=<path to Qt>

where <path-to-Qt> is where you have installed Qt. (Note: Install the latest version of Qt5 - Geant4 cannot yet build with Qt6.)

If you don’t want to go to the trouble of installing Qt, you will still need graphics libraries such as OpenGL and a windowing system such as X11.

The graphics drivers that are built by default (and which are available in your app) - DAWNFILE, HepRepFile, VRML2FILE - are what we cal “file-writing drivers”, so if you

/vis/open VRLM2FILE

will cause a file to be written, which you can view offline with a browser.

Hope that helps

John

Dear John,

Thank you very much for the answer and for letting me know!

However, there is one issue: I have managed to install the Qt5 library (I have a screenshot attached here as well).

I have tried as well the option of setting -DCMAKE_PREFIX_PATH = <my_anaconda3_path_to_Qt5>, but I still received the same error. Would you have some advice on this regard?

Once again, thank you very much for the answer!

Alexandru

Moreover, apart from the B1 example, I am also running the build-directory next to the install geant4 folder (I am running on geant4-v11.0.2). When I am running the cmake command I get the following output (Screenshot attached here as well):

I get, once again, the issue of the Qt5 packages (although it shows to me on terminal that the packages are installed), and I also get the error on a runtime library which I really do not know how to approach.

Might you help me, please, with some advice?

Hi Alexandru

I’m not an installation expert, and if we can’t solve this, I will pass you on to someone more expert than me. But clearly, the CMAKE_PREFIX_PATH you provide is (a) not finding your Qt and (b) hiding other libraries. Try being more specific:

-DCMAKE_PREFIX_PATH=/home/user/ananconda3/lib/qt5

or something.

You also seem to have an old version of Qt around (Qt3) but if you get CMAKE_PREFIX_PATH right that might not be a problem.

Good luck
John

This last error is due to a mix of the anaconda and system libraries being found, which may lead to weird mixing, as the error message notes.

As this looks like an Ubuntu system, I’d strongly recommend installing Qt5 through the system package manager instead of those from anaconda (NB: there is a Conda-forge package of Geant4 available Geant4 :: Anaconda.org). This is also likely to have a more up-to-date version of Qt and allow the use of Qt53D.