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

Repeated compilation of same files in a CVF project

amystid
Beginner
653 Views
Hi,
Ihave an annoying, but admittedly not critical, issue with the Compaq Visual Fortran compiler.
When the compiler is compiling my project, it often has to loop back and re-compile files that have already been compiled earlier in this compilation. Also, once the exe has been created, if I then compile the project again straight away (i.e. without making any code changes), it re-compiles a load of files again. I sometimes have to compile the project 4 or 5 times before CVF seems to accept that the exe contains the latest compiled files. I have noticed that this problem is worsening as Iconvert more and more of my codeto modules in my project.
Is there something I can do in my coding to help this problem or is it a compiler issue? It means a full compilation is taking at least twice as long as I would have thought it should do.
Any ideas anyone?
0 Kudos
2 Replies
onkelhotte
New Contributor II
653 Views
Do the modules depend on each other?
Ive had a similar problem: module a used module b. When I compiled the code, the compiler compiled module a before b. Since b wasnt compiled, a wasnt compiled too. And so every subroutine that uses a wont workuntil b was compiled. In the second run a comiled and the other subroutines too.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
653 Views
Basically, it's a compiler issue (more precisely, the issue of dependency analyser component integrated within Visual Studio). It is very quirky.

Semi-practical quick solution: you can interrupt the compilation (Ctrl+Break) after a number (determined empirically) of "low-level" modules has been compiled. Then hit F7 again (and repeat the process if necessary).

If I recall correctly, the dependency analyser has a limit of 3 depth levels. That means that:

module m1
module m2
use m1
end module m2
module m3
use m2
end module m3
module m4
use m3
end module m4
will always be rebuilt twice if you change anything in m1. If you reduce the depth dependency tree, you will get better results.

Some CVF document (can't find it right now) recommended even moving "low-level" modules into a static library, and making the rest dependent on that library (plus, adjusting module/INCLUDE paths).

All of those are workarounds rather than real solutions -- but, basically, that's the state of affairs.
0 Kudos
Reply