Opened 5 years ago
Last modified 5 years ago
#58629 assigned defect
Geant4 Source Script Clashes With Root
Reported by: | StevenGreen1 (Steven Green) | Owned by: | mojca (Mojca Miklavec) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | cjones051073 (Chris Jones) | |
Port: | geant4.10.3 |
Description (last modified by mf2k (Frank Schima))
Hi,
My name is Steve Green, I'm a post doc working at the university of Cambridge. I recently built geant4 using MacPorts on my machine and then sourced the geant4.sh script to have the relevant libraries in my path for building a separate piece of code. When I sourced this script, it lead to problems with my root build due to changes in the DYLD_LIBRARY_PATH environment variable. Is there some way this can be altered so that I can simultaneously use both geant4 and root please?
Thanks in advance. Best Wishes Steve
The error when trying to use root after source the geant4 setup script:
stevengreen$ root -l dyld: Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /opt/local/lib/libJPEG.dylib in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO Abort trap: 6
Change History (6)
comment:1 Changed 5 years ago by StevenGreen1 (Steven Green)
Port: | geant4.10.3 added |
---|
comment:2 Changed 5 years ago by cjones051073 (Chris Jones)
Owner: | set to mojca |
---|---|
Status: | new → assigned |
comment:3 Changed 5 years ago by cjones051073 (Chris Jones)
Cc: | cjones051073 added |
---|
comment:4 Changed 5 years ago by mf2k (Frank Schima)
Description: | modified (diff) |
---|
comment:5 Changed 5 years ago by mojca (Mojca Miklavec)
Can you please explain a bit more what precisely you did, which versions of Geant and ROOT you used, how you set them up, which shell you are using etc.?
In general you should never need to modify paths for the sake of finding libraries, let alone fiddle with DYLD_LIBRARY_PATH
(that's a linux thing; macOS has paths to libraries hardcoded in the binary, so you don't need to have libraries in PATH).
A well-written CMake support should be all you need to get started with a working simulation.
The only reason to ever need to source geant4.sh
is to get the paths to data files set up correctly, else you cannot use the data (I still consider this to be a bug in Geant and I would probably send a patch to automatically fetch the data from the default location if I had slightly more time and if I was still using the software nowadays & had the motivation to do so).
I now see that DYLD_LIBRARY_PATH
is still modified in Geant4.10.3.; maybe I should simply patch 4.10.3 to remove those few lines, or remove Geant4.10.3 altogether. But unless you are using 4.10.3, I definitely need more info about how you could have ended up in the conflict.
comment:6 Changed 5 years ago by StevenGreen1 (Steven Green)
Hi Mojca,
Thanks for your reply. I was indeed using geant 4.10.3. What I was attempting to do was to build an example geant4 calorimeter that I edited to use root. I was under the assumption that I needed to source the geant.sh script in order for my Mac to find the geant libraries, but I now see that this is not the case, so apologies for wasting your time with this.
My code now compiles correctly, interacting to both root and geant, but when running the code I have to set the $G4ENSDFSTATEDATA environment variable. This is set by the geant4.sh script, but if I source the script then I can no longer laugh root as the DYLD_LIBRARY_PATH is altered. So I think you are right in saying that you might want to remove the few lines in the .sh script changing the DYLD_LIBRARY_PATH variable.
Thanks again for your help. Best Wishes Steve
In the future, please use WikiFormatting.