7

I am trying to compile a program in c/c++, but am getting the error message:

fpu_control.h: No such file or directory

From google, I have found out that this problem is about the way floating point precision is handled. I read that not all distributions of gcc include fpu_control.h.

This is the only thing I can find out. I have searched extensively and cannot find anywhere to download this fpu_control.h. Can anyone help?

Thank you all.

Ant
  • 753
  • 1
  • 9
  • 24
  • 4
    As written, your question is not answerable. What are you trying to accomplish with `fpu_control.h`? This is not a standard header, but depending on what you want to do, there may be standard headers which help you accomplish that, for example `fenv.h`. – R.. GitHub STOP HELPING ICE Nov 24 '10 at 21:59
  • It is needed by a program I am trying to compile. It apparently deals with floating point precision, which is an important issue for the program. As far as its specific function, I don't know. From what I can find out on google, many compilers have it but mine (gcc 4.2) doesn't. I have googled it in the hope of finding it, but no luck. – Ant Nov 24 '10 at 22:28

2 Answers2

5

Apple doesn't support setting the FPU flags, and doing so isn't needed. The reason is that they don't even use the i387 coprocessor for float and double, but SSE. The last reference also explains how to revert that approach, and how to perform FPU control using inline assembly.

Community
  • 1
  • 1
Martin v. Löwis
  • 124,830
  • 17
  • 198
  • 235
  • Thank you very much Martin. These links look helpful. Sorry, I am not important enough on Stack Overflow to vote you up! – Ant Nov 24 '10 at 23:10
  • If this answer is indeed satisfying, it is convention to mark it as accepted (the then-green checkbox). – Martin v. Löwis Nov 24 '10 at 23:16
0

fpu_control.h is not a mac OSX header. The code you are trying to compile wasn't meant to be compiled on OSX, evidently. You will have to either comment out this functionality or replace it in your own header (potentially called fpu_control.h for ease).

Goz
  • 61,365
  • 24
  • 124
  • 204
  • Thanks Goz. I did try commenting it out, but this is a problem because floating point precision is a big deal in the program. It wasn't meant to be compiled in OSX, but the creator thinks it can be done. Thanks for your help. – Ant Nov 24 '10 at 23:12