Problem Running Basic Example B1

But, in the meantime, this “share” drive surprised me. I did not realize it was there until now. Could this unexpected drive outside of the other three be the problem?

The “share” directory (or folder, it’s not a separate drive) is part of the normal installation. Recall my aside that CMake likes to do it’s installations to /usr/local. The /usr/local/share/ directory tree is where all of the “support stuff” from software is supposed to go, things like data files, scripts, etc. So when you do the Geant4 installation, it puts the datasets, the GNUmakefile support, etc., into share.

I notice that you set your CMAKE_INSTALL_PREFIX to your home directory (i.e., you used -DCMAKE_INSTALL_PREFIX=$HOME or equivalent). I would recommend not doing that, as it’ll mix things up if you decide to install other big packages.

On my Mac, I created a directory (folder) /Applications/GEANT4, and I install each major G4 version in a subdirectory under that. I also created a single /Applications/GEANT4/data directory, which is where all these dataset files go. That way, when I build a new release, it doesn’t download all the stuff I already have.

what about the second command, ls $G4ENSDFSTATEDATA
?
that’s what would check if the data actually exists where geant4 is looking for it :slight_smile:

weller and mkelsey,

Sorry, I missed that part last night. I just did it in my home directory, and this is what happened:
“”"
Jamess-MacBook-Pro:~ jamesbowen$ echo $G4ENSDFSTATEDATA
/Users/jamesbowen/share/Geant4-11.0.0/data/G4ENSDFSTATE2.3
Jamess-MacBook-Pro:~ jamesbowen$ ls $G4ENSDFSTATEDATA
ls: /Users/jamesbowen/share/Geant4-11.0.0/data/G4ENSDFSTATE2.3: No such file or directory
Jamess-MacBook-Pro:~ jamesbowen$
“”"
Do I need to be in another directory, or is indeed not seeing anything?

It is indeed seeing that the directory pointed to does not exist. It seems to me that in the course of doing the rebuilds, your downloads did not go to where they were supposed to go. The envvar is defined, but as you see, the directory it points to doesn’t exist.

Since all this is in your home directory, you can find where (if anywere!) the download happened:

$ find $HOME -name 'G4ENSDFSTATE2.3'

This should print out the full path to any directory (or file) with that name, anywhere under your login directory ($HOME = “/Users/jamesbowen” on your system).

This is what I found:

“”"
Jamess-MacBook-Pro:~ jamesbowen$ find /Users/jamesbowen -name ‘G4ENSDFSTATE2.3’
/Users/jamesbowen/geant4-v11.0.0-build/data/G4ENSDFSTATE2.3
/Users/jamesbowen/geant4-v11.0.0-install/share/Geant4-11.0.0/data/G4ENSDFSTATE2.3
Jamess-MacBook-Pro:~ jamesbowen$
“”"
What can I do next?

So you’ve got two directories. Which one has content (the ls command)?

They both do, but the /Users/jamesbowen/geant4-v11.0.0-install/share/Geant4-11.0.0/data directory is the one that has G4ENSDFSTATE2.3.

So, I am guessing that it is looking for this file in the wrong directory, i.e. the directory that does not have it; and that it instead needs to look in the directory that does have it. Does that sound right? If that is the case, is there any way I can fix this, or do I need to delete and re-install GEANT4?

I would just move the data folder to the place where your geant4 installation expects it. not much to break there anyways. worst case you have to download and unpack the data files again, second worst case you have to reconfigure and reinstall geant4…

mkdir -p /Users/jamesbowen/share/Geant4-11.0.0/ 
mv /Users/jamesbowen/geant4-v11.0.0-install/share/Geant4-11.0.0/data /Users/jamesbowen/share/Geant4-11.0.0/

Cool, I will try this, thanks.

weller and mkelsey,

It worked, thanks! It looks like everything is running smoothly with basic example B1 now. Now it’s time to actually learn how to work with GEANT4.

Great! Good luck with your simulation work.

1 Like

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