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

Compilation error with Geant4 10.7 and/or gcc 4.8.5 #69

Closed
tkittel opened this issue Jul 8, 2021 · 6 comments
Closed

Compilation error with Geant4 10.7 and/or gcc 4.8.5 #69

tkittel opened this issue Jul 8, 2021 · 6 comments
Assignees

Comments

@tkittel
Copy link
Member

tkittel commented Jul 8, 2021

First half of this task is done in NCrystal v2.5.0 which has just been released, i.e. make sure NCrystal itself can be used in a multi-threaded application:

https://github.com/mctools/ncrystal/wiki/Announcement-Release2.5.0

The actual NCrystal-Geant4 hook still needs major work in order to benefit from this.

Hi @tkittel !

I am trying to install NCrystal to use with Geant4, but I am having some trouble that I don't understand. I'm hoping you might be able to shed some light on my issue.

When I build NCrystal with the G4Hook off, it works flawlessly and the post install test comes back successful; but when I try to build with the Geant4Hook on, I get an error in the ncrystal/ncrystal_geant4/src/G4NCProcWrapper file, as show in the first attached file. I have also attached the ccmake gui in case it's helpful.

Thanks so much!
Will

Screenshot from 2021-07-06 20-13-00
Screenshot from 2021-07-06 20-12-04

Originally posted by @Will-Kemmerer in #36 (comment)

@tkittel
Copy link
Member Author

tkittel commented Jul 8, 2021

Hi @Will-Kemmerer,

Opening as a separate issue, as it is not really the same as #36. It seems there is a simple compilation error with Geant4 10.7 (I guess they either changed the meaning of G4int or enabled a stricter compilation flag).

I am now preparing a small release, v2.7.2, with this small fix for you. Note that as you can tell from #36, our Geant4 hooks are up for a major overhaul. But at least with this fix I was able to build against Geant4 10.7.p02 and run our small (single-threaded) ncrystal_example_g4sim example.

Cheers,
Thomas

@tkittel
Copy link
Member Author

tkittel commented Jul 8, 2021

Actually, @Will-Kemmerer could you provide a bit more info about your system? There is one of the errors in your screen-dump that I can't reproduce on my system.

What platform? What compiler and version are you using? What flags did you use when you built Geant4 (specifically was it an MT build?).

@tkittel tkittel self-assigned this Jul 8, 2021
@tkittel
Copy link
Member Author

tkittel commented Jul 8, 2021

So I took a wild guess that you are on some older linux platform, for which a good bet is currently CentOS7 with gcc 4.8.5. Indeed, I was able to reproduce the compilation issues above, along with a few other ones.

I am preparing a new NCrystal release v2.7.2 now with the fixes. The code is already pushed to the develop branch of the ncrystal repo, so feel free to check it out already - and preferably report back here before the release in case you have additional issues :-)

Cheers,
Thomas

@tkittel tkittel changed the title Compilation error with Geant4 10.7 Compilation error with Geant4 10.7 and/or gcc 4.8.5 Jul 8, 2021
@Will-Kemmerer
Copy link

Hi @tkittel , I really appreciate your time and help with this. Sorry about the delay, I'm on US EST, so I just woke up.

In using:
Ubunutu 20.04.2 LTS
Cmake 3.20.5
GCC 9.3.0
Geant4-10.7.1.p01 (will be updating to p02)
Geant4 was built MT (Do I need to change this to work with Ncrystal when I update to p02?)

I am about to play around with the develop branch, and will update about any issues or lack of issues that come up!

Thanks so much,
Will

@Will-Kemmerer
Copy link

Dev branch compiled with G4 hook enabled! Post install test ran successfully

For anyone in the future, I updated to p02 and built G4 without MT

@tkittel Thanks again for the help :)

@tkittel
Copy link
Member Author

tkittel commented Jul 8, 2021

Great, thanks for the feedback!

And for the record I think the MT build of Geant4 is likely OK, as long as you don't actually use it to launch a multi-threaded simulation (i.e. you must use the normal G4RunManager, not the MT version). And I think I actually ended up fixing a few compilation errors for Geant4 10.7 and some compilation errors for gcc 4.8.5...

Obviously it would be awesome if we had a better CI system set up which could systematically test all these combinations of versions of the various dependencies. Hopefully one day we will find the time :-)

@tkittel tkittel closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants