Can not find libG4graphics_reps.so

Hello everyone,
I’m a beginner at G4.
I have a fresh installation of Ubuntu 20.04 LTS with all the required dependencies (cmake, cmake-curses-gui, gcc, g++, libexpat1-dev, qt5-default, libxmu-dev, libmotif-dev), when I compile Geant4.10.07.p02 source code and try to run the example B1 it returns this error :
./exampleB1: error while loading shared libraries: libG4graphics_reps.so: cannot open shared object file: No such file or directory
Given that I have already sourced the Geant4 source file located in the share folder.
Does anyone have a solution or suggestion to my problem.
Thank you for taking the time to respond.

is it the source file located in the installation destination, or are you maybe mistakenly sourcing the file in the share folder of the geant4 sources file structure?

Thank you for your response.
Yes, I have followed the steps mentioned in the following video: Geant4 Tutorial 1: Installation and Testing of Geant4 - YouTube
As for the location of the geant4make.sh it is in the share folder as shows the picture below:

.
If you have any detailed installation guide for Ubuntu it’s most welcome.

The YouTube video to which you refer is very popular - I have just had a look - but if it is not working for you, you should raise an issue on that YouTube thread. The official installation instructions can be found in the User Support section of the Geant4 web page, specifically Installation Guide — Geant4 Installation Guide 10.7 documentation. Please check that your installation procedure conforms with that.

To have video guides like this would be great, and it is good that the author has done this and obviously helped many people. If he - or anyone - wishes to do this on behalf of Geant4, and in collaboration with the Geant4 team so that it is always up to date, it would be very welcome. Meanwhile, we just have the written guide.

Incidentally, the author of the video says, “Geant4…was developed at CERN”. In fact Geant4 is an international collaboration independent of CERN, although, of course, strongly supported by CERN…and also by other institutions and individuals around the world.

1 Like

Thank you for taking the time to check the video and to respond.
Actually I have tried many ways to install G4 one of which is following the guide you mentioned above, the reason I mentioned the video is at first following it allowed me to run the example B1 with no problems but after rebooting my PC running the example would result in error messages of files not being found, and thus I began a journey of installing and deleting G4, changing systems from Windows to Ubuntu to CentOS while always following the official guide but I wouldn’t even get the chance to run the example since there are always error messages, I even tried to change the version of G4 it was all in vain and now even following the aforementioned video I can’t run the first example and that’s the error that’s giving back, the weird part is that when I try to look the file up it does exist and I don’t know how to proceed now, would you please help me if you have any idea of what might be the problem? Also can I install the pre-clmpiled version on ubuntu and if so do you know of any documentation that would help me to do so since there’s no mention of this in the official guide.

as you mention the example running fine before rebooting: you would have to source the geant source file again each time you open a fresh terminal/command line.

you can check if the settings are currently valid with the „env“ command

Thank you for providing me with help.
I tried to re-install Geant4 and somehow I didn’t get that problem again and it seems to works fine aside from having to export the 11 Data files each time I open a terminal which something that I can live with since it doesn’t take much time to do.

If you source the installed <path-to-G4>/bin/geant4.sh script, that should define all of the dataset envvars for you.