HaarigerHarald / geant4_pybind

Alternative Python bindings for Geant4
The Unlicense
33 stars 6 forks source link

error in running exampleB1 #6

Closed Reni-masterhouse closed 10 months ago

Reni-masterhouse commented 2 years ago

I am using geant4_pybind with Mac OS 10.15.7 and python 3.9. After installing it, I tried to run examples to check the correctness. After running exampleB1, I get

Available UI session types: [ tcsh, csh ]

          ################################
          !!! G4Backtrace is activated !!!
          ################################

**************************************************************
 Geant4 version Name: geant4-11-00 [MT]   (10-December-2021)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

<<< Reference Physics List QBBC
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...

You have successfully registered the following graphics systems.
Registered graphics systems are:
  ASCIITree (ATree)
  DAWNFILE (DAWNFILE)
  G4HepRepFile (HepRepFile)
  RayTracer (RayTracer)
  VRML2FILE (VRML2FILE)
  gMocrenFile (gMocrenFile)

Registering model factories...

You have successfully registered the following model factories.
Registered model factories:
  generic
  drawByAttribute
  drawByCharge
  drawByOriginVolume
  drawByParticleID
  drawByEncounteredVolume

Registered models:
  None

Registered filter factories:
  attributeFilter
  chargeFilter
  originVolumeFilter
  particleFilter
  encounteredVolumeFilter

Registered filters:
  None

You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none

Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
/control/saveHistory
/run/verbose 2
#
# Change the default number of threads (in multi-threaded mode)
#/run/numberOfThreads 4
#
# Initialize kernel
/run/initialize
userDetector->Construct() start.
Checking overlaps for volume Envelope:0 (G4Box) ... OK!
Checking overlaps for volume Shape1:0 (G4Cons) ... OK!
Checking overlaps for volume Shape2:0 (G4Trd) ... OK!
World is registered to the default region.
physicsList->Construct() start.
### HadronInelasticQBBC Construct Process:
    Emin(FTFP)= 3 GeV; Emax(FTFP)= 100000 GeV
    Emin(BERT)= 1 GeV; Emax(BERT)= 6 GeV; Emax(BERTpions)= 12 GeV;
    Emin(BIC) = 0 GeV; Emax(BIC)= 1.5 GeV.
### Adding tracking cuts for neutron  TimeCut(ns)= 10000  KinEnergyCut(MeV)= 0
physicsList->CheckParticleList() start.
physicsList->setCut() start.
#
# Visualization setting
/control/execute vis.mac
# Macro file for the visualization setting in the initialization phase
# of the B1 example when running in interactive mode
#
# Use these open statements to open selected visualization
#
# Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
/vis/sceneHandler/create OGL
parameter value (OGL) is not listed in the candidate List.
  Candidates are: ASCIITree ATree DAWNFILE G4HepRepFile HepRepFile RayTracer VRML2FILE gMocrenFile

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : UIMAN0123
      issued by : G4UImanager::ApplyCommand
Invoked command has failed - see above. Available graphics systems are (short names):
  ATree DAWNFILE HepRepFile RayTracer VRML2FILE gMocrenFile
Error code : 500
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

***** Illegal parameter (0) </vis/open OGL 600x600-0+0> *****

***** Batch is interrupted!! *****

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : UIMAN0123
      issued by : G4UImanager::ApplyCommand
Command aborted (500)
Error code : 500
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

***** Illegal parameter (0) </control/execute vis.mac> *****

***** Batch is interrupted!! *****

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : UIMAN0123
      issued by : G4UImanager::ApplyCommand
Command aborted (500)
Error code : 500
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

I have downloaded all the g4 data. The error seems to happen at

parameter value (OGL) is not listed in the candidate List.
  Candidates are: ASCIITree ATree DAWNFILE G4HepRepFile HepRepFile RayTracer VRML2FILE gMocrenFile

Could you please provide any help? Thank you!

HaarigerHarald commented 2 years ago

Hi,

the prebuilt OSX wheels don't contain a default OpenGL viewer, that's why you encountered this error. If you need OpenGL visualization the only option currently is to compile Geant4 and the bindings yourself using the appropriate CMAKE options:

https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/installguide.html#buildandinstall

The reason for this is that the OpenGL visualization options for OSX are limited and I wasn't sure whether using QT would work with the 60 mb limit for wheels on PyPi.

HaarigerHarald commented 10 months ago

The prebuilt wheels now contain Qt5 visualization.

Reni-masterhouse commented 10 months ago

wow…thank you for still improving this project