问题描述
我需要使用gfortran编译一个依赖于 ieee_arithmetic
的库。但是,发现gfortran无法识别这个模块。
例如,使用 a.f90
<$如果(ieee_is_nan(x))那么p $ p>
程序测试
use,intrinsic :: ieee_arithmetic
real :: x
read *,x
print *,Nan
else
print *,不是NaN
结束如果
结束程序测试
编译时有以下信息:
$ gfortran a.f90
a.f90:2.19:
use,intrinsic :: ieee_arithmetic
1
致命错误:找不到名为'ieee_arithmetic 'at(1)
如何让gfortran知道 ieee_arithmetic
内部模块是?
ifort被发现可以使用
ieee_arithmetic
模块。但我希望为这件事情做好准备。 从GFortran版本5开始支持IEEE模块。请参阅如果您使用的是旧版本,您应该会看到显示的错误消息您的帖子。
I need to use gfortran to compile a library that is dependent on ieee_arithmetic
. However, it is found that gfortran can not identify this module.
For example with the code a.f90
program test
use,intrinsic :: ieee_arithmetic
real :: x
read *, x
if (ieee_is_nan(x)) then
print *, "Nan"
else
print *, "Not NaN"
end if
end program test
I have the following message when compiling
$ gfortran a.f90
a.f90:2.19:
use,intrinsic :: ieee_arithmetic
1
Fatal Error: Can't find an intrinsic module named 'ieee_arithmetic' at (1)
How can I let gfortran know where the ieee_arithmetic
intrinsic module is?
ifort is found to be able to use the ieee_arithmetic
module. But I wish to make gfortran work for this case.
The IEEE modules are supported as of GFortran version 5. See https://gcc.gnu.org/gcc-5/changes.html If you are using an older version, you should see the error message you have shown in your post.
这篇关于gfortran中的ieee_arithmetic内在模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!