Installing Geant4-v11.0.0

I just installed the newest version of Geant4, version 11 following the YouTube guide by Physics Matters.
I’m still not very familiar with Ubuntu yet.

When I go to run exampleB1 to test if the installation has worked correctly, I get the following error:

[ 12%] Building CXX object CMakeFiles/exampleB1.dir/exampleB1.cc.o
/home/mjamie30/Geant4/geant4-v11.0.0/examples/basic/B1/exampleB1.cc:33:10: fatal error: G4RunManagerFactory.hh: No such file or directory
#include "G4RunManagerFactory.hh"
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/exampleB1.dir/build.make:75: recipe for target ‘CMakeFiles/exampleB1.dir/exampleB1.cc.o’ failed
make[2]: *** [CMakeFiles/exampleB1.dir/exampleB1.cc.o] Error 1
CMakeFiles/Makefile2:83: recipe for target ‘CMakeFiles/exampleB1.dir/all’ failed
make[1]: *** [CMakeFiles/exampleB1.dir/all] Error 2
Makefile:135: recipe for target ‘all’ failed
make: *** [all] Error 2

I can still run my older 10.7 simulations without issue.
The new version of Geant4 is installed in a new location not needing permissions.
I think it cant find the G4RunManagerFactory.hh, but I don’t know how to tell the new Geant4 version where to look or what to look for.

Any idea where too look to solve this?

Thank you.

Don’t rely on unofficial videos - the official documentation is to be found on the Geant4 Web site.

I don’t know the solution to your specific problem, but Geant4 11.0 is a major release and some things have changed. Have a look at the Release Notes. Any changes required of the user should be prominently mentioned. In particular, look for anything about the analysis manager.

(Sorry - scrub that bit about the analysis manager - I misread your post.)

Try running make VERBOSE=1 to get the full compilation commands printed and check that the header paths to Geant4 correspond to where you installed 11.0. You can also check the contents of the CMakeCache.txt in the directory where you are building exampleB1 and look for the Geant4_DIR variable. This should point to where CMake found Geant4 and correspond to where you installed 11.0.

Thank you. Cmake was pointing to my old Geant4 build folder. My bad :\

But now I have a new error which happens when i run exampleB1 with and without the UI.
./exampleB1: symbol lookup error: ./exampleB1: undefined symbol: _ZN12G4RayTracerXC1Ev

In cmake curses, when I turn off WITH_GEANT4_UIVIS, (for testing), i get the error
./exampleB1: symbol lookup error: ./exampleB1: undefined symbol: _ZN21G4NistMaterialBuilder19FindOrBuildMaterialERK8G4Stringb

My searching online tells me that there is a linking issue?
using LD_DEBUG ./exampleB1 I get a huge output and at the end is
128981: ./exampleB1: error: symbol lookup error: undefined symbol: _ZN12G4RayTracerXC1Ev (fatal)

Deleting the exampleB1 build file, I noticed cmake GEANT4_DIR defaulted to the old version of Geant4 (not sure how to address this without repeatedly changing GEANT4_DIR for every new piece of work). However, I still get the same errors as above.

Thank you for your assistance.

Same procedure as before - run make clean && make VERBOSE=1. Check that at the link step that G4RayTracer and other Geant4 libraries are linked. When built, run ldd ./exampleB1 and see if any of the listed libraries are marked as “not found”. Run readelf -d ./exampleB1 and see what libraries are listed as (NEEDED) and if there is an entry for (RPATH). Post the output from all of those here.

Thank you, I redid the process,
Deleted the build files, cmake, make clean, and it worked!

make VERBOSE=1 showed that G4RayTracer was linked correctly.
Also the cmake Geant4_DIR seems to permanently point to the new geant4 version; I tried B2a as well which worked.
I think the ‘make clean’ was what help.

Thank you very much.

1 Like

Apologies, I started to get undefined symbol errors again.
The exampleB1 & B2 still works fine but as for my older work using GEANT4 10.7 & GEANT4 11, I get these errors.

I continued with what you suggested in your previous post.

Using ldd ./Activation (this is the G4 example I modified months ago), I get nothing marked “not found” that I can see.

Using readelf -d ./Activation I get a bunch of needed libraries. I cant see RPATH. Not sure why this is the case. Could it be because I update Cmake to version 3.22.2 from 3.18.1? or Geant4 to version 11?

Output of readelf -d ./Activation
Dynamic section at offset 0x29380 contains 55 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libG4Tree.so]
0x0000000000000001 (NEEDED) Shared library: [libG4FR.so]
0x0000000000000001 (NEEDED) Shared library: [libG4GMocren.so]
0x0000000000000001 (NEEDED) Shared library: [libG4visHepRep.so]
0x0000000000000001 (NEEDED) Shared library: [libG4RayTracer.so]
0x0000000000000001 (NEEDED) Shared library: [libG4VRML.so]
0x0000000000000001 (NEEDED) Shared library: [libG4OpenGL.so]
0x0000000000000001 (NEEDED) Shared library: [libG4vis_management.so]
0x0000000000000001 (NEEDED) Shared library: [libG4modeling.so]
0x0000000000000001 (NEEDED) Shared library: [libG4interfaces.so]
0x0000000000000001 (NEEDED) Shared library: [libG4physicslists.so]
0x0000000000000001 (NEEDED) Shared library: [libG4run.so]
0x0000000000000001 (NEEDED) Shared library: [libG4event.so]
0x0000000000000001 (NEEDED) Shared library: [libG4tracking.so]
0x0000000000000001 (NEEDED) Shared library: [libG4processes.so]
0x0000000000000001 (NEEDED) Shared library: [libG4analysis.so]
0x0000000000000001 (NEEDED) Shared library: [libG4digits_hits.so]
0x0000000000000001 (NEEDED) Shared library: [libG4track.so]
0x0000000000000001 (NEEDED) Shared library: [libG4particles.so]
0x0000000000000001 (NEEDED) Shared library: [libG4geometry.so]
0x0000000000000001 (NEEDED) Shared library: [libG4materials.so]
0x0000000000000001 (NEEDED) Shared library: [libG4intercoms.so]
0x0000000000000001 (NEEDED) Shared library: [libG4global.so]
0x0000000000000001 (NEEDED) Shared library: [libG4clhep.so]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [/usr/local/lib:]
0x000000000000000c (INIT) 0xa5c8
0x000000000000000d (FINI) 0x22f14
0x0000000000000019 (INIT_ARRAY) 0x2287d8
0x000000000000001b (INIT_ARRAYSZ) 168 (bytes)
0x000000000000001a (FINI_ARRAY) 0x228880
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x298
0x0000000000000005 (STRTAB) 0x28a0
0x0000000000000006 (SYMTAB) 0x380
0x000000000000000a (STRSZ) 16907 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000015 (DEBUG) 0x0
0x0000000000000003 (PLTGOT) 0x229730
0x0000000000000002 (PLTRELSZ) 6336 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0x8d08
0x0000000000000007 (RELA) 0x6ea8
0x0000000000000008 (RELASZ) 7776 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000000000001e (FLAGS) BIND_NOW
0x000000006ffffffb (FLAGS_1) Flags: NOW PIE
0x000000006ffffffe (VERNEED) 0x6dc8
0x000000006fffffff (VERNEEDNUM) 4
0x000000006ffffff0 (VERSYM) 0x6aac

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