Error in execution of basic.cc
shanto268 opened this issue · 3 comments
I was trying to see if CADmesh was working on my mac (OS Sierra) system by trying to use the basic example file.
Here is what I did,
$ cd examples/basic
$ mkdir build
$ cd build
$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/sshanto/hep/wtp_mc/CADMesh/CADMesh-master/examples/basic/build
$ make
In file included from /Users/sshanto/hep/wtp_mc/CADMesh/CADMesh-master/examples/basic/basic.cc:24:
In file included from /Users/sshanto/hep/g4/geant4.10.06.p01-install/include/Geant4/G4VUserDetectorConstruction.hh:37:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:275:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:16:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:644:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3710:5: warning: destructor called on non-final 'CADMesh::File::BuiltInReader' that has virtual functions but
non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
_data.second()._Tp();_Tp();
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3666:5: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<CADMesh::File::BuiltInReader,
std::__1::allocatorCADMesh::File::BuiltInReader >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a)
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:4331:26: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<CADMesh::File::BuiltInReader,
std::__1::allocatorCADMesh::File::BuiltInReader >::__shared_ptr_emplace' requested here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:4710:29: note: in instantiation of function template specialization
'std::__1::shared_ptrCADMesh::File::BuiltInReader::make_shared<>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
/Users/sshanto/hep/wtp_mc/CADMesh/CADMesh-master/examples/basic/../../CADMesh.hh:2530:15: note: in instantiation of function template specialization
'std::__1::make_sharedCADMesh::File::BuiltInReader' requested here
return std::make_shared();
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3710:23: note: qualify call to silence this warning
_data.second().
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3710:5: warning: destructor called on non-final 'CADMesh::TessellatedMesh' that has virtual functions but
non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
_data.second()._Tp();_Tp();
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3671:9: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<CADMesh::TessellatedMesh,
std::__1::allocatorCADMesh::TessellatedMesh >::__on_zero_shared' requested here
__shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:4331:26: note: in instantiation of function template specialization
'std::__1::__shared_ptr_emplace<CADMesh::TessellatedMesh, std::__1::allocatorCADMesh::TessellatedMesh >::__shared_ptr_emplace<G4String &, CADMesh::File::Type>' requested
here
::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:4710:29: note: in instantiation of function template specialization
'std::__1::shared_ptrCADMesh::TessellatedMesh::make_shared<G4String &, CADMesh::File::Type>' requested here
return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
^
/Users/sshanto/hep/wtp_mc/CADMesh/CADMesh-master/examples/basic/../../CADMesh.hh:1106:15: note: in instantiation of function template specialization
'std::__1::make_shared<CADMesh::TessellatedMesh, G4String &, CADMesh::File::Type>' requested here
return std::make_shared(file_name, File::PLY);
^
/Users/sshanto/hep/wtp_mc/CADMesh/CADMesh-master/examples/basic/basic.cc:83:54: note: in instantiation of member function
'CADMesh::CADMeshTemplateCADMesh::TessellatedMesh::FromPLY' requested here
auto sphere_mesh = CADMesh::TessellatedMesh::FromPLY("./sphere.ply");
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:3710:23: note: qualify call to silence this warning
_data.second().
^
2 warnings generated.
[100%] Linking CXX executable basic
[100%] Built target basic
$ ./basic
Geant4 version Name: geant4-10-06-patch-01 (14-February-2020)
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/
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...
You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLImmediateQt (OGLIQt, OGLI)
OpenGLStoredQt (OGLSQt, OGL, OGLS)
RayTracerX (RayTracerX)
Registering model factories...
You have successfully registered the following model factories.
Registered model factories:
generic
drawByAttribute
drawByCharge
drawByOriginVolume
drawByParticleID
drawByEncounteredVolume
Registered filter factories:
attributeFilter
chargeFilter
originVolumeFilter
particleFilter
encounteredVolumeFilter
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.
ERROR: G4VisCommandSceneHandlerCreate::SetNewValue: could not find fallback graphics system for "OGL".
ERROR: G4VisCommandViewerCreate::SetNewValue: no scene handlers.
Create a scene handler with "/vis/sceneHandler/create"
ERROR: G4VisCommandsViewerSet::SetNewValue: no current viewer.
ERROR: G4VisCommandsViewerSet::SetNewValue: no current viewer.
WARNING: Scene handler not found.
ERROR: Current scene handler not defined. Please select or create one.
/tracking/storeTrajectory 1
Attributes available for modeling and filtering with
"/vis/modeling/trajectories/create/drawByAttribute" and
"/vis/filtering/trajectories/create/attributeFilter" commands:
G4TrajectoriesModel:
Event ID (EventID): G4int
Run ID (RunID): G4int
G4Trajectory:
Charge (Ch): unit: e+ (G4double)
Track ID (ID): G4int
Initial kinetic energy (IKE): G4BestUnit (G4double)
Initial momentum magnitude (IMag): G4BestUnit (G4double)
Initial momentum (IMom): G4BestUnit (G4ThreeVector)
No. of points (NTP): G4int
PDG Encoding (PDG): G4int
Parent ID (PID): G4int
Particle Name (PN): G4String
G4TrajectoryPoint:
Position (Pos): G4BestUnit (G4ThreeVector)
WARNING: Trajectory storing has been requested. This action may be
reversed with "/tracking/storeTrajectory 0".
WARNING: Scene handler not found.
ERROR: No current sceneHandler. Please create one.
Available UI session types: [ Qt, GAG, tcsh, csh ]
Can you help me with why I am facing this issue?
Try and change the graphics view to use. Around like 211 of basic.cc
, try changing this line:
ssession->ApplyCommand("/vis/open OGL 500x500-500-50");
to something like this:
session->ApplyCommand("/vis/open OGLI 500x500-500-50");
That is, OGL, to OGLI, or try changing it to any of the other graphics systems that appear to be available on your system:
OpenGLImmediateQt (OGLIQt, OGLI)
OpenGLStoredQt (OGLSQt, OGL, OGLS)
Hi @christopherpoole , after I have tinkered around with all possible permutations of the graphics systems I have found that none works. However, the good thing is whenever I manually input "/vis/open OGL 500x500-500-50" in IDLE browser it does work. I don't understand what the problem is really but it seems like its more of a problem with my local system rather than CADMesh (I may be wrong). Anyways, thank you for getting back to me and again great job on the CADMesh, as an undergraduate researcher in High Energy Physics this tool is super important to my line of work.
That is interesting. Maybe I will put all of the macro commands in a proper macro file.
Thanks for the feedback!