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

compiler version shown inside program

jansson
Beginner
471 Views

Hi,

I would like to show what compiler & version was used to build my program inside my console Fortran program. I use visual studio 2005 to build my solution and have several ifort compilers installed to choose from. I notice the version in the output window while building... but do not know if there is a macro to get hold of it there inside VS.

I now use a "pre-Build Event" to show version in repository and would like to add to this info.

From ifort /help -"/Qsox[-] enable/disable(DEFAULT) saving of compiler options and version in
the executable" but how do i watch this info when running this executable if possible?

Another possibility -"/what display detailed compiler version information"... but I cant figure how to use this in VS either.

Any ideas are welcome

Cheers

Magnus

0 Kudos
2 Replies
Steven_L_Intel1
Employee
471 Views

There isn't yet a way to do exactly what you want. There is a F2008 intrinsic that will do it, but we don't support it. There are the predefined preprocessor symbols __INTEL_COMPILER and __INTEL_COMPILER_BUILD_DATE which can be used to identify the version indrectly.

You could, I suppose, have a build event that directs the output of an "ifort -what" to a file and then ready the file and create an include file. Seems rather convoluted.

0 Kudos
jansson
Beginner
471 Views

Yes getting "ifort -what" output to file seems promising. What we do today to get the version from tortoisesvn is similar "SubWCRev.exe > file.txt". My worry is, how do I run the same 'ifort' as VS does when it compiles the project/solution, I see no macro for the compiler path in VS. :(

I would gladly make a macro do ifort -what > foo.txt; I will test for sure, and see if the right ifort is choosen!

If we cant run -what for the 'same' ifort in some way, those preprocessor symbols are a substitute for now.

Thank you!

/Magnus

0 Kudos
Reply