Open HealthyPear opened 1 year ago
No idea about Macs and OS X but this came up when I googled your error: https://stackoverflow.com/questions/71174306/expected-in-usr-lib-libc-1-dylib-installing-tensorflow-on-m1-macbook-pro
Might be some architecture or OSX version mismatch
I tried to build & install geant4_pybind for the Geant4 package installed via conda-forge on macOS 14.3. The Geant4 package is built with the GEANT4_BUILD_TLS_MODEL=global-dynamic
option set.
After installing Geant4 via conda-forge, I also had to install zlib
, xerces-c
, and freetype
packages using Homebrew to avoid build process failures. Furthermore, I also had to run export CMAKE_PREFIX_PATH=/usr/local/opt/zlib
so that CMake could locate the correct zlib
package. After these, the build process went through successfully.
However, when I try to run an example, I get segmentation fault.
The output of python -X faulthandler exampleB2a.py
is:
Available UI session types: [ Qt, tcsh, csh ]
**********************************************************
Geant4 version Name: geant4-11-01-patch-03 [MT] (10-November-2023)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
: NIM A 835 (2016), 186-225
WWW : http://geant4.org/
**********************************************************
<<< Geant4 Physics List simulation engine: FTFP_BERT
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...
You have successfully registered the following graphics systems.
Registered graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
TOOLSSG_OFFSCREEN (TSG_OFFSCREEN)
TOOLSSG_OFFSCREEN (TSG_OFFSCREEN, TSG_FILE)
OpenGLImmediateQt (OGLIQt, OGLI)
OpenGLStoredQt (OGLSQt, OGL, OGLS)
Qt3D (Qt3D)
Registering model factories...
You have successfully registered the following model factories.
Registered model factories:
generic
drawByAttribute
drawByCharge
drawByOriginVolume
drawByParticleID
drawByEncounteredVolume
Registered models:
None
Registered filter factories:
attributeFilter
chargeFilter
originVolumeFilter
particleFilter
encounteredVolumeFilter
Registered filters:
None
You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none
Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
/control/saveHistory
/run/verbose 2
#
# Change the default number of threads (in multi-threaded mode)
#/run/numberOfThreads 4
#
# Initialize kernel
/run/initialize
userDetector->Construct() start.
Fatal Python error: Segmentation fault
Current thread 0x00007ff846de57c0 (most recent call first):
File "/Users/tara/Library/CloudStorage/GoogleDrive-tara.1995zka@gmail.com/My Drive/Muon/Dec 18th/examples/B2/exampleB2a.py", line 150 in DefineMaterials
File "/Users/tara/Library/CloudStorage/GoogleDrive-tara.1995zka@gmail.com/My Drive/Muon/Dec 18th/examples/B2/exampleB2a.py", line 295 in Construct
File "/Users/tara/Library/CloudStorage/GoogleDrive-tara.1995zka@gmail.com/My Drive/Muon/Dec 18th/examples/B2/exampleB2a.py", line 464 in <module>
zsh: segmentation fault python -X faulthandler exampleB2a.py
Do you have any idea what might have gone wrong here?
Edit: I should add that I can install the package via pip and run examples without a problem. The above issue only happens after installing from source.
I'm not sure how conda works on MacOS, but it might be that the conda geant4 package was linked against a c/c++ library shipped with conda while the packages you installed with hombrew are linked against the system c/c++ library. Might be worth trying out whether you can install those additional packages via conda-forge instead. Also make sure you are in the conda environment when building the bindings.
The installation went fine, but the example usage failed,
I put here some info about my installation of Geant4 using
geant4-config
to help the debug,