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

FORTRAN in VS2022

Innovationgame
5,680 Views
Innovationgame_0-1639938800656.png

 

Innovationgame
New User
5 Views
 
 

I have just installed VS2022 and Intel OneAPI Fortran.  I have opened VS and added my source code files to a project.  However, I can see no way to compile or build the executable.  Any suggestions?  I have been through all the help files, but they seem to bare little relation to what I have on the screen.

0 Kudos
1 Solution
Innovationgame
5,371 Views

I have now soloved it.  I needd to set the runtime library to "Debug QuickWin (/libs:qwin /dbglibs)" in the project property pages

View solution in original post

20 Replies
JohnNichols
Valued Contributor II
5,648 Views

You should be able to see the debug tab on the top of Visual Studio when it is fully open. 

If need be open a file for editing and the may fix your problem. 

Innovationgame
5,602 Views

The build tabs are all greyed out.  I have the editor open.  I have attached a screenshot.

Barbara_P_Intel
Moderator
5,597 Views

What version of the Fortran compiler are you using?  VS2022 support begins with the oneAPI 2022.1 HPC Toolkit for Windows release.  The ifort version in that toolkit is 2021.5.0.

 

Innovationgame
5,582 Views

Inonly downloaded the VS2022 from Intel 2 days ago, but it appears to be 2022.0.0.  How do update this to 2022.1, please?

JohnNichols
Valued Contributor II
5,557 Views

My guess is there is a mistake in the install.  

If you have time and I would remove VS and Fortran.  

I would install VS 2019 and 2022 and then install Fortran, you need the base kit and the HPC.  When you install VS make sure you install the C component on the tabs, I usually grab the data science one as well.  

It really is quite simple if you get it right, but it is easy to get wrong.  

If in doubt select all the VS buttons on install. 

Barbara_P_Intel
Moderator
5,563 Views

These version numbers are confusing!

VS2022 is Microsoft Visual Studio 2022.

Intel released oneAPI 2022.1. Those are toolkits like Base Toolkit and HPC Toolkit. This is the first release that supports VS2022.

Some of the components that make up the oneAPI 2022.1 toolkits have different versioning.  For example, ifort is version 2021.5.0.  ifx is version 2022.0.0. The components are using Sematic Versioning.  This article may help explain the version changes.

 

Steve_Lionel
Black Belt Retired Employee
5,551 Views

Go to the Windows "Apps" settings page, select the Intel HPC Toolkit 2022, Modify. When the installer opens, select Modify. Continue and then check the box for VS2022. Let that complete.

Now repeat the process, except this time select Repair from the Toolkit installer.

Fortran should be now visible in VS2022. If you open a solution and it says a Fortran project is incompatible., right click on it and select Reload.

davidspurr
Beginner
5,544 Views

In addition to the Base Toolkit, can someone please clarify whether the full HPC Toolkit is required, or just the components of interest?

I downloaded the standalone Fortran compiler components yesterday (w_fortran-compiler_p_2022.0.0.77_offline.exe); ie. the Classic Compiler.

Is that all I need from the HPC Toolkit for Fortran programming?

Or do I require the full package?

Steve_Lionel
Black Belt Retired Employee
5,530 Views

From the HPC Toolkit, all you need is the Classic Fortran compiler. If you want MKL, that's in the Base Toolkit.

It used to be that debugging support was in the Base Toolkit, but I think that was corrected.

davidspurr
Beginner
5,521 Views

Thanks Steve.

Innovationgame
5,495 Views

Thank you all for your helpful comments.  I have uninstalled everything and started again.  Next I installed Microsoft Visual Studio Community 2022 (64-bit) Version 17.0.4.  I installed  and FORTAN is now supported.  I have started a new solution and added all my source code files.  It all looks good until I click the build tag. All that happens then is that I see the output message

 

Build started...
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

 

But I cant find and executable or any object files. When I click the start button I get the message "The system cannot find the file specified".  I last used FORTRAN using Microsoft Visual FORTRAN about five years ago, so I am a bit in the dark about how to proceed.  Am I missing something?

Innovationgame
5,481 Views

I have now discovered how to add source code files to the project.  I had assumed that if they were in the editor window, they were part of the project.  Build now works, although there are errors that I made nee to sort out. 'use dflib' may be one of them.  I will investigate.

andrew_4619
Honored Contributor II
5,468 Views

I think you will want USE IFQWIN, if this is a QuickWin project it will also need the correct project type in the settings

Innovationgame
5,409 Views

I am using IFQWIN and some other libraies that were associated with my previous version of FORTRAN.  I suspect that I may need more up to date libraries.  these are the build errors:

 

Dialog.obj : error LNK2019: unresolved external symbol _settextcolorrgb referenced in function DIALOG
Dialog.obj : error LNK2019: unresolved external symbol _f_setfont referenced in function DIALOG
Graset.obj : error LNK2001: unresolved external symbol _f_setfont
Dialog.obj : error LNK2019: unresolved external symbol _settextcursor referenced in function DIALOG
Graset.obj : error LNK2019: unresolved external symbol _remappalette referenced in function GRASET
Graset.obj : error LNK2019: unresolved external symbol _setcolor referenced in function GRASET
Graset.obj : error LNK2019: unresolved external symbol _setbkcolor referenced in function GRASET
Graset.obj : error LNK2019: unresolved external symbol _floodfillrgb referenced in function GRASET
Graset.obj : error LNK2019: unresolved external symbol _initializefonts referenced in function GRASET
Graset.obj : error LNK2019: unresolved external symbol _f_moveto referenced in function GRASET
Graset.obj : error LNK2019: unresolved external symbol _f_outgtext referenced in function GRASET
MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)

Any suggestions?

andrew_4619
Honored Contributor II
5,399 Views

Your project is setting the wrong default calling convention I believe.  I think it will be (If I remember correctly ) the /iface option. Remove that and see what you get.

Innovationgame
5,372 Views

I have now soloved it.  I needd to set the runtime library to "Debug QuickWin (/libs:qwin /dbglibs)" in the project property pages

andrew_4619
Honored Contributor II
5,364 Views

Yes that is what I meant when I said "if this is a QuickWin project it will also need the correct project type in the settings", maybe I should have been more specific. If you make a new project and specify it is Quickwin it sets the correct run time etc for you automatically

Innovationgame
5,358 Views

Thanks Andrew.  I hadn't realised that yuo meant the settings.  I had simply defined 'use IFQWIN' in the source code.  All is well now.  Thanks again.

Mohammed1
Novice
2,851 Views

Hello, I have been having a similar issue but I am having a hard time understanding what your comment/solution mean. Would you be able to elaborate on this further?

Reply