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

Selecting ifort version in Visual Studio 19 (16.11.20)

David_Billinghurst
New Contributor III
1,563 Views

I have recently upgraded Visual Studio 19 from version 16.4.? to latest 16.11.20.

My memory may be letting me down, but I THINK that the behaviour when selecting the ifort version has changed.

The compiler version is selected in Tools > Options > Intel Compilers and Libraies > IFORT Intel Fortran Classic > Compilers.  You the select the desired compiler version or <Latest> from the x64 tab.

I thought that the compiler version was saved on a per project basis, so that you could have two projects using different versions of the compiler.  This is not the case with my current setup.  If I change the compiler in one project and close it, it also changes the version used in other projects.

Has the behaviour changed, or am I just forgetful.

0 Kudos
6 Replies
JohnNichols
Valued Contributor III
1,534 Views

Did you get one of the Fortran mugs, several years ago?  My memory is going. 

0 Kudos
Ron_Green
Moderator
1,515 Views

I'm far from the most proficient at VS but I'll take a stab at this.  Someone will correct me if I'm wrong, which I frequently am when it comes to Windows and VS.  But my understanding is that you use the method you mentioned above to set the default compiler for all projects in VS.  BUT you can override that on a project-by-project basis.  I think it's in Project Properties somewhere.

 

You can read this and see if what I say makes sense. 

0 Kudos
JohnNichols
Valued Contributor III
1,508 Views

if on the properties page you change to X64 on all sheets, there are a couple of locations I found, then you can pick ifx.

If I randomly open an Fortran project it opens with IFORT even if the other is selected as ifx.  

 

0 Kudos
FortranFan
Honored Contributor III
1,500 Views

@David_Billinghurst ,

To the best of my knowledge and the teams I have worked with, the integration facility of Intel Fortran with Visual Studio has never included the capability to specify on a project-by-project basis the version of Intel Fortran.

There has been only one setting as I far as I know and that is specific to a given session of Visual Studio.  This is the one you list which is under Tools -> Intel Compilers and Tools (now termed Libraries) -> Visual Fortran (now with two options, one for IFX and another for IFORT) -> Compilers and then a tab for Win32 and another for X64.

 

 

0 Kudos
JohnNichols
Valued Contributor III
1,492 Views

32 bit at same time uses ifort, even though IFX is listed.  

 

<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectCreator="Intel Fortran" Keyword="Console Application" Version="11.0" ProjectIdGuid="{A7F2D665-99AA-471B-BF31-93E698D53120}">
	<Platforms>
		<Platform Name="Win32"/>
		<Platform Name="x64"/></Platforms>
	<Configurations>
		<Configuration Name="Debug|Win32">
				<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" WarnInterfaces="true" Traceback="true" BoundsCheck="true" StackFrameCheck="true" RuntimeLibrary="rtMultiThreadedDebugDLL" UseMkl="mklParallel"/>
				<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemConsole"/>
				<Tool Name="VFResourceCompilerTool"/>
				<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
				<Tool Name="VFCustomBuildTool"/>
				<Tool Name="VFPreLinkEventTool"/>
				<Tool Name="VFPreBuildEventTool"/>
				<Tool Name="VFPostBuildEventTool"/>
				<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
		<Configuration Name="Debug|x64" UseCompiler="ifxCompiler">

 

64 bit  - refer line 17   -- it is controlled by the platform 32 or 64 bit, even in 64 bit you can swap with two Fortran projects open. 

 

<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectCreator="Intel Fortran" Keyword="Console Application" Version="11.0" ProjectIdGuid="{A7F2D665-99AA-471B-BF31-93E698D53120}">
	<Platforms>
		<Platform Name="Win32"/>
		<Platform Name="x64"/></Platforms>
	<Configurations>
		<Configuration Name="Debug|Win32">
				<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" WarnInterfaces="true" Traceback="true" BoundsCheck="true" StackFrameCheck="true" RuntimeLibrary="rtMultiThreadedDebugDLL" UseMkl="mklParallel"/>
				<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemConsole"/>
				<Tool Name="VFResourceCompilerTool"/>
				<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
				<Tool Name="VFCustomBuildTool"/>
				<Tool Name="VFPreLinkEventTool"/>
				<Tool Name="VFPreBuildEventTool"/>
				<Tool Name="VFPostBuildEventTool"/>
				<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
		<Configuration Name="Debug|x64" UseCompiler="ifxCompiler">
				<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" WarnInterfaces="true" Traceback="true" BoundsCheck="true" StackFrameCheck="true" RuntimeLibrary="rtMultiThreadedDebugDLL"/>
				<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemConsole"/>
				<Tool Name="VFResourceCompilerTool"/>
				<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
				<Tool Name="VFCustomBuildTool"/>
				<Tool Name="VFPreLinkEventTool"/>
				<Tool Name="VFPreBuildEventTool"/>
				<Tool Name="VFPostBuildEventTool"/>
				<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
		<Configuration Name="Release|Win32">
				<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" RuntimeLibrary="rtMultiThreadedDLL"/>
				<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" SubSystem="subSystemConsole"/>
				<Tool Name="VFResourceCompilerTool"/>
				<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
				<Tool Name="VFCustomBuildTool"/>
				<Tool Name="VFPreLinkEventTool"/>
				<Tool Name="VFPreBuildEventTool"/>
				<Tool Name="VFPostBuildEventTool"/>
				<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
		<Configuration Name="Release|x64">
				<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" RuntimeLibrary="rtMultiThreadedDLL"/>
				<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" SubSystem="subSystemConsole"/>
				<Tool Name="VFResourceCompilerTool"/>
				<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
				<Tool Name="VFCustomBuildTool"/>
				<Tool Name="VFPreLinkEventTool"/>
				<Tool Name="VFPreBuildEventTool"/>
				<Tool Name="VFPostBuildEventTool"/>
				<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration></Configurations>
	<Files>
		<Filter Name="Header Files" Filter="fi;fd"/>
		<Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"/>
		<Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">
		<File RelativePath=".\Base.f90"/>
		<File RelativePath=".\Scotia.f90"/>
		<File RelativePath=".\Ularc.f90"/>
		<File RelativePath=".\vsrnggaussian.f90"/></Filter>
		<File RelativePath=".\ReadMe.txt"/></Files>
	<Globals/></VisualStudioProject>

 

 

0 Kudos
JohnNichols
Valued Contributor III
1,442 Views

I should have provided more explanation, I apologize it was the end of a long day of coding and analysis. 

In the latest 2022 with the latest oneAPI if I create a new Fortran project :

Screenshot 2022-10-19 082056.png

I get IFORT in x64. 

 

Screenshot 2022-10-19 082129.png

I can change the project to IFX and create a second project. But wait, I have to hunt for the new project with a tiny amount of code, someone has put it at the bottom of the list.  Could we fix this please, it is nice to start with a simple Hello World.  

Screenshot 2022-10-19 082242.png

 

Second project is ifort

 

Screenshot 2022-10-19 082305.png

First project is still IFX.  

Screenshot 2022-10-19 082330.png

IFX and IFORT appear to be configured in the project file, which makes sense.  

0 Kudos
Reply