Dear community,
I am currently working on a project (that should go public soonish, fingers crossed) and I would like to provide compiler’ info at runtime. For this, I would like to identify the compiler from the outcome of compiler_version()
. Problem is that I only have access to gfortran, ifort and lfortran. I also found the result of nvfortran on the fortran-lang website. I am confident that all together we can cover most compilers referenced in fpm:
enum, bind(C)
enumerator :: &
id_unknown, &
id_gcc, &
id_f95, &
id_caf, &
id_intel_classic_nix, &
id_intel_classic_mac, &
id_intel_classic_windows, &
id_intel_llvm_nix, &
id_intel_llvm_windows, &
id_intel_llvm_unknown, &
id_pgi, &
id_nvhpc, &
id_nag, &
id_flang, &
id_flang_new, &
id_f18, &
id_ibmxl, &
id_cray, &
id_lahey, &
id_lfortran
end enum
So if you would be so kind to post in this thread the outcome of this program using different compilers, I would really appreciate.
program main
use, intrinsic :: iso_fortran_env, only : compiler_version
implicit none
print '(A)', &
compiler_version()
end program
Thanks in advance
I will keep the table up to date
compiler | id | status | outcome | macro |
---|---|---|---|---|
gfortran | id_gcc | GCC version 14.1.0 | __GFORTRAN__ |
|
f95 | id_f95 | |||
caf | id_caf | GCC version 12.3.0 | ||
ifort | id_intel_classic_nix | Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.12.0 Build 20240211_000000 | __INTEL_COMPILER |
|
ifort | id_intel_classic_mac | __INTEL_COMPILER |
||
ifort | id_intel_classic_windows (x64) | Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.3.0 Build 20210609_000000 | __INTEL_COMPILER |
|
ia32 | id_intel_classic_windows (x86) | Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on IA-32, Version 2021.12.0 Build 20240222_000000 | __INTEL_COMPILER |
|
ifx | id_intel_llvm_nix | Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.1.2 Build 20240508 | __INTEL_COMPILER and __INTEL_LLVM_COMPILER |
|
ifx | id_intel_llvm_windows | Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.1.0 Build 20240308 | __INTEL_COMPILER{{{ and __INTEL_LLVM_COMPILER``` |
|
pgfortran | id_pgi | __PGI |
||
nvfortran | id_nvhpc | nvfortran 21.5-0 LLVM | __NVCOMPILER (and __PGI for some versions) |
|
nagfor | id_nag | NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7205 | NAGFOR |
|
flang | id_flang | __PGLLVM__ |
||
flang | id_flang_new | flang version 19.0.0 | __flang__ |
|
f18 | id_f18 | |||
xlf90 | id_ibmxl | __IBMC__ |
||
crayftn | id_cray | _CRAYFTN |
||
lf95 | id_lahey | |||
lfortran | id_lfortran | __LFORTRAN__ |