- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
On Windows, I would like to retrieve programmatically (python or any other programming language) the version numbers of Intel Visual Fortran installed on my computer.
I know from Visual Studio (Tools/Options/Intel Compilers and Tools/Visual Fortran/Compilers) that I have these 3 versions:
12.1.5.344
15.0.4.211
19.1.3.311
The environment variables tell me only the install directories of these 3 versions
IFORT_COMPILER12=C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ ==> corresponds to version 12.1.5.344
IFORT_COMPILER15=C:\Program Files (x86)\IntelComposer XE 2015\=> corresponds to version 15.0.4.211
IFORT_COMPILER20=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.4.311\windows\ ==> corresponds to version 19.1.3.311
I made several attempts (windows registry, fsupport.txt file, etc.) but nothing very conclusive
Thanks in advance for your help !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you could do - in a small Fortran program - is construct the name of an environment variable, IFORT_COMPILERxx, where xx runs from, say, 10 to 30, get the value of that environment variable via get_environment_variable() and try to run the compiler, which would be located in %IFORT_COMPILERxx%\bin\intel64 (or similar) via execute_command_line(). Redirect the output to a file and parse the first line.
Whether that is an exhaustive search and whether there are variations in the latter part of the path that you need to take care of, I do not know. The versions I checked on my system seem to use this pattern.
Of course, you can do this with Python or most other programming languages as well.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure that this is what you want, but you can use the intrinsic routines compiler_version() and compiler_options() to get the information on the compiler that was used to build the program. Here is an example of he information you get:
Compiler version:
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.4.0 Build 20210910_000000
Compiler options:
/debug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your answer. But indeed I would like to know all the versions installed on the computer, not the information on the compiler that was used to build a specific program.
And I would like to find them via computer code (programmatically).
So in my case I would like a code that returns these 3 values:
12.1.5.344
15.0.4.211
19.1.3.311
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure why you would want to do that. You could scan your drives looking for ifort.exe and then either get the version.info from the file or parse the folder names.... There may be smarter ways, the folder roots used by OneApi and by previous versions of ifort are different BTW.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you could do - in a small Fortran program - is construct the name of an environment variable, IFORT_COMPILERxx, where xx runs from, say, 10 to 30, get the value of that environment variable via get_environment_variable() and try to run the compiler, which would be located in %IFORT_COMPILERxx%\bin\intel64 (or similar) via execute_command_line(). Redirect the output to a file and parse the first line.
Whether that is an exhaustive search and whether there are variations in the latter part of the path that you need to take care of, I do not know. The versions I checked on my system seem to use this pattern.
Of course, you can do this with Python or most other programming languages as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@andrew_4619 : The purpose is to let the user choose (in a GUI) the version of Intel Fortran to use to compile some files (see attached image). But I could not find the exact versions installed.
@Arjen_Markus : Your solution seems to work! Thank you
Thank you all for your answers

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page