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
16,000 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
15,688 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

23 Replies
JohnNichols
Valued Contributor III
14,918 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. 

0 Kudos
Innovationgame
14,871 Views

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

0 Kudos
Barbara_P_Intel
Employee
14,869 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.

 

0 Kudos
Innovationgame
14,853 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?

0 Kudos
JohnNichols
Valued Contributor III
14,829 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. 

0 Kudos
Barbara_P_Intel
Employee
14,835 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.

 

0 Kudos
Steve_Lionel
Honored Contributor III
14,823 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.

0 Kudos
davidspurr
Beginner
14,816 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?

0 Kudos
Steve_Lionel
Honored Contributor III
14,802 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.

0 Kudos
davidspurr
Beginner
14,793 Views

Thanks Steve.

0 Kudos
Innovationgame
14,767 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?

0 Kudos
Innovationgame
14,753 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.

0 Kudos
andrew_4619
Honored Contributor III
14,740 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
14,680 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?

0 Kudos
andrew_4619
Honored Contributor III
14,670 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
15,689 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 III
14,635 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
14,629 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.

0 Kudos
Mohammed1
Novice
12,122 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?

0 Kudos
Reply