- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a reason you can't use msdev to initiate the build from the command line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
which clearly states, that it is MSBuild-based. (I also checked: Visual Studio Build Tools does not install "devenv.exe")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page