Open
Description
To switch a compiler option for specifying the Fortran standard, CMake processes the following statements:
add_compile_options(-warn declarations,general,usage,interfaces,unused)
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
add_compile_options(-stand f15)
else()
add_compile_options(-stand f18)
endif()
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 keyword f18
for -stand
option.
It can be confirmed from references:
- 18.0 Fortran Compiler Developer Guide and Reference
- 19.0 Fortran Compiler Developer Guide and Reference
I found a version comparison operator VERSION_LESS_EQUAL
corresponding to <=
.
It would be better to use it instead of VERSION_LESS
.
add_compile_options(-warn declarations,general,usage,interfaces,unused)
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS_EQUAL 18.0)
add_compile_options(-stand f15)
else()
add_compile_options(-stand f18)
endif()
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
awvwgk commentedon Jun 25, 2021
Good catch, thanks. Would you mind opening a pull request for this?
nncarlson commentedon Jun 25, 2021
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 theelse
clause. This needs to beVERSION_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, soVERSION_LESS 19.0
works.Romendakil commentedon Jun 25, 2021
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.
nncarlson commentedon Jun 25, 2021
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.
awvwgk commentedon Jun 25, 2021
Well, stdlib doesn't compile with Intel 18 and lower anyway, so support is not really given right now for those versions (see #299).
degawa commentedon Jun 27, 2021
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?).awvwgk commentedon Jun 27, 2021
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.