Problem 2147

Summary: FPE exception trapping doesn't work on MacOSX, probably since LLVM deployment
Product: Geant4 Reporter: Michael Kelsey <kelsey>
Component: global/managementAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P4    
Version: 10.5   
Hardware: Apple   
OS: Mac OS X   

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.