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

msbuild (Visual Studio Build Tools) with intel fortran

u12
Beginner
3,378 Views

We have a buildserver to build fortran code defined with SLN and VFPROJ files.

Before oneAPI we where doing it with calling devenv xxx.sln.
 

With oneAPI we would need to have a license for visual studio professional. We saw the  possibility to use command-line tools only (Visual Studio Build Tools* 2022), see https://www.intel.com/content/www/us/en/developer/articles/system-requirements/oneapi-fortran-compiler-system-requirements.html / Microsoft Visual Studio* on Windows / dot 2

integrate_build_tools.png

Therefore we tried the "Main Program Code"  from the visual studio templates to use msbuild

It is not working, because  the msbuild does not know how to handle VFPROJ files.

Therefore the questions

  • How to use Visual Studio Build Tools* 2022 without visual studio?
  • Is this only possible for C++ and therefore the documentation missleading?

Console output

C:\source\ConsoleFortran>msbuild
MSBuild version 17.6.3+07e294721 for .NET Framework
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 9/27/2023 11:44:13 AM.

Project "C:\source\ConsoleFortran\ConsoleFortran.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|x64".
Project "C:\source\ConsoleFortran\ConsoleFortran.sln" (1) is building "C:\source\ConsoleFortran\ConsoleFortran.vfproj.metaproj" (2) on node 1 (default targets).
C:\source\ConsoleFortran\ConsoleFortran.vfproj.metaproj : warning MSB4078: The project file "ConsoleFortran.vfproj" is not supported by MSBuild and cannot be built.
Done Building Project "C:\source\ConsoleFortran\ConsoleFortran.vfproj.metaproj" (default targets).

Done Building Project "C:\source\ConsoleFortran\ConsoleFortran.sln" (default targets).


Build succeeded.

"C:\source\ConsoleFortran\ConsoleFortran.sln" (default target) (1) ->
"C:\source\ConsoleFortran\ConsoleFortran.vfproj.metaproj" (default target) (2) ->
(Build target) ->
C:\source\ConsoleFortran\ConsoleFortran.vfproj.metaproj : warning MSB4078: The project file "ConsoleFortran.vfproj" is not supported by MSBuild and cannot be built.

Used packages:

vs_BuildTools_LTSC_17.6.exe

w_BaseKit_p_2023.2.0.49396_offline.exe

w_HPCKit_p_2023.2.0.49441_offline.exe

Labels (1)
0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
3,352 Views

The Intel Fortran build system is not supported by msbuild, you must use devenv to invoke it.  The reference to using Visual Studio Build Tools refers to using the ifort/ifx commands, not msbuild.

View solution in original post

12 Replies
Steve_Lionel
Honored Contributor III
3,353 Views

The Intel Fortran build system is not supported by msbuild, you must use devenv to invoke it.  The reference to using Visual Studio Build Tools refers to using the ifort/ifx commands, not msbuild.

u12
Beginner
3,338 Views

Thanks a lot for the fast answer!


I was afraid of that after reading all existing old posts about msbuild. I had some hope when seeing the linked entry in oneapi-fortran-compiler-system-requirements.html , but this would mean that I have to introduce a second parallel build system like make/cmake or meson to do the command line build (e.g. Get Started on Windows documentation )

0 Kudos
Devorah_H_Intel
Moderator
3,345 Views

See Get Started on Windows documentation 

For building applications with full IDE functionality, including debugging and development, you must have a supported version of Microsoft Visual Studio* installed. To build applications using command-line tools only, you must have a supported version of Build Tools for Visual Studio installed. For all versions, Desktop development with C++ support must be selected as part of the Visual Studio or Build Tools installation.

 

0 Kudos
Steve_Lionel
Honored Contributor III
3,271 Views

Is there a reason you can't use msdev to initiate the build from the command line?

0 Kudos
tobias-loew
Novice
1,446 Views

Yes, there are reason: e.g. building a VisualStudio solution (sln) from an Azure pipeline. The default command invokes MsBuild on the target machine, which cannot compile vfproj-projects. Building solutions with vfproj-projects requires manual adjustments in the pipeline-file, and also a VisualStudio (incl. a license for it) on the agent.

0 Kudos
tobias-loew
Novice
1,361 Views

Furthermore, Intels C++ projects are MSBuild-compatible. So, where is the problem, taking the C++ integration and creating a Fortran version from it? 

With the ifx-compiler, Intel got a cool new frontend, so please also make the VS-integration cool!

0 Kudos
Devorah_H_Intel
Moderator
1,349 Views

In the screenshot above, Microsoft C++ Build Tools is listed. How is it different from Visual Studio Build Tools?

Per System Requirements - Visual Studio Build Tools* 2022 is supported. (See Development Environment part)

 

 

0 Kudos
tobias-loew
Novice
1,286 Views

In the screenshot, we see the MSBuild is not capable of building "vfproj"-projects, because it does not understand the xml-schema.

"vfproj"-projects use the old "VisualStudioProject" schema (XSD Schema for Project Files | Microsoft Learn), which was also used for vcproj-projects (predecessor of vcxproj).

The logic for "VisualStudioProject"s is build into the "devenv.exe" and NOT into MSBuild. Thus, compiling a solution with vfproj-projects from Visual Studio or a command line with devenv.exe works fine, while using MSBuild.exe results in the error from above.

 

The statement here Intel® Fortran Compiler for oneAPI System Requirements

  • To use command-line tools only to build Intel® 64 architecture applications these versions are supported:
    • Visual Studio Build Tools* 2022
    • Visual Studio Build Tools* 2019

is IMHO wrong. Here is a screenshot from Visual Studio Installer:

tobiasloew_0-1723617278701.png

which clearly states, that it is MSBuild-based. (I also checked: Visual Studio Build Tools does not install "devenv.exe")

 

 

0 Kudos
Devorah_H_Intel
Moderator
1,257 Views

@tobias-loew wrote:

In the screenshot, we see the MSBuild is not capable of building "vfproj"-projects, because it does not understand the xml-schema.

"vfproj"-projects use the old "VisualStudioProject" schema (XSD Schema for Project Files | Microsoft Learn), which was also used for vcproj-projects (predecessor of vcxproj).

The logic for "VisualStudioProject"s is build into the "devenv.exe" and NOT into MSBuild. Thus, compiling a solution with vfproj-projects from Visual Studio or a command line with devenv.exe works fine, while using MSBuild.exe results in the error from above.

 

The statement here Intel® Fortran Compiler for oneAPI System Requirements

  • To use command-line tools only to build Intel® 64 architecture applications these versions are supported:
    • Visual Studio Build Tools* 2022
    • Visual Studio Build Tools* 2019

is IMHO wrong. Here is a screenshot from Visual Studio Installer:

tobiasloew_0-1723617278701.png

which clearly states, that it is MSBuild-based. (I also checked: Visual Studio Build Tools does not install "devenv.exe")

 

 


Thank you for the clarification and feedback on the documentation! I will investigate and update as needed. 

0 Kudos
IanH
Honored Contributor III
1,235 Views

I think the documentation is ok - but there's just confusion about what "command-line tools" are being referenced. 

You can install and run and successfully generate executables using the command line ifort/ifx drivers if you have only the Visual Studio Build Tools installed.  This is handy when setting up automated build machines on Windows that use some custom build system (meson/make/direct invocation of ifx etc).  Those build tools provide things like the C++ runtime libraries and Windows linker, which the ifort/ifx command line drivers need (i.e. the Intel Fortran command line drivers require things provided by the build tools, those things are also provided by Visual Studio itself).

But that doesn't mean that installing the build tools magically makes Intel Fortran projects MSBuild-based applications.  Otherwise just installing Visual Studio itself (which is a ginormous superset of the build tools) would have similar magic.

"Please consider 'upgrading' (it's a big change) the Windows Fortran project integration to be msbuild compatible" is a reasonable feature request though.

tobias-loew
Novice
1,186 Views

You can install and run and successfully generate executables using the command line ifort/ifx drivers if you have only the Visual Studio Build Tools installed..

Then I would recommend to mention, that building vfproj-projects with just "Visual Studio Build Tools" resp. "MSBuild" is not possible.

 


"Please consider 'upgrading' (it's a big change) the Windows Fortran project integration to be msbuild compatible" is a reasonable feature request though.

Intel already did it for C++, so there is a blue-print for it. I hope, they will give it a try!

 

Just an additional problem with the current integration:

The ui for vfproj-projects behaves sometimes awkward, when selecting

- multiple projects

- multiple configurations/platforms

and editing them, especially for multi-line text fields.

 

 



Devorah_H_Intel
Moderator
1,141 Views

Thank you for the feedback, @tobias-loew. I will relay all your points to our Visual Studio Integration engineering team.

Please be aware that our top priority is to stay current with Microsoft Visual Studio's regular updates, ensuring that our compilers maintain seamless integration with the IDE.

0 Kudos
Reply