Which is the best Fortran compiler? We’re often asked that question, but there is no single answer. All compilers have strong and weak points, and your choice should depend on finding the best match between your requirements and a compiler’s strengths.
To help customers make an informed decision, former Polyhedron Software Ltd. and then Polyhedron Solutions Ltd. had compiled a series of charts comparing the main contenders. The charts cover the questions we are most frequently asked, but avoid subjective issues, such as stability, quality of support and documentation etc. Please contact us if you need further advice in coming to your decision.
In 2019 we took over the running of the benchmark tests with the most recent versions of Fortran compilers being available (a big Thank You to Dr. John Appleyard of Polyhedron Solutions Ltd. who passed the test suite and his administration programs and scripts on to us).

A Few Advanced Notes

Here we only compare the run-times of computing intensive Fortran programs created by various Fortran compiler systems – the so-called runtime benchmarks. As stated in our webpage “Fortran Compiler Advice”, it should be emphasized that run-time performance is not the only criterion for choosing a Fortran compiler. What is the use of the best performance when the compiler is difficult to use – the computational results may not be accurate or accurate enough; the compilation and link times are frustratingly long; the error diagnostics are weak and so on?

The compiler comparisons by Dr. Appleyard are much more detailed than the ones presented here. In particular, the diagnostic capabilities and the respective Fortran language scope (Fortran 95, 2003, 2008, etc.) should be noted. Regarding the latter, the tables of Ian Chivers & Jane Sleightholme are also informative.
Desirable (and actually necessary) would be the review of the computational results and the numerical accuracy of the Fortran compiler systems. In particular, the messages of some compilers due to numerical problems – see, for example, the results of “capaci (ta)” and “channe (l2)” – raise doubts about the correctness of the test programs. Maybe one day we will find the time for more thorough analysis in addition to our regular daily business. We ask for your patience and understanding.

Testing Equipment and Conditions

The test environment is a standard PC equipped with an Intel® Core ™ i7-9700F CPU @ 3.00GHz (8 cores) and 16GB of RAM. On this both Microsoft Windows 10 and Linux Mint 19.2 are installed.

The tested Fortran programs are in source code on the website of Polyhedron Solutions Ltd.. Below are our results of the run-time benchmarks. The 64-bit compiler variants were used, with the exception of the Lahey Fortran LF compiler (formerly LF95), which exists only as a 32-bit compiler and is also listed here because of its wide distribution.

Compiling was done with compiler and linker options as listed below (almost all compiler systems act as “drivers”, so start the compiler first and then call the linker).

Notes

Throughout, the optimizers of the compiler systems were used to get the “highest optimization level” (according to the compiler’s documentation) and – if supported – processor-specific options were set, so that the binary code for the existing CPU was optimized. Furthermore, if not specified by the optimization level, loop unrolling was used.

AP stands for AutoParallel, i.e. the compiler system also tries to parallelize the code automatically.

The benchmark programs were run several times, at least 10 times in a row, and the respective run-time was measured. If the run-time measurements stabilized (i.e., was less than 1% deviation from the previous measurement), the benchmark for the affected program was completed.

Run-times were measured in seconds.

Green cells: the run-time is in the range of 10% of the shortest run-time .
Red cells: the run-time is more than 150% of the shortest run-time .

The names of the benchmark programs are truncated to 6 characters.

Fortran Compiler SystemCompiler- and Linkeroptions, Windows
Absoft ProFortran 19.0-m64 -O4 -speed_math=11 -march=wolfdale -xINTEGER -stack:0x80000000
Absoft ProFortran 19.0 (AP)-m64 -O5 -apo -speed_math=11 -march=wolfdale -xINTEGER -stack:0x80000000
Silverfrost FTN95 8.51/64 /optimise, /stack:0x10000000
gfortran 8.1-O3 -funroll-loops -ffast-math -o
Lahey GNU 6.4-O3 -funroll-loops -ffast-math -o
Lahey LF (LF95), 32-Bit-inline (35) -o1 -sse2 -nstchk -tp4 -ntrace -unroll (6) -zfm
Intel Visual Fortran, 2019 Update 5 /fast /link /stack:64000000
Intel Visual Fortran, 2019 Update 5 (AP)/fast /Qparallel /link /stack:64000000
NAG Fortran 6.2-abi=64 -O4 -Ounroll=4 -s -v -V
PGI Fortran 19.4-V -fastsse -Munroll=n:4 -Mipa=fast,inline
PGI Fortran 19.4 (AP)-V -fastsse -Munroll=n:4 -Mipa=fast,inline -Mconcur=innermost,allcores
Windows – Runtime Benchmarks 64-Bit Fortran
Absoft
19.0
Absoft (AP)
19.0
FTN95
8.51
gfortran
8.1
Lahey GNU
6.4
Lahey LF
(32-Bit)

7.80
Intel
2019.5
Intel (AP)
2019.5
NAG
6.2
PGI
19.4
PGI (AP)
19.4
ac 4.02 4.05 8.32 4.85 4.84 7.45 3.41 3.42 5.45 6.49 6.47
aermod 7.40 7.52 14.99 11.84 11.32 10.51 5.83 6.17 11.83 7.06 7.41
air 1.77 0.87 6.48 1.95 2.14 2.74 1.30 0.73 2.34 1.53 4.34
capaci 11.72 11.63 27.17 12.72 11.96 18.29 9.87 10.10 13.06 9.64(4 14.94(4,5
channe 53.25 46.49 165.90 50.16(1 50.01 77.42 44.75 48.24 69.58(3 50.57(4,5 51.86(4,5
doduc 10.71 10.77 18.37 11.01(2 11.08 11.76 5.49 5.47 10.64 9.24(5 11.06(5
fatigu 37.56 40.08 188.39 55.81 57.13 114.56 31.27 31.26 87.56 94.32 121.13
gas_dy 29.57 28.86 62.65 62.52 60.70 56.71 22.55 23.41 41.40 42.35 65.78
induct 25.38 15.62 141.73 21.89 22.45 225.75 18.96 19.62 29.87 37.26 37.17
linpk 3.45 3.50 4.05 3.46 2.93 3.47 2.56 2.57 3.76 3.56 4.42
mdbx 5.40 4.56 9.47 4.34 4.42 6.50 3.43 2.13 5.00 4.84 21.25
mp_pro 176.00 55.53 499.20 150.05 150.84 67.26 31.48 5.75 90.96 33.44 33.51
nf 5.37 5.39 10.02 6.79 6.52 6.81 3.62 3.58 6.27 6.54 14.98
protei 13.19 13.05 26.93 12.61 12.89 24.78 13.41 13.69 14.62 14.63 14.44
rnflow 9.15 9.09 18.67 15.06 10.24 13.12 6.80 4.67 13.19 10.11 9.83
test_f 36.54 33.79 95.04 42.43 33.56 61.30 18.66 17.24 56.09 23.13 72.30
tfft2 25.76 24.51 50.32 22.29 20.35 28.25 23.33 24.02 26.34 23.92 24.17
Geometric Mean 13.65 11.63 32.55 15.46 14.69 21.02 9.37 7.88 16.47 13.40 19.13

During some program runs, exceptions (eg value overflows, value underflows, etc.) were reported that indicate numerical problems. The program reports during or at the end of the program run:
1) “The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG”.
2) “The following floating-point exceptions are signalling: IEEE_INVALID_FLAG”.
3) “Warning: Floating underflow occurred”.
4) “Warning: ieee_underflow is signaling. FORTRAN STOP”.
5) “Warning: ieee_inexact is signaling. FORTRAN STOP”.

Fortran Compiler SystemCompiler- and Linkeroptions, Linux
Absoft ProFortran 19.0-m64 -Ofast -h4 -speed_math=10 -march=wolfdale -xINTEGER -fPIC -o
Absoft ProFortran 19.0 (AP)-m64 -apo -O5 -h4 -speed_math=10 -march=wolfdale -xINTEGER -no-pie -o
gfortran 7.4-march='native' -funroll-loops -O3 -o
Intel Visual Fortran, 2019 Update 5-Ofast -fast -ipo -o
Intel Visual Fortran, 2019 Update 5 (AP)-Ofast -fast -ipo -parallel -o
NAG Fortran 6.2-o -abi=64t -O4 -Ounroll=4 -s -v -V
PGI Fortran 19.4-V -O4 -fastsse -Munroll=n:4 -m64 -o
PGI Fortran 19.4 (AP)-V -O4 -fastsse -Munroll=n:4 -m64 -Mconcur=allcores -ta=multicore -o
Linux – Runtime Benchmarks 64-Bit Fortran
Absoft
19.0
Absoft(AP)
19.0
gfortran
7.40
Intel
2019.5
Intel(AP)
2019.5
NAG
6.2
PGI
19.4
PGI(AP)
19.4
ac 3.80 3.76 13.99 3.32 3.47 14.05 5.50 5.56
aermod 6.05 6.21 5.12 5.61 6.01 7.85(3 (6 (6
air 1.73 0.75 2.45 1.71 1.11 1.86 1.14 1.35
capaci 10.75 10.92 11.72(7 9.67 10.92 11.94(3 9.55(4,5 9.86(4,5
channe 53.13 46.27 49.32(7 45.79 48.06 69.21 50.70(4,5 50.05(4,5
doduc 8.98 8.99 7.87 5.45 5.38 10.03 7.77(4,5 9.33(4,5
fatigu 37.81 38.57 44.16 31.70 31.63 87.94 63.94 64.77
gas_dy 32.30 29.44 48.59 45.27 44.82 54.97 31.54 32.80
induct 19.93 12.67 24.13 18.87 19.76 63.66 30.59 30.58
linpk 3.56 3.58 2.82 2.40 2.47 2.90 2.50 4.35
mdbx 5.40 4.61 4.51 3.51 2.22 5.14 3.92 4.24
mp_pro 81.44 27.76 160.46 32.57 6.08 158.88 32.43 32.44
nf 5.57 5.50 4.13 3.57 3.67(8 5.70 4.74 4.80
protei 14.18 13.79 13.76 14.30 14.35 13.22 13.63 14.51
rnflow 9.27 9.19 18.35 7.09 5.02 18.82 16.37 11.57
test_f 36.02 27.20 47.16 12.37(8 17.10(8 49.86 23.07 22.48
tfft2 31.73 25.65 23.26 26.04 25.94 30.25 29.80 24.56
Geometric Mean 12.78 10.57 14.98 9.76 8.56 18.20 12.15 12.60

6) “AERMOD Finishes UN-successfully”
7) “The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG, IEEE_DENORMAL”
8) “forrtl: severe (174): SIGSEGV, segmentation fault occurred”