Open degawa opened 3 years ago
Good catch, thanks. Would you mind opening a pull request for this?
Note that when CMake compares version strings it uses the full version, including the fourth tweak field, which for Intel is the numeric build date. And when you compare against "18.0" it is padded with 0's to "18.0.0.0". So even with VERSION_LESS_EQUAL
, any 18.0 version compiler -- including 18.0.0 because of the build date for the tweak field -- will fall into the else
clause. This needs to be VERSION_LESS 18.1
if 18.1 is the first to support -stand f18
. Actually I think they went straight from 18.0 to 19.0, so VERSION_LESS 19.0
works.
Recently there was the discussion in favor of not support gfortran 7 and 8 any longer because they are no longer maintained by gcc/gfortran. With the same reasoning, shouldn't we abandon Intel 18 and 19 as well as they are no longer supported (AFAIK). Intel 20 and 21 are the only actively maintained versions.
I wouldn't object too strongly to dropping support for at least Intel 18 -- it's pretty old now. Though it is still used in some HPC centers where they tend to keep their OS/software stack unchanged for a long time. I'm not aware of any 20 or 21 version. They seemed to have jumped from 19.1 to 2021 in their new oneAPI branding.
Well, stdlib doesn't compile with Intel 18 and lower anyway, so support is not really given right now for those versions (see https://github.com/fortran-lang/stdlib/issues/299).
Would the following be a summary of the discussion here?
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)...
will be removed in the near future (soon?).I found only one Intel 18 version that works (18.0.5 20180823), but I think going forward we will just drop support for 18 and earlier. Therefore, there is indeed no need to fix this issue.
To switch a compiler option for specifying the Fortran standard, CMake processes the following statements:
The version comparison operator
VERSION_LESS
used here corresponds to<
, so-stand f18
is specified for Intel Fortran 18.0 and later. However, Intel Fortran 18 does not have the keywordf18
for-stand
option. It can be confirmed from references:I found a version comparison operator
VERSION_LESS_EQUAL
corresponding to<=
. It would be better to use it instead ofVERSION_LESS
.