OpenGL for mac Sonoma 14.0


I am using the following versions:

Geant4 Version: geant4-v11.2.0
Operating System:Sonoma 14.0
CMake Version:cmake version 3.28.1

I compiled using the following command:


where mysettings.cmake looks like this:

set(X11_X11_INCLUDE_PATH "/opt/X11/include" CACHE STRING "")

set(X11_X11_LIB "/opt/X11/lib/libX11.dylib" CACHE STRING "")

set(X11_ICE_INCLUDE_PATH "/opt/X11/include" CACHE STRING "")

set(X11_ICE_LIB "/opt/X11/lib/libICE.dylib" CACHE STRING "")

set(X11_SM_INCLUDE_PATH "/opt/X11/include" CACHE STRING "")

set(X11_SM_LIB "/opt/X11/lib/libSM.dylib" CACHE STRING "")

set(X11_Xext_INCLUDE_PATH "/opt/X11/include" CACHE STRING "")

set(X11_Xext_LIB "/opt/X11/lib/libXext.dylib" CACHE STRING "")

set(X11_Xmu_INCLUDE_PATH "/opt/X11/include" CACHE STRING "")

set(X11_Xmu_LIB "/opt/X11/lib/libXmu.dylib" CACHE STRING "")

set(X11_Xt_INCLUDE_PATH "/opt/X11/include" CACHE STRING "")

set(X11_Xt_LIB "/opt/X11/lib/libXt.dylib" CACHE STRING "")

so that the libraries for XQuartz and X11 are used consistently.

With this, OGLIX works perfectly fine. However, OGL does not work.
I get this error:

***** Illegal parameter (0) </vis/open OGL> *****

I am using GNUMakefile for the compilation that looks like this:

name := example
G4TARGET := $(name)
G4EXLIB := true

ifndef G4INSTALL
  G4INSTALL = ../../../..

.PHONY: all
all: lib bin

CPPFLAGS += $(shell root-config --cflags)                 
EXTRALIBS := $(shell root-config --libs) $(shell root-config --glibs)  -ltbb -lGeom
EXTRALIBS +=-L$(G4INSTALL)/../../../lib/ -lG4OpenGL -lG4visQt3D -lG4gdml

include $(G4INSTALL)/config/architecture.gmk
include $(G4INSTALL)/config/binmake.gmk
        rm -f g4*.prim g4*.eps g4*.wrl
        rm -f .DAWN_*

The registered graphic systems when I executable seem to be:

Registered graphics systems are:

 ASCIITree (ATree)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  gMocrenFile (gMocrenFile)
  RayTracerX (RayTracerX)

so I do not see OGL as one of the registered graphic systems.

How can I make OGL work for this? I prefer OGL since it is easier to zoom and inspect the
detector geometry easily using the same drawn image which I see is not possible using OGLIX.

Any suggestions would be appreciated.


Hi Shilpi

Although I do not understand your problem in detail, the fact is, OGL*Qt is not available with Qt6. The work to migrate the OpenGL drivers is incomplete.

To deal with this, we programmed - or thought we had programmed - /vis/open OGL to invoke TOOLSG_QT_GLES. But in your case, it is not in the list of registered drivers. I’m not sure why not. It should be automatic with Qt. You seem to have developed your own installation procedure; could you please try the standard cmake one (see Installation Guide)?

I can’t investigate further at the moment but will have a look in the morning.


Hi John,

I think I did not write clearly. I am using cmake procedure to compile GEANT4 setup using the cmake command that I wrote and then make, make install.
However, for building my example geometry, I am using GNUMakefile that I shared above.
Do you mean standard cmake procedure for compiling the example geometry as well?


Ah, yes. That way it picks up all the cpp flags that G4VisExecutive uses to register graphics drivers.

OGL” is a generic name for the “best” available driver compiled into the application - so you should be able to use

/vis/open OGLSX

to make use of that driver (as OGLIX appears to be working for you). As @Allison notes, that isn’t usable with Qt6 as yet, but the X11 support you’re compiling can be used independently of that (you are just limited to the TCSH terminal interface instead of the Qt UI).

@bmorgan OGLSX works. However, I am unable to zoom it or re-orient it using just mouse click. Is there a way to do it with OGLSX or any other graphic system?

The best option would be to just use pure Qt and VTK - the latter especially. I’d also recommend using the CMake build procedure as it is more capable than the (now deprecated) GNUmake system. A guide to that can be found in the Install and Application Developer guides, or you can adapt the CMakeLists.txt files from the basic examples.

Hi @bmorgan

I’ll give this a try. Essentially there were some problems with the root cmakefile and the geant (to do the compilation of my program using CMake)
since I had used homebrew to install root.
I’ll try root installation using source and see if that works.

Thanks and cheers,