IntelLLVM: Add special case for ifx 2021.1 version extraction

The ifx beta versions forgot to define `__INTEL_LLVM_COMPILER`, and
instead define `__INTEL_COMPILER == 201900`.  Add a special case.

Issue: #22120
This commit is contained in:
Brad King 2021-04-27 12:58:24 -04:00
parent b7193ab18f
commit 9c479c7c40
2 changed files with 16 additions and 5 deletions

View File

@ -47,11 +47,7 @@ Compilers
* The ``icx``/``icpx`` C/C++ compilers on Linux, and the ``icx`` * The ``icx``/``icpx`` C/C++ compilers on Linux, and the ``icx``
C/C++ compiler on Windows, are fully supported as of oneAPI 2021.1. C/C++ compiler on Windows, are fully supported as of oneAPI 2021.1.
* The ``ifx`` Fortran compiler on Linux is partially supported. * The ``ifx`` Fortran compiler on Linux is supported as of oneAPI 2021.1.
As of oneAPI 2021.1, ``ifx`` does not define several identification
macros, so CMake identifies it as the classic ``Intel`` compiler.
This works in many cases because ``ifx`` accepts the same command line
parameters as ``ifort``. A future version of oneAPI may fix this.
* The ``ifx`` Fortran compiler on Windows is not yet supported. * The ``ifx`` Fortran compiler on Windows is not yet supported.
@ -359,3 +355,10 @@ Changes made since CMake 3.20.0 include the following.
as having major version 2021. CMake 3.20.1 and below were not aware of a as having major version 2021. CMake 3.20.1 and below were not aware of a
change to the identification macro version scheme made by Intel starting change to the identification macro version scheme made by Intel starting
in version 2021, and detected the version as 20.2. in version 2021, and detected the version as 20.2.
* The Intel oneAPI Fortran compiler is now identified as ``IntelLLVM``.
The oneAPI 2021.1 Fortran compiler is missing an identification macro,
so CMake 3.20.1 and below identified it as ``Intel``. CMake now has
a special case to recognize oneAPI 2021.1 Fortran as ``IntelLLVM``.
The oneAPI 2021.2 Fortran compiler defines the proper identification
macro and so is identified as ``IntelLLVM`` by all CMake 3.20 versions.

View File

@ -36,6 +36,14 @@
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
# endif # endif
#elif defined(__INTEL_COMPILER) && __INTEL_COMPILER == 201900
PRINT *, 'INFO:compiler[IntelLLVM]'
! ifx 2021.1 forgot to define __INTEL_LLVM_COMPILER.
! Instead it defines __INTEL_COMPILER == 201900.
# define COMPILER_VERSION_MAJOR DEC(2021)
# define COMPILER_VERSION_MINOR DEC(1)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
#elif defined(__INTEL_COMPILER) || defined(__ICC) #elif defined(__INTEL_COMPILER) || defined(__ICC)
PRINT *, 'INFO:compiler[Intel]' PRINT *, 'INFO:compiler[Intel]'
! __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later. ! __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later.