I have a library written in Fortran that uses Intel's MKL (linked statically). I'm using ifort for compiling and linking.
When I link my library (dynamically) with some other code using the -fpe0 option, I get floating point exceptions in the MKL, which seems to be a known thing according to Intel and nothing to worry about. I assume it is due to some speculative executions.
However when someone else uses my library, they might try to use -fpe0 for linking their code to my library and this might lead to trouble. So I was wondering: Is there any way to turn off the FPE handler at runtime when entering my library and putting it back to the original state on return?
Thanks!
Asked
Active
Viewed 210 times
1

fpnick
- 419
- 2
- 6
- 18
-
Check the `ieee_exceptions` intrinsic module. Never used it myself, so I am just commenting. – Vladimir F Героям слава Mar 19 '15 at 09:42
-
Thanks that works. It should be mentioned that with gfortran at least version 4.10 is needed. ifort supports it at least from v12 on (don't have an older version to test with...) – fpnick Mar 19 '15 at 14:21
-
Can you post the details as an answer? It could be useful for others. – Vladimir F Героям слава Mar 19 '15 at 14:39