Geant4 Installation and Compilation Issue Troubleshooting Guide

  • Thread starter yguvvala
  • Start date
  • Tags
    geant4
In summary, the conversation discusses a problem with compiling and running an example application after successfully installing Geant4.8.3 according to instructions. The issue appears to be related to incompatible libraries and there is a suggestion to check the Makefile and try compiling and installing the necessary libraries. The individual also mentions wanting to check if the installation was successful before proceeding with their work.
  • #1
yguvvala
9
0
Hi,


I have installed Geant4.8.3 and i was prompted that i have installed it successfully i installed according to the instructions here

(http://geant4.slac.stanford.edu/tutorial/installation/Geant4.8.3/Linux/Geant4_8_3_Linux_Installation.htm )

i am trying to check my installation by compiling and running an example application mentioned but it dent compile and crash with an issue as bellows please look nd guide me .

login3% make
Making dependency for file A01app.cc ...
Making dependency for file src/A01Trajectory.cc ...
Making dependency for file src/A01PrimaryGeneratorMessenger.cc ...
Making dependency for file src/A01PrimaryGeneratorAction.cc ...
Making dependency for file src/A01PhysicsList.cc ...
Making dependency for file src/A01MuonPhysics.cc ...
Making dependency for file src/A01MagneticFieldMessenger.cc ...
Making dependency for file src/A01MagneticField.cc ...
Making dependency for file src/A01IonPhysics.cc ...
Making dependency for file src/A01HodoscopeHit.cc ...
Making dependency for file src/A01Hodoscope.cc ...
Making dependency for file src/A01HadronPhysics.cc ...
Making dependency for file src/A01HadCalorimeterHit.cc ...
Making dependency for file src/A01HadCalorimeter.cc ...
Making dependency for file src/A01GeneralPhysics.cc ...
Making dependency for file src/A01EventActionMessenger.cc ...
Making dependency for file src/A01EventAction.cc ...
Making dependency for file src/A01EMPhysics.cc ...
Making dependency for file src/A01EmCalorimeterHit.cc ...
Making dependency for file src/A01EmCalorimeter.cc ...
Making dependency for file src/A01DriftChamberHit.cc ...
Making dependency for file src/A01DriftChamber.cc ...
Making dependency for file src/A01DetectorConstruction.cc ...
Making dependency for file src/A01DetectorConstMessenger.cc ...
Making dependency for file src/A01CellParameterisation.cc ...
Making dependency for file src/A01AnalysisManager.cc ...
Compiling A01AnalysisManager.cc ...
Compiling A01CellParameterisation.cc ...
Compiling A01DetectorConstMessenger.cc ...
Compiling A01DetectorConstruction.cc ...
Compiling A01DriftChamber.cc ...
Compiling A01DriftChamberHit.cc ...
Compiling A01EmCalorimeter.cc ...
Compiling A01EmCalorimeterHit.cc ...
Compiling A01EMPhysics.cc ...
Compiling A01EventAction.cc ...
Compiling A01EventActionMessenger.cc ...
Compiling A01GeneralPhysics.cc ...
Compiling A01HadCalorimeter.cc ...
Compiling A01HadCalorimeterHit.cc ...
Compiling A01HadronPhysics.cc without optimization...
Compiling A01Hodoscope.cc ...
Compiling A01HodoscopeHit.cc ...
Compiling A01IonPhysics.cc ...
Compiling A01MagneticField.cc ...
Compiling A01MagneticFieldMessenger.cc ...
Compiling A01MuonPhysics.cc ...
Compiling A01PhysicsList.cc ...
Compiling A01PrimaryGeneratorAction.cc ...
Compiling A01PrimaryGeneratorMessenger.cc ...
Compiling A01Trajectory.cc ...
Creating/replacing object files in g4work//tmp/Linux-g++/A01app/libA01app.a ...
ar: creating g4work//tmp/Linux-g++/A01app/libA01app.a
Compiling A01app.cc ...
Using granular libraries ...
Linking A01app ...
/opt/apps/binutils-amd/070220/bin/ld: skipping incompatible /usr/X11R6/lib/libGLU.a when searching for -lGLU
/opt/apps/binutils-amd/070220/bin/ld: skipping incompatible /usr/X11R6/lib/libGL.so when searching for -lGL
/opt/apps/binutils-amd/070220/bin/ld: skipping incompatible /usr/X11R6/lib/libGL.a when searching for -lGL
/opt/apps/binutils-amd/070220/bin/ld: skipping incompatible /usr/X11R6/lib/libXmu.so when searching for -lXmu
/opt/apps/binutils-amd/070220/bin/ld: skipping incompatible /usr/X11R6/lib/libXmu.a when searching for -lXmu
/opt/apps/binutils-amd/070220/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
make: *** [g4work//bin/Linux-g++/A01app] Error 1
 
Last edited by a moderator:
Engineering news on Phys.org
  • #2
Perhaps you should contact whoever created the program and ask them? A support site or something?
 
  • #3
I did that but no help :(
 
  • #4
Well, apparently you're mixing compilers.

With Geant you have compiled all your source files.
But apparently you're trying to link them against libraries that are not compatible.

You should provide us with a little more information.

Is your application a graphical one? That is, does it has a graphical user interface?
If not, the libraries that he complains about, probably shouldn't be linked at all.
(GL and X are graphical system libraries.)

If you do need the libraries, you need to check if you have other similar libraries that have been compiled by Geant, and try and use those.
Or you need to try and compile/install those libraries.

Perhaps you could upload the Makefile you're using?
 
  • #5
Hi,

yes this is a example application and it needs graphics to run how should i install graphics lib files and change the path so that this would work i want to check if the Installation was really successful before i proceed in my work,

below is the make file of the example application.



# $Id: GNUmakefile,v 1.10 2006/11/10 21:04:51 duns Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module
# --------------------------------------------------------------

name := A01app
G4TARGET := $(name)
G4EXLIB := true

ifndef G4INSTALL
G4INSTALL = ../../../..
endif

.PHONY: all
all: lib bin

#
# A01 uses its own physics lists.
#

include $(G4INSTALL)/config/binmake.gmk

CXXFLAGS_WITHOUT_O := $(filter-out -O% , $(CXXFLAGS))
CXXFLAGS_WITHOUT_O := $(filter-out +O% , $(CXXFLAGS_WITHOUT_O))

#
# A01HadronPhysics fails to compile in optimized mode on Linux, Darwin, using g++
# so it needs this special rule. Hans-Peter Wellish.
#
ifeq ($(G4SYSTEM),Linux-g++)
A01HADRON_NO_OPTIMIZE = 1
endif
ifeq ($(G4SYSTEM),Linux-g++2)
A01HADRON_NO_OPTIMIZE = 1
endif
ifeq ($(G4SYSTEM),Linux-g++3)
A01HADRON_NO_OPTIMIZE = 1
endif
ifeq ($(G4SYSTEM),Darwin-g++)
A01HADRON_NO_OPTIMIZE = 1
endif
ifeq ($(G4SYSTEM),Darwin-g++2)
A01HADRON_NO_OPTIMIZE = 1
endif
ifeq ($(G4SYSTEM),Darwin-g++3)
A01HADRON_NO_OPTIMIZE = 1
endif

ifdef A01HADRON_NO_OPTIMIZE
$(G4TMP)/$(G4SYSTEM)/$(name)/A01HadronPhysics.o: src/A01HadronPhysics.cc
@echo "Compiling A01HadronPhysics.cc without optimization..."
@$(CXX) $(CXXFLAGS_WITHOUT_O) $(CPPFLAGS) -c $(OUT_OBJ)$@ src/A01HadronPhysics.cc
endif

ifdef G4ANALYSIS_USE
CPPFLAGS += `aida-config --include`
LDLIBS += `aida-config --lib`
endif
~
1,1 All
 
  • #6
That doesn't help much yet. ;)

The relevant lines defining which compiler you use exactly, which command line options, which libraries, and which paths are not in here...
I guess you would need to show binmake.gmk which is included...

You're saying this is an example application.
Did it come with Geant?
If so, there should be installation instructions how to get it to work...

I am not familiar with Geant (yet), and I didn't read the web pages about it (yet).
Can you say in a few words what it's for and why you are using it?

Can A01HadronPhysics.cc run as a standalone program?
If so, you might try:
$ nm -AC A01HadronPhysics.o​
to find out which externals it tries to link to.

And as long as we're at it, can you say which platform you're using?
Which kernel? And which version of gcc?
 
  • #7
Hi,

I have done a new installation so i am trying to compile the example code as suggested in http://geant4.slac.stanford.edu/tutorial/installation/Geant4.8.3/Linux/Geant4_8_3_Linux_Installation.htm
to check if the Geant4 is installed properly.
My application is to track particle path. to which i am new.

I am working on linux platform and
Linux version 2.6.9-78.0.22 (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3))
 
Last edited by a moderator:
  • #8
Could you be a bit more expansive please?
I'm trying to shake a few details loose here.

This looks like a configuration issue, but I really need more information to pinpoint it.
 
  • #9
Hi,

Please let me know why are the more information you need.

I am trying to use Geant4 for particle path tracking, so i have started my work and am in initial stages.

I installed Geant4 on ranger system of TACC, i followed same steps as mentioned in the link and nothing other than that.

At the end of installation i was notified that Installation was successful

an i tried to compile few examples which crashed with same error messages as i mentioned above.

i think the errors are because of some visualization libraries in compatibility but how to solve this issue.

can i set the paths for those libraries in the make file and add libraries in my own account?

i am new to this system.

please let m e know what is the more information you need.

the package is Geant 4.8.3 i am trying to install and its Read hat linux. and GCC is 3.4.6
 
  • #10
Ok, let's start with my previous questions you did not answer.

Can you upload the contents of binmake.gmk?

Can you upload the output of the following command?
$ nm -AC A01HadronPhysics.o > A01HadronPhysics.log

And is the Makefile you showed complete, or is it a fragment?
 
  • #11
Hi,

I could not find binmake.gmk but i found another .gmk file which is hadlist.gmk which i attached,

he make file is full file not an extract.

i also attached the log file, and some more files which might be use flu to understand it that can be found in the folder attached.

there re few more files i couldn't attach due to space issue i can do it in parts.

thank you very much for helping me please let me know if you need any more information.

Thanks,
yugi
 

Attachments

  • info.zip
    59 KB · Views: 196
  • #12
I'll look at it later when I have more time.

As for binmake.gmk, your should find it in:
../../../../config/binmake.gmk​
because that's what it says in the Makefile.

Or you could try:
$ locate binmake.gmk​
 
  • #13
Hi,

Please find attached binmake.gmk i zipped it to upload it.


Thanks,

Yugi
 

Attachments

  • binmake.gmk.zip
    4.8 KB · Views: 175
  • #14
Ok. As yet I see nothing strange.
It appears Geant is simply a source package using gcc and system libraries.
This means that either the files have been compiled wrong somehow, or the libraries are not where they're supposed to be.

Can you execute the following commands:
$ make clean
$ make -n >make-dry-run.log
$ ls -l /usr/X11R6/lib/ >ls_Xlib.log

and upload the output?
 
  • #15
Hi ,

Please find the attached outputs ...


Thanks,
Yugi
 

Attachments

  • logs.zip
    8.9 KB · Views: 251
  • #16
Well, that looks pretty straight forward.
Furthermore the Geant package appears to be carefully constructed, which is good.
Again no obvious problems.

The only odd one is a directory called CLHEP.
What is that? Did you build it yourself?

Have you already tried installing and building on another Linux machine?
Did you in particular get any warnings or errors while installing?
Or did you use any creativity of your own to circumvent problems?
 
  • #17
The obvious thing to do is clean everything and uninstall everything.
And while you're at it, you might as well reboot.

Then redo the installation, keeping a careful eye out for any problems and writing them down if any.

Many problems disappear magically by simply rebooting and redoing.
And otherwise there might be an overlooked problem that you may see when redoing it.
 
  • #18
Hi,

The following is the description of CLHEP which was advised to install with GEANT4 in the installation Guide at

http://geant4.slac.stanford.edu/tutorial/installation/Geant4.8.3/Linux/Geant4_8_3_Linux_Installation.htm#_Getting_and_Installing

CLHEP:
CLHEP is a set of base libraries that have long provided great functionality for the particle physics community. They provide things like matrix manipulations and four-vector tools. The Geant4 collaboration has chosen to use these libraries rather than re-invent these wheels. Please note that while CLHEP and Geant4 both come out of the particle physics communities, they are separate products - the Geant4 collaboration is not responsible for maintenance, distribution or documentation of CLHEP.

no i didn't try it installing on another linux machine...

no i didn't get any warning messages while installing it was a clean install... as it said the installation was successful after i installed as described in the link above ...
 
Last edited by a moderator:
  • #19
All right. So it's unlikely that CLHEP causes a problem like this.

This also mean I'm basically out of ideas here.
Sorry.

I'll mention just a few ideas more.Go to the Geant install directory and do:
$ make check
or if that doesn't work:
$ make test

Usually packages have a special make target to check the installation.
It should run a lists of tests that should all pass, or else it may give you a clue.You can fool around a bit with the link command in the makefile.
That is, first do:
$ make
It should fail on the last link command.

Copy and paste the link command on your command line (you can get it from the make-dry-run.log file you created earlier).
Check if executing it causes the same error.

Remove for instance the references to the libraries that fail, such as -lGLU, and check what happens. You should get a list of undefined references.
Then check with "nm -AC libGLU.a" whether you can find these references in the library.
Perhaps there is a discrepancy somewhere.

There might also be a versioning problem, meaning that Geant expects a newer version of the libraries than it gets.I can't really tell you what to do and what to expect though.
Sorry.
I already checked for the most common reasons for your failure.
 
Last edited:

Related to Geant4 Installation and Compilation Issue Troubleshooting Guide

1. How can I check if Geant4 is already installed on my system?

To check if Geant4 is already installed on your system, you can use the geant4-config --version command in the terminal. If it returns a version number, then Geant4 is already installed on your system. If not, you will need to follow the installation instructions.

2. What are the minimum system requirements for installing Geant4?

The minimum system requirements for installing Geant4 may vary depending on the version you are installing. However, in general, you will need a Linux, macOS, or Windows operating system with a C++ compiler, CMake, and a graphics system (such as OpenGL) installed. It is also recommended to have a minimum of 2GB of RAM and 10GB of free disk space.

3. I am having trouble compiling my Geant4 code. What could be the issue?

There could be several reasons why your Geant4 code is not compiling. Some common issues include incorrect file paths, missing or outdated dependencies, and typos in the code. Make sure to carefully follow the installation and compilation instructions, and check for any error messages or warnings in the terminal or compiler output.

4. I am getting errors related to visualization when trying to run my Geant4 simulation. How can I fix this?

If you are getting errors related to visualization, it is likely that your graphics system is not properly configured or supported by Geant4. Make sure to check the supported graphics systems and their corresponding configuration instructions in the Geant4 documentation. You may also need to install additional libraries or drivers for your graphics system.

5. I have followed all the installation and compilation instructions, but my Geant4 code is still not running. What else can I try?

If you have followed all the instructions and are still experiencing issues, it may be helpful to check the Geant4 user forum or ask for assistance in the Geant4 support channels. You can also try re-installing Geant4 or using a different version to see if that resolves the issue. Make sure to provide as much information as possible about your system and the errors you are encountering.

Similar threads

  • Nuclear Engineering
Replies
6
Views
1K
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
5K
Replies
5
Views
2K
  • Beyond the Standard Models
Replies
8
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
5K
Replies
2
Views
5K
  • Programming and Computer Science
Replies
2
Views
2K
Back
Top