Skip to content

fortran: test for f77 and f90 support at once

scivision requested to merge scivision/cmake:f90 into master

The currently available Fortran compilers supported by CMake support Fortran 95+, thus testing Fortran 90 separately from Fortran 77 just slows down the CMake configure, particularly on Windows. This MR eliminates the extra try_compile() for Fortran projects, with CMake configure speed benefit for Fortran on Windows with solid state hard drive:

  • GCC Gfortran 10: about 1 second
  • Intel Fortran oneAPI 2021.2: 2-3 seconds

It appears Concurrent Fortran has not been a product for several years. Is anyone using this? Is OpenWatcom used mainly for C/C++? I suggest either deprecating those compilers for Fortran, or simply make if(MATCHES) statements for those Fortran_COMPILER_ID where I removed them in this PR, with a definite performance boost on CMake configure.

From https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html the CMake-supported Fortran compilers appear to be: Absoft, Cray, Flang, G95, GNU, Intel, IntelLLVM, NVHPC, PGI, Pathscale, XL

Edited by scivision

Merge request reports