Program outputs to UI instead of terminal

Geant4 Version: 10.4.3
Operating System: macOS Monterey 12.7.4
Compiler/Version: Apple clang version 14.0.0 (clang-1400.0.29.202)
CMake Version: 3.20.

I am following along the Physics Matters tutorial and much of the simulation outputs onto the GUI terminal instead of my actual terminal. How do I make the output of the simulation print to my actual terminal?

I am attaching an example of photon hits being recorded on the GUI terminal.

Also, for some reason the GUI terminal is quite dark. Why is this happening?

Hi James

I’m amazed you have Geant4 10.4 compiling and working - that’s a 2017 release - and managed to find good, matching, installation guidance. (Incidentally, I’m not aware of the Physics Matters tutorial. Is it an official Geant4 tutorial? Personally, I always go back to the official Installation Guide. You can find “Old versions” on the Documentation page.)

2017 would be the early days of the Qt GUI. The modern GUI looks a lot different. Or is it an Xm (motif) GUI? The problem is that what might have worked fine at the time may no longer behave nicely, because the underlying libraries have evolved. This is a general problem we have with graphics libraries - they are always “improving”!! That sort-of explains why your GUI is dark, but I have no idea how to fix it.

Not easy. Most output statements use G4cout (instead of std::cost), and it redirects the output to whatever UI you are using. If you’re prepared to do without a GUI, choose a different type of session. With tcsh, all output will go to the terminal. You can choose at run time with the environment:

export G4UI_USE_TCSH=1  # in a bash shell
setenv G4UI_USE_TCSH 1  # in a C-shell

or, if you do not want to pollute your environment permanently:

G4UI_USE_TCSH=1 ./your-app

There are other ways of selecting the session at run time - see How to Set Up an Interactive Session — Book For Application Developers 11.2 documentation.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.