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

msbuild and project files

Les_Neilson
Valued Contributor II
2,579 Views

We currently use batch files to do an overnight rebuild of our whole system. There is a master batch filewhichcalls other batch files to (a) first build modules and libraries used by the rest of the system, then (b) build the executables. Each batch file traverses the source tree relevant to its area of interest running local batch files in each directory This allows us to build a subset of thesystem if only something within that part has changed.

Local batch files run "devenv" on the solution for both debug and release.

I have been asked to look at using "msbuild" as a possible replacement for "devenv" but it appears msbuild only works with C/C++/C# (and presumably VB) project files. When I run it on a mixedC and Fortran project I get an error message :


D:\dev_les\code\mark>msbuild mark.sln
Microsoft Build Engine Version 3.5.21022.8
[Microsoft .NET Framework, Version 2.0.50727.1433]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 20/10/2008 14:41:26.

Project "D:\dev_les\code\mark\mark.sln" on node 0 (default targets).
Building solution configuration "Debug|Win32".

D:\dev_les\code\mark\mark.sln.cache : warning MSB4078: The project file
"data\data.vfproj" is not supported by MSBuild and cannot be built.

Is it a problem with msbuild or with our vfproj files ?

Les

0 Kudos
8 Replies
Steven_L_Intel1
Employee
2,579 Views

msbuild does not support Fortran projects. You will have to continue use of devenv.

0 Kudos
Steve_Nuchia
New Contributor I
2,579 Views

msbuild does not support Fortran projects. You will have to continue use of devenv.


We are using a heavily modified version of the DevEnv custom MSBuild task from Aaron Hallberg's blog at Microsoft to supervise a command-line build. It has been a long hard battle to get our mixed-language solution working the way I want it to on the build server but I'm there now.

I also think I understand enough about how MSBuild thinks to suggest that one could potentially hack in support for one version of the fortran compiler / project file formatin a few weeks. One blogger started from a .csproj and analyzed how it was structured and created a project template for msbuild project file development. You'd need a custom task to parse the .vfproj and one derived from ToolTask to drive the compiler but neither would be rocket science. The hard part is penetrating the maze of incredibly bad documentation that defends the MSBuild tower from such attacks.

Unless you've got a good reason to persue the second option, I'd go with the first. My modifications to DevEnv focus on supporting parallel builds; if that's not important it should work for you out-of-the-box. You can turn off the parallel build feature of the IDE on a multicore machine by firing up the IDE as the build user and setting Tools -> Options -> Projects and Solutions -> Build and Run -> Maximum Parallel Projects mumble to 1, then exiting.

If you need parallel builds, I've submitted my version to the new community build tasks project at http://code.msdn.microsoft.com/KB957196but I don't know how long the review cycle is.

0 Kudos
Steve_Nuchia
New Contributor I
2,579 Views
To more directly address your situation: unless there's a good reason to use MSBuild I'd skip it. Upgrading from batch files to powershell scripts I can see but unless you're going to use the Team Build infrastructure (which is pretty cool once you get it working) I'd skip msbuild. One day it will be, like SQL, a mistake carried through to perfection but today it's just a mistake.

0 Kudos
Steve_Nuchia
New Contributor I
2,579 Views
0 Kudos
Les_Neilson
Valued Contributor II
2,579 Views
To more directly address your situation: unless there's a good reason to use MSBuild I'd skip it. Upgrading from batch files to powershell scripts I can see but unless you're going to use the Team Build infrastructure (which is pretty cool once you get it working) I'd skip msbuild. One day it will be, like SQL, a mistake carried through to perfection but today it's just a mistake.

Thanks. The reason I was asked to look at msbuild was because often our overnight batch build would stop part way through, usuallyafter building a debug exe and before building the release version. The dialog box would appear saying that devenv had encountered a problem and needed to restart, and did we want to send a report to Microsoft. Un-checking the box to restart the ide and clicking "don't send" closes the dialog and the batch process continues on its merry way.
We wondered whether msbuild would be more stable. (plus a colleague has been asked to look at the Team Build option)

BTW this batch interruption would occur with VS 2003, 2005 and now 2008. We have never been able to identify the cause.

Les

0 Kudos
Steve_Nuchia
New Contributor I
2,579 Views
Quoting - Les Neilson

Thanks. The reason I was asked to look at msbuild was because often our overnight batch build would stop part way through, usuallyafter building a debug exe and before building the release version. The dialog box would appear saying that devenv had

That's one of the reasons it's been a long hard battle for us. command-line builds didn't work at all for us due to a dynamic dependency bug that was crashing devenv pre-SP1. That one was Microsoft's but we're pretty sure the one you're describing is Intel's bug. It happens only when closing a solution containing fortran projects, apparently, and the stack trace points to the fortran integration dll.

My mofified devenv driver checks for the build summary output line and ignores the exit code from devenv if it shows no failed projects. That and some aggressive disabling of Doctor Watson and his friends has made our builds (finally!) popup-free.

0 Kudos
mwpowell
Beginner
2,579 Views
Any updates along these lines? I read somewhere you could feed MSBuild the toolset you wanted to use and let it use the Fortran compiler? Point being, what do you suppose DevEnv is using underneath the hood? At some level, MSBuild. DevEnv is simply sugar on top.
0 Kudos
Steven_L_Intel1
Employee
2,579 Views
Visual C++ uses MSBUILD, but Fortran projects do not. I have heard discussion of adopting MSBUILD for Fortran in the future, but this would be some time out if it happened. You'd lose the nice build log you get from Fortran now, MSBUILD is very messy in what it leaves behind for logs.
0 Kudos
Reply