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

How to get information on why file is being recompiled

CoryG
Novice
418 Views

I'm using VS 2019 with IFX (the same issue shows up with IFORT). I have added some Fortran files to the solution, and for some reason, these files are recompiled every time I run even when I have made no changes to any file in the solution.

Looking around, I found websites like this (https://michaelscodingspot.com/visual-studio-keeps-rebuilding-projects-no-good-reason/) that suggest "In your solution, go to Tools -> Options. Choose Projects and Solutions -> Build and Run and select Diagnostic in “MSbuild project build ouput verbosity”." That then adds information to the build output that can be used to debug. However, this seems to be a C/C++ only option, because it has no effect on the build output from the Fortran project in my solution.

Is there a way to make IFX/VS tell me why it's choosing to recompile a given file? Or at least give me more information on what it's doing?

0 Kudos
7 Replies
jimdempseyatthecove
Honored Contributor III
326 Views

The recompile issue as you have described is symptomatic of:

a) improperly listed build dependencies

b) circular (module) references

c) dependency on a file that is not created by the build

d) (related to c) incorrect/missing settings in the Configuration Manager: missing Build check and/or solution configuration and/or Platform

 

If all else fails to resolve the issue, then recreate the Solution and Projects.

 

Jim Dempsey

0 Kudos
CoryG
Novice
275 Views

a) Is there any way to see/edit how Visual Studio is determining build dependencies?

b) I double-checked and the module file that keeps getting recompiled and its corresponding submodule aren't dependent upon anything.

c) I don't think this is it, given my answer to b). But I may be misunderstanding you.

d) Could you elaborate on this one?

0 Kudos
Steve_Lionel
Honored Contributor III
321 Views

As far as I know, there is no user-visible insight into the dependency checking process.

0 Kudos
andrew_4619
Honored Contributor III
296 Views

If you do a clean and a full build does it always fail to build the first time? That is a sure sign of circular dependency. The thing that fails is part of the circle.

0 Kudos
CoryG
Novice
275 Views

No that's the odd thing. A clean build always passes, and then a subsequent build will still want to recompile those files.

0 Kudos
Steve_Lionel
Honored Contributor III
265 Views

No to a)

0 Kudos
andrew_4619
Honored Contributor III
234 Views

I have had this type of problem in the past (some years back) and found:

1) In one instance remaking the VS project using the source files  fixed the problem but I did not work out how or why.

2) I one had a problem that persisted for several months  which I spend a lot of effort on but could find no reason why. I did extensive checking for circular dependencies and found none. I "fixed" it eventually by splitting a specific source file into two parts. There was no reason evident why that worked, I assumed it was some bug in dependency checking that had its "trigger" removed.

 

Sorry I can't offer any ideas. Reading your initial post, does it recompile everything or just a specific set of files? Do you use include files? How many files does the project have? Is everything in modules or sub-modules or do you have a mix with "external" routines? Just asking questions to maybe get some ideas. 

 

Also is this relevant?

https://community.intel.com/t5/Intel-Fortran-Compiler/Issue-with-Dependency-Checker/td-p/1523866

0 Kudos
Reply