HaarigerHarald / geant4_pybind

Alternative Python bindings for Geant4
The Unlicense
35 stars 6 forks source link

Problem installing in MacOS #17

Closed peremato closed 1 year ago

peremato commented 1 year ago

I am trying to run some simple G4 examples to compare with https://github.com/JuliaHEP/Geant4.jl but I am having problems installing the extension on MacOS.

HaarigerHarald commented 1 year ago

There was an update in one of the tools used. I pushed a hotfix 3dac008 to use a previous version of that tool, which should allow you to build it.

The import error seems to be identical with #13. I can't say much about this as I'm not an expert on Apple products and I also don't have access to any Apple machines apart from the github CI runner (which seems to work fine).

peremato commented 1 year ago

Thanks. But I am not sure how to use the modified pyproject.toml with pip3 install geant4-pybind

peremato commented 1 year ago

It is fixed. I just had to clone with recursive submodules. Thanks again.

In case you are interested I run some very simple benchmarks.

  B2a (C++) B2a.jl B2a.py
events = 1 0.9 s 6 s 1 s
events =100k 106 s 79 s 176 s
events =100k (MT) 23 s 22 s --

The reason why the python is slower is understandable because the user actions and sensitive detectors are implemented in Python and , it is many factors slower than C++ or Julia. If more work is done in these user actions, as it will be the case on more realistic applications, the performance will deteriorate even further. I do to have an explanation why Julia should be faster than C++ in the serial case. I was expecting within a few percent the same.

HaarigerHarald commented 1 year ago

The OSX import error should be fixed too with b89bb3afd11672f903f0e59e3db9557bdd023116 by building for an older OSX version.