alcap-org / g4sim

Simulation toolkit based on Geant4 and ROOT
http://wuchen1106.github.io/g4sim/
2 stars 2 forks source link

Cannot use Qt interface #49

Closed benkrikler closed 9 years ago

benkrikler commented 9 years ago

It would be helpful if I could use G4's Qt interface but Geant4 doesn't seem to have compiled with this supported. I know it's possible on my machine since I have this running for Comet's software, but my initial first attempts at resolving this (changing the CMakeLists.txt file) haven't worked. Has anyone else managed and can they point me in the right direction?

thnam commented 9 years ago

I think that you would change the line: https://github.com/alcap-org/g4sim/blob/8ad85f91b7e8828a6805f600e1fba206d5eb52f0/install-geant4.sh#L34

to something like:

cmake -DCMAKE_INSTALL_PREFIX=../geant4-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_G3TOG4=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_USE_QT=ON ../geant${GEANT4_VERSION}/ 2>&1 |tee install_log.txt

I'm not so sure about this, but using both X11 and Qt on my machine causes some problem in run time. YMMV

And yes, you will need to have libqt-devel (or some similar thing?) installed.

thnam commented 9 years ago

Or you can configure the options through the ccmake:

cd geant4_build_dir

ccmake ../geant4_src_dir
benkrikler commented 9 years ago

Thanks for the help Nam! I changed the cmake config (I used the command line option in your first comment) and then I could see things compiling.

There were a few additional steps as well, so in case anyone else is interested, once you've reconfigured cmake as above, do:

That last line is needed to force G4UIExecutive to pick Qt. There are other ways to select it (command line options and a hidden .g4session file, but this seems easiest. I put it into my env.sh script so i get it every time I set up to run. Now I get the Qt interface by default!

benkrikler commented 9 years ago

Oh and here's the Gui I get out of this. It's mega easy to manipulate the visualisation and check the geometry since I think Chen's set some stuff up quite nicely here already.

gui