ieee_arithmetic intrinsic module in gfortran

拥有回忆 提交于 2019-12-04 02:57:32

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/30747019/ieee-arithmetic-intrinsic-module-in-gfortran

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!