Hi everyone. I installed Geant4-10.05 with -DGEANT4_BUILD_MULTITHREADED=ON It works ok with defined G4MULTITHREADED variable which set G4MTRunManager instead of G4RunManager in examples. But if I want to swap to sequential mode by writing at the top of the main file: #undef G4MULTITHREADED It does not compile and return following error: CMakeFiles/exampleB4c.dir/exampleB4c.cc.o: In function `(anonymous namespace)::PrintUsage()': exampleB4c.cc:(.text+0x4): undefined reference to `G4cerr' CMakeFiles/exampleB4c.dir/exampleB4c.cc.o: In function `TFTFP_BERT<G4VModularPhysicsList>::SetCuts()': exampleB4c.cc:(.text._ZN10TFTFP_BERTI21G4VModularPhysicsListE7SetCutsEv[_ZN10TFTFP_BERTI21G4VModularPhysicsListE7SetCutsEv]+0xd): undefined reference to `G4cout' CMakeFiles/exampleB4c.dir/exampleB4c.cc.o: In function `TFTFP_BERT<G4VModularPhysicsList>::TFTFP_BERT(int)': exampleB4c.cc:(.text._ZN10TFTFP_BERTI21G4VModularPhysicsListEC1Ei[_ZN10TFTFP_BERTI21G4VModularPhysicsListEC1Ei]+0x85): undefined reference to `G4cout' collect2: error: ld returned 1 exit status gmake[2]: *** [exampleB4c] Error 1 gmake[1]: *** [CMakeFiles/exampleB4c.dir/all] Error 2 gmake: *** [all] Error 2 Tested on example B4c. The same I encountered in my program with different physics list: QGSP_BERT. G4MTRunManager->SetNumberOfThreads(1) is a solution, but it gives additional root output file: output.root output_t0.root And lateral only usable. OS: Scientific Linux 7
You cannot modify the setup by hacking the code that way… if you need a sequential installation of Geant4, reinstall Geant4 with GEANT4_MULTITHREADED=OFF, or execute your application forcing it to use a single thread (i.e. use the UI command “/run/numberOfThreads 1”).