Problem 2147 - FPE exception trapping doesn't work on MacOSX, probably since LLVM deployment
Summary: FPE exception trapping doesn't work on MacOSX, probably since LLVM deployment
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: global/management (show other problems)
Version: 10.5
Hardware: Apple Mac OS X
: P4 minor
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2019-03-12 17:08 CET by Michael Kelsey
Modified: 2019-03-13 10:14 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Michael Kelsey 2019-03-12 17:08:27 CET
Long ago, the G4FPEDetection.hh file (enabled by $G4FPE_DEBUG in G4RunManagerKernel.cc) was extended to support use on MacOSX with GCC.  It appears that since the migration of MacOSX to use LLVM (Clang), FPE detection no long works, specifically because the outermost preprocessor block is

  #if (defined(__GNUC__) && !defined(__clang__))

I have tested compilation and running on my own MacOSX system (10.13.6, Apple LLVM version 10.0.0, clang-1000.11.45.5), and it appears to work properly.  Could the preprocessor line above be changed to

  #if defined(__GNU__)

alone?
Comment 1 Gabriele Cosmo 2019-03-13 10:14:58 CET
Thanks Michael for informing about this.
The fix is now included in MR global-V10-05-02 and is under testing.
The fix suggested is actually not correct, as we need to disable FPE detection on Linux platforms using the clang compiler (that's why there is such protection). MacOS flavour is now made independent from Linux.