在头文件中包含cmath时编译C ++文件

时间:2014-10-17 13:18:10

标签: c++ macos gcc cmath

我最近从http://hpc.sourceforge.net/安装了gcc,而其他一切正常,每当我尝试在标头中包含cmath时它会显示以下错误:

/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/5.0.0/include-fixed/math.h:273:5: internal compiler error: Illegal instruction: 4
     return __inline_isfinitef(__x) && __builtin_fabsf(__x) >= __FLT_MIN__;
     ^

/usr/local/lib/gcc/x86_64-apple-darwin13.4.0/5.0.0/include-fixed/math.h:273:5: internal compiler error: Abort trap: 6
g++: internal compiler error: Abort trap: 6 (program cc1plus)
Abort trap: 6

我正在使用OSX Yosemite并在输入gcc -v时显示以下内容:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin13.4.0/5.0.0/lto-wrapper
Target: x86_64-apple-darwin13.4.0
Configured with: ../gcc-5-20140928/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 5.0.0 20140928 (experimental) (GCC) 

提前感谢您的时间。

1 个答案:

答案 0 :(得分:0)

当为CPU编译GMP库时会发生这种情况,CPU提供运行时CPU上没有的指令,请参阅gmp CPU identification

相关问题