Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
27523 Discussions

__INTEL_COMPILER value does not match manual

John_Young
New Contributor I
626 Views

Hi,

The __INTEL_COMPILER definition does not seem to match what the manual says. The manual states:

 

The version of the compiler in the form VVVVMU,
where VVVV is the major version, M is the minor
version, and U is the update version. For example,
Version 2021.1.2 is indicated by a value of 202112.
See also symbol __INTEL_LLVM_COMPILER.

 

However, if I compile (with -fpp) and run the program shown below:

 

    program a

    write(*,*) __INTEL_COMPILER

    end program a

 

I see only

 

    2021

 

even though I am compiling with ifort version 2021.5.0

 

Thanks,

John

 

0 Kudos
1 Solution
Ron_Green
Moderator
575 Views

There's a number of problems with these macros.  I'll talk to the team about this today.

It is bad terminology.  Unfortunately for IFORT it's too late to do anything about it since customers are using the current macros INTEL_COMPILER and _INTEL_COMPILER_UPDATE.  You are correct, _UPDATE is the MINOR version, not the update.  It's a legacy problem - this macro was defined years ago before the convention for Semantic Versioning was around - major.minor.patch.

And unfortunately if we change these existing user codes and processes will break and we'll get a lot of complaints.  But I can get the Documentation updated for IFORT _INTEL_COMPILER value (major number only)

 

Ideally we should have INTEL_COMPILER_MAJOR and INTEL_COMPILER_MINOR and INTEL_COMPILER_PATCH 

I'll talk to the team and see about getting these into IFX.  

View solution in original post

5 Replies
John_Young
New Contributor I
624 Views

Also, the __INTEL_COMPILER_UPDATE definition does not seem to match the manual.  The manual states:

 

The compiler update number within a version
(example: 1 for Update 1). See also symbol
__INTEL_COMPILER.

 

However, the attached test program compiled with 2021.3.0 on Windows gives minor version '3'  instead of update number 0.  If the minor version is actually meant, then the manual should be changed to use consistent terminology since 'update' is used to indicate an update within a minor version.  Otherwise, 0 should be returned.

 

Also, since __INTEL_COMPILER and _INTEL_COMPILER_UPDATE are supplied. It would be nice for completeness if something like __INTEL_COMPILER_MINOR_VERSION was also defined.

 

Thanks,

John

Ron_Green
Moderator
576 Views

There's a number of problems with these macros.  I'll talk to the team about this today.

It is bad terminology.  Unfortunately for IFORT it's too late to do anything about it since customers are using the current macros INTEL_COMPILER and _INTEL_COMPILER_UPDATE.  You are correct, _UPDATE is the MINOR version, not the update.  It's a legacy problem - this macro was defined years ago before the convention for Semantic Versioning was around - major.minor.patch.

And unfortunately if we change these existing user codes and processes will break and we'll get a lot of complaints.  But I can get the Documentation updated for IFORT _INTEL_COMPILER value (major number only)

 

Ideally we should have INTEL_COMPILER_MAJOR and INTEL_COMPILER_MINOR and INTEL_COMPILER_PATCH 

I'll talk to the team and see about getting these into IFX.  

John_Young
New Contributor I
556 Views

Ron,

 

Updating the manual to reflect what the definitions are is good for us.  We just need to know what is being returned and that it will not change so we can pre-process for various workarounds based on the compiler version.

I'll take a look at the dryrun flag.

 

Thanks,

John

 

Ron_Green
Moderator
572 Views

another problem I found that needs addressing:

on Linux and mac we have the -dryrun option.  This is handy to show all the predefined macros for a compilation.  Interestingly this option is documented as not being on Windows.  So I tried it on Windows and, lo, it COMPLAINS about "unkown option" but then goes ahead and DOES the dryrun!   Try it yourself ifort -dryrun hello.f90

Barbara_P_Intel
Moderator
323 Views

The Fortran Developer Guide and Reference now has an updated description of the predefined preprocessing macro __INTEL_COMPILER. This version of the DGR was published earlier this month.

 

Reply