Stale Program Units

When a program unit, M1, uses a module, M2, the compilation of M1 is up-to-date if it occurred after the latest compilation of M2. Otherwise, module M1 is stale and may require recompilation. Stale program units often occur in large-scale development. They are detected and flagged both by the compiler and by the binder. A typical scenario involves at least three sources, file1.f, file2.f and file3.f, and a compilation sequence as shown in the following example.

Example of Compilation Sequence without a Stale Program Flag

file1.f
module mod1
    :
end module mod1
file2.f
module mod2
    :
 use mod1
    :
end module mod2
file3.f
program p
    :
 use mod2
    :
end program p

The table that follows shows the compilation sequence for IA-32 applications without and with issuing the stale program flag. The same sequence is used for Itanium-based applications with the efc driver instead of ifc. The left column reflects a small-scale project with the program files compiled in proper order. The right column reflects possibly a larger-scale program compilation. Program P had been compiled with the binder option, -bd, right after file1.f had been edited and recompiled, while file2.f (which uses mod1 from file1.f) had not been recompiled. In such a case, the binder flags the module mod2 as stale and issues a message. The programmer then has to recompile mod2.

Stale Program Flag

No Stale Program Flag

Stale Program Flag Issued

edit file1.f etc

ifc -c file1.f

ifc -c file1.f

ifc -c file2.f

ifc -c file2.f

ifc -c file3.f

ifc file3.f

edit file1.f

 

ifc -c file1.f

 

ifc -bd, P 3