- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The OneAPI Fortran compiler developer reference guide gives the following code to illustrate the usage of the intrinsic COMPILER_VERSION:
program pvers
use ISO_FORTRAN_ENV
character (len = :), allocatable :: res
res = compiler_version ()
print *, "len of res is: ", len (res)
print *, "('<<', A, '>>')", res
deallocate (res)
close (1)
end
On line-8, *, should not be present. Line-11 does not belong, either.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good catch @mecej4 .
Intel Team,
Can you please also review the following toward any update to the documentation?
- The two standard inquiry functions, COMPILER_VERSION and COMPILER_OPTIONS, go hand in hand.
- The information returned by the two functions is essentially a compile-time string constant, thus users may be better off defining a named constant of CHARACTER type toward the same rather than variables
- Thus an initial sketch of an example to be included in the documentation may be as follows that your writer(s) can edit as deemed suitable:
program CompilerVerandOptions
use, intrinsic :: iso_fortran_env, only : compiler_version, compiler_options
character(len=*), parameter :: cver = compiler_version()
character(len=*), parameter :: copts = compiler_options()
print *, "Compiler Version: ", cver
print *, "Compiler Options: ", copts
end program
C:\temp>ifort /standard-semantics CompilerVerandOptions.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.8.0 Build 20221119_000000
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 14.34.31937.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:CompilerVerandOptions.exe
-subsystem:console
CompilerVerandOptions.obj
C:\temp>CompilerVerandOptions.exe
Compiler Version:
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel
(R) 64, Version 2021.8.0 Build 20221119_000000
Compiler Options: /standard-semantics
C:\temp>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
program CompilerVerandOptions
use, intrinsic :: iso_fortran_env, only : compiler_version, compiler_options
character(len=*), parameter :: cver = compiler_version()
character(len=*), parameter :: copts = compiler_options()
write(*,100)cver
100 Format( "Compiler Version: "//,(A),/)
write(*,200)copts
200 Format( "Compiler Options: "//,(A),//)
end program
This gives you a bit cleaner output that is easier to read.
Just of interest should not the use of Close(1) as noted by @mecej4 not generate a warning as the file was not opened.
See below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Definitely a GOOD CATCH! I filed a bug report, DOC-10851. The change might just make the next release.
I was in a meeting recently where the documentation team said they are planning to test the sample code in the DGRs (Developer Guide and Reference). That will be cool!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you guys going to want royalties for these new examples?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Barbara_P_Intel wrote:
Are you guys going to want royalties for these new examples?
Best I can do is kudos.
Yes, I would want royalties please!!! In the form of more code examples with some real style by Intel writers in Fortran DRG for the benefit of oneAPI users!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I spotted a code error in the MS Powerstation Reference Manual, and then promptly lost it.
It was write(*,))SOMETHING Of course it is long past, but even the best make errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is fixed the next release of oneAPI coming this spring.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page