- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We do our builds with Intel Fortran v10 and v11, and with various subbuilds as well. Is there a system function I can call to return the full version number of the compiler?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Today, your resources for this are:
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
- The __INTEL_COMPILER and __INTEL_COMPILER_BUILD_DATE preprocessor symbols (see documentation under Building Applications > Preprocessing > Using Predefined Processor Symbols
- The /Qsox option which embeds in the object code full information about the compiler version and command options. This cannot be readily retrieved by the program, though.
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
Link Copied
13 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not declare a parameter dependent on the version?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jimdempseyatthecove
Why not declare a parameter dependent on the version?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While you can use preprocessor symbols I was suggesting something simpler.
The user is in control of the build environments (i.e. selection of compiler).
While the user can use the FPP in the build using the predefined processor symbols toaugment code generation, they could alternately modify the solution/project files to provide their own numeric or logical value for build. This value is included in the Fortran generated portion of the solution (e.g. in COMMON or in a module) .AND. the variable will be visible by the non-Fortran components as well as Fortran built DLL where one DLL is to service different builds (F10 and F11). In the latter cases the FPP solution might not be sufficient.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jimdempseyatthecove
Why not declare a parameter dependent on the version?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jimdempseyatthecove
While you can use preprocessor symbols I was suggesting something simpler.
The user is in control of the build environments (i.e. selection of compiler).
While the user can use the FPP in the build using the predefined processor symbols toaugment code generation, they could alternately modify the solution/project files to provide their own numeric or logical value for build. This value is included in the Fortran generated portion of the solution (e.g. in COMMON or in a module) .AND. the variable will be visible by the non-Fortran components as well as Fortran built DLL where one DLL is to service different builds (F10 and F11). In the latter cases the FPP solution might not be sufficient.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Today, your resources for this are:
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
- The __INTEL_COMPILER and __INTEL_COMPILER_BUILD_DATE preprocessor symbols (see documentation under Building Applications > Preprocessing > Using Predefined Processor Symbols
- The /Qsox option which embeds in the object code full information about the compiler version and command options. This cannot be readily retrieved by the program, though.
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are in contol of the source files but not in control of the build environment (i.e. you distribute sources for the end-user to compile), then it is also likely that you are in control of the distribution of the MAKE files or Project/Solution files. In those you can probe the system (e.g. environment variables) and thus produce a "build" that is dependent on the build environment. See Steve's suggeston as to the compiler visible "macro".
Your choices then are:
1) produce different code based on environment/versions
2) produce same code but different global variable used for code path selection.
Method 1) may require all code to be compiled per environment
Method 2) permits libraries to be built once, then select the path at run time.
Note, Steve's method would have to be expanded due to users having non-Intel compilers.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Today, your resources for this are:
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
- The __INTEL_COMPILER and __INTEL_COMPILER_BUILD_DATE preprocessor symbols (see documentation under Building Applications > Preprocessing > Using Predefined Processor Symbols
- The /Qsox option which embeds in the object code full information about the compiler version and command options. This cannot be readily retrieved by the program, though.
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
Thanks Steve, we will try this solution first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jimdempseyatthecove
If you are in contol of the source files but not in control of the build environment (i.e. you distribute sources for the end-user to compile), then it is also likely that you are in control of the distribution of the MAKE files or Project/Solution files. In those you can probe the system (e.g. environment variables) and thus produce a "build" that is dependent on the build environment. See Steve's suggeston as to the compiler visible "macro".
Your choices then are:
1) produce different code based on environment/versions
2) produce same code but different global variable used for code path selection.
Method 1) may require all code to be compiled per environment
Method 2) permits libraries to be built once, then select the path at run time.
Note, Steve's method would have to be expanded due to users having non-Intel compilers.
Jim Dempsey
Thanks for your replies, Jim. I am indeed in control of the SLN / VFPROJ files. I'm not sure how to probe the environment variables from these files though.
Adrian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In VS you use $(environmentVariableNameHere)
And in VS project Preprocessor Definitions you can define
FOO=$(environmentVariableNameHere)
Try it out first before you modify too much code.
Prior to the above working you will have to set the environment variable (or use one set by installation)
SET USE_IVF=IFORT_COMPILER90 (or IFORT_COMPILER11)
(set to C:Program FilesIntelCompilerFortran9.0 on my system)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jimdempseyatthecove
In VS you use $(environmentVariableNameHere)
And in VS project Preprocessor Definitions you can define
FOO=$(environmentVariableNameHere)
Try it out first before you modify too much code.
Prior to the above working you will have to set the environment variable (or use one set by installation)
SET USE_IVF=IFORT_COMPILER90 (or IFORT_COMPILER11)
(set to C:Program FilesIntelCompilerFortran9.0 on my system)
Jim Dempsey
Yes, but this requires actually setting the environment variable on the build machine, and remembering to change it when the compiler is changed. This is outside my control.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Today, your resources for this are:
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
- The __INTEL_COMPILER and __INTEL_COMPILER_BUILD_DATE preprocessor symbols (see documentation under Building Applications > Preprocessing > Using Predefined Processor Symbols
- The /Qsox option which embeds in the object code full information about the compiler version and command options. This cannot be readily retrieved by the program, though.
I would suggest that __INTEL_COMPILER is probably what you want today. It will let you distinguish 11.0 from 11.1, for example. You can use !DEC$ IF to test for this without enabling preprocessing.
What is the format for __INTEL_COMPILER ? Is it always 4 digits? The Help files gives an example 1010, would this signify version 10.1 or 10.10 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - ferrad01
What is the format for __INTEL_COMPILER ? Is it always 4 digits? The Help files gives an example 1010, would this signify version 10.1 or 10.10 ?
It is not always four digits, but the right two digits are always the .xx. So, for example, 9.1 would be 910. 1010 is 10.1. I guess we left it open to having a subsidiary digit.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page