1

I would like to decide whether ieee_arithmetic is supported by the Fortran compiler being used. I suppose this can be done, for example, in the preprocessing by checking some macros. To do this, I would like to know the following.

  1. What is the first version of gfortran / ifort / nagfor / g95 (or other common Fortran compilers) that supports ieee_arithmetic? I have searched online and looked through the manuals, but did not find an answer. It would be great if someone happens to know the information about one of these compilers.

2. Instead of checking the version of the compiler, is there any better way to decide whether ieee_arithmetic is available?

Thank you very much!

Nuno
  • 256
  • 1
  • 11
  • 2
    Each of the compilers you mention have a web site. The information you seek is likely found there. – evets Jun 19 '20 at 06:21
  • @evets Thank you. I have tried. Most often, the website only mentions whether the current version supports ieee_arithmetic or not, not the earliest version that does so. In addition, I have a second question as above, which is unlikely explained in the website. Thank you anyway. – Nuno Jun 19 '20 at 06:58
  • 1
    Why does it matter how early a compiler claimed support? Shouldn't the quality of support in the currently available version(s) of a compiler be more important? Are you going to install gfortan 5.1 instead of 10.1? There have been 18 releases in newer versions since 5.1 was released 5 years ago (ie., possible bug fixes). – evets Jun 19 '20 at 07:12
  • 1
    Because I do not know what compiler the user uses. Thank you. – Nuno Jun 19 '20 at 07:13
  • 1
    Then write your code and state that it conforms to Fortran 2003 or 2008 or 2018. It is up to the user to ensure that they have an appropriate compiler. – evets Jun 19 '20 at 07:14
  • 2
    I guess it is nicer to take different appropriate actions depending on what compiler is being used rather than simply refuse to work when some exceptions happen. Not all users have sufficient knowledge about Fortran/compiler. They may even not understand what a compiler is. Thank you. – Nuno Jun 19 '20 at 07:19
  • 2
    @evets For any number of reasons a user may not be able to update to a more recent version of a compiler, even a free one like gfortran. While yes, stick to standards, if it is possible to have a fall back for an old compiler, well that will just make you software product more usable – Ian Bush Jun 19 '20 at 07:31
  • 2
    Rather than relying on a specific compiler version I would prefer as part of the configuration process to see if a very short program with the features you needs compiles and works successfully. This saves digging for each compiler, and further ompilers sometimes claim support, but on closer examination it is sometimes only partial. – Ian Bush Jun 19 '20 at 07:37
  • Totally agree. Thank you. @Ian Bush. Indeed, on my PC, I still use gfortran 4.*. My system is Ubuntu 16.04. I did not update them to the newest ones simply because they are working well and I have more important things to deal with. I guess many users (especially those who do not know programming so well) do similar things. In addition, some users may not have the permission to update the compiler. – Nuno Jun 19 '20 at 07:40
  • @Ian Bush Good idea, indeed more reliable and more general. Thank you. – Nuno Jun 19 '20 at 07:42

0 Answers0