无法识别 Fortran 编译器选项

Fortran compiler options not recognized

我正在使用对数值精度敏感的数值模型。使用我的旧 ifort 编译器,我成功地使用了 Fortran 标志 "fp-model precise"

我最近安装了英特尔编译器composer_xe_2015.3.187。它不识别 Fortran 标志 "fp-model precise"。 这是我得到的确切错误

f95: 错误: 精确: 没有那个文件或目录 f95:错误:无法识别的命令行选项‘-fp-model’

我担心如果我会牺牲我的效率来代替新的编译器,或者新的编译器本身就能够保持精度。

您调用的名为 f95 的编译器不是 Intel Fortran。根据错误消息,我猜它实际上是 GNU Fortran 编译器,但您可以通过 运行 f95 -v 确认编译器将自己标识为什么。

Intel Fortran 15 仍然支持选项 -fp-model precise

在调用ifort之前,您需要设置它的环境,例如

source /path/to/intel/bin/ifortvars.sh intel64

64 位编译器。然后您可以调用编译器 ifort.