- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to have the compiler's version number automatically placed into a string within my source code at compile time so that output files can include the compiler's version number along with the program's version number and build date. I currently set this information manually, but I would like it to be automatic just as various pieces of program version information are kept updated in special strings by my source version control software.
I know that the compiler option /Qsox places compiler info into a string in the executable file that one can search for in the *.exe file, but I want the information to be available during program execution. Is there any way to do this? Thanks.
Neill
I know that the compiler option /Qsox places compiler info into a string in the executable file that one can search for in the *.exe file, but I want the information to be available during program execution. Is there any way to do this? Thanks.
Neill
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The predefined preprocessor symbol __INTEL_COMPILER has the version number in the form of an integer, such as 1200 for 12.0, but it doesn't reflect individual updates. __INTEL_COMPILER_BUILD_DATE gives you a value such as 20101006 that is the build date in YYYYMMDD format. Unfortunately, it seems difficult to put these into constant strings - at least my attempts to do so have failed. But you can put them into PARAMETER constants such as:
INTEGER, PARAMETER :: INTEL_COMPILER_VERSION = __INTEL_COMPILER
INTEGER, PARAMETER :: INTEL_COMPILER_BUILD_DATE = __INTEL_COMPILER_BUILD_DATE
You can then write these values in whatever format you want. You must enable "Preprocessing" to get these to work.
INTEGER, PARAMETER :: INTEL_COMPILER_VERSION = __INTEL_COMPILER
INTEGER, PARAMETER :: INTEL_COMPILER_BUILD_DATE = __INTEL_COMPILER_BUILD_DATE
You can then write these values in whatever format you want. You must enable "Preprocessing" to get these to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve,
An INTEGER PARAMETER works just fine. When you say "Preprocessing" must be enable, do you mean setting "Preprocess Source File" to Yes(/fpp) under the IDE Property Pages Fortran:Preprocessor? Do any of the other items on this Property Page need to be set?
Where is there help on the preprocessing options and the predefined preprocessor symbols? I did a search under Help for _INTEL_COMPILER and got no results.
Thanks again.
Neill
An INTEGER PARAMETER works just fine. When you say "Preprocessing" must be enable, do you mean setting "Preprocess Source File" to Yes(/fpp) under the IDE Property Pages Fortran:Preprocessor? Do any of the other items on this Property Page need to be set?
Where is there help on the preprocessing options and the predefined preprocessor symbols? I did a search under Help for _INTEL_COMPILER and got no results.
Thanks again.
Neill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that's all you need to set. For more info, see the on-disk doc under Building Applications > Preprocessing > Using the predefined preprocessor symbols

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