libG4gl2ps doesn't exist after compilation of Geant4.11.1 on Mac M2


I could compile Geant4.11.1 on a Mac M2 without problem. The make install showed the following progress:

[  0%] Built target ptl-shared
[  2%] Built target G4clhep
[  4%] Built target G4global
[  5%] Built target G4intercoms
[  5%] Built target G4zlib
[ 98%] Built target G4GMocren
[ 98%] Automatic MOC for target G4ToolsSG
[ 98%] Built target G4ToolsSG_autogen
[ 98%] Built target G4ToolsSG
[ 98%] Automatic MOC for target G4OpenGL
[ 98%] Built target G4OpenGL_autogen
[100%] Built target G4OpenGL
[100%] Built target G4visQt3D

G4ToolsSG was compiled automatically. I expect G4gl2ps to appear between G4Global and G4intercoms. But it didn’t.

I could use this build to compile some Geant4 applications. But when I tried to run it, I got

dyld[42437]: Library not loaded: @rpath/libG4gl2ps.dylib
  Referenced from: <DC126C27-0E34-3044-B6A3-C09F3A8C777D> /Users/jing.liu/geant4/gears/gears
  Reason: tried: '/Users/jing.liu/geant4/11.1.0/lib/libG4gl2ps.dylib' (no such file), '/libG4gl2ps.dylib' (no such file), '/usr/local/lib/libG4gl2ps.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libG4gl2ps.dylib' (no such file), '/usr/local/lib/libG4gl2ps.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libG4gl2ps.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libG4gl2ps.dylib' (no such file), '/usr/local/lib/libG4gl2ps.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libG4gl2ps.dylib' (no such file), '/usr/local/lib/libG4gl2ps.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libG4gl2ps.dylib' (no such file), '/usr/local/lib/libG4gl2ps.dylib' (no such file), '/usr/lib/libG4gl2ps.dylib' (no such file, not in dyld cache)
zsh: abort      gears

Do I have to set some CMake flags to enable the compilation of libG4gl2ps?



PS, CMakeCache.txt is attached.
CMakeCache.txt (52.0 KB)

Hi Jing

Yes, gl2ps in 11.1 is now part of the header-only source code source/externals/g4tools/include/tools/gl2ps and gl2ps_def.h. It is used as in via G4gl2ps.hh.

The question is: where are your calls to libG4gl2ps coming from? What link options are asking for it? Are you using your own build scripts? Or some old build scripts? Are you using the deprecated GNUmakefile system?

Hope this helps you to sort this out.

As @Allison notes, I don’t think this is an issue with the build of Geant4, but how the application is linking to the libraries. Given that 11.1 no longer supplies libG4gl2ps, it feels like the build of the application may have picked up another install of Geant4 from somewhere. Could you post the CMakeCache.txt from the application build, and also the output of:

$ otool -L /Users/jing.liu/geant4/gears/gears


$ otool -l /Users/jing.liu/geant4/gears/gears


Hi, John and Ben, thanks for the information. You are right, my cmake found an older version of Geant4. When I fixed that, everything went smoothly. Sorry! Jing

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