Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] py-geant4 (g4py) #13639

Closed
wants to merge 1 commit into from
Closed

[Draft] py-geant4 (g4py) #13639

wants to merge 1 commit into from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Nov 8, 2019

Draft of a package shipping the Geant4 python bindings.
Same-version-pinning as already working in adios package for a very similar situation.

Note 1: -lG4OpenGL lib seam to be required to build g4py, otherwise related libs are not found during linking. Even with ^geant4+opengl the lib is still missing in the install, but ^geant4+opengl+x11 helps.

The error that is then showing up in linking is

/usr/bin/ld: aTouchableHistoryAllocator: TLS reference in /home/axel/src/spack/opt/spack/linux-ubuntu18.04-skylake/gcc-8.3.0/geant4-10.04-bch5g6maf7srrfzageovu34dk3zyapmf/bin/../lib/libG4tracking.so mismatches non-TLS reference in CMakeFiles/pyG4geometry.dir/pyG4TouchableHistory.cc.o
/home/axel/src/spack/opt/spack/linux-ubuntu18.04-skylake/gcc-8.3.0/geant4-10.04-bch5g6maf7srrfzageovu34dk3zyapmf/bin/../lib/libG4tracking.so: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Note 2: g4py tries to link -lboost_python instead of -lboost_python37
Note 3: somehow -lG4gl2ps and -lG4clhep are also non-optional.

Note 3: due to some problems installing root #13637 I am testing this package via spack install py-geant4 ^root~xml~x~opengl.
Note 5: root +x (default) does not build (seen via root ~xml).
Note 6: root ~x does not build unless I also deactivate ~opengl (default: +opengl).

Copy link
Member

@gartung gartung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even know Geant4 had python bindings.

@ax3l
Copy link
Member Author

ax3l commented Nov 8, 2019

Same here. But I saw you editing the geant4 package so I thought I give it a try and ping you :)

@gartung
Copy link
Member

gartung commented Nov 8, 2019

I know Ben Morgan is in the Geant4 collaboration so I invited him to review.

@ax3l ax3l force-pushed the topic-g4py branch 4 times, most recently from 3bd6419 to ac912e9 Compare November 8, 2019 18:13
Draft of a geant4 binding for python.

Same-version-pinning as already working in `adios` package for
a very similar situation.
@LDAmorim
Copy link
Contributor

Hi,
The issues that we found when trying to install g4py directly from GitHub package (https://github.com/Geant4/geant4)[https://github.com/Geant4/geant4] with cmake (both in geant4/ and geant4/environments/g4py) are reported in:

-https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2201
-https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2202
(related to initial issue created in https://geant4-forum.web.cern.ch/t/error-with-python-hpp-for-macos-clang-anaconda3/1256)
-https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2203

As soon as there is any feedback or a solution for any of those problems I will write it here.
Cheers, Diana

@sethrj
Copy link
Contributor

sethrj commented Nov 14, 2019

@ax3l For what it's worth, in case you didn't know, the TLS link error is because the threading option is inconsistent between your Geant installation and your g4py build.

@ax3l
Copy link
Member Author

ax3l commented Nov 17, 2019

Thanks for the hint, okay so passing -DGEANT4_BUILD_MULTITHREADED in the geant4 build is not ideal.
We got that fixed but in the end there is still more left to get this build, including several missing headers in TUs, and then it still does not build successfully.

In the end we gave up for now and stick with the pure geant4 C++ version. Maybe if an upstream developer wants to assist us, start-to-end in e.g. a reproducible simple Docker environment, we can revisit this.

@ax3l ax3l closed this Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants