Hi,
I make a lot of use of modules but am having real issues with the compiler needing to re-compile every program unit that uses a module when I make even the slightest change to it that does not affect the interface - this makes extensive use of modules very difficult in a large program. The FTN95 help states that 'If a module is changed in a way that does not affect the interface then program units that use that module do not need to be recompiled' (at the bottom of the 'Fortran 95 language overview/Modules' page). If this really is true, can anyone tell me why it doesn't appear to be working in the example below - here I have one module and one program unit in 2 files. Whenever I change anything in the module (eg. adding an extra . to the 'hello world' string), the entire program recompiles...
Thanks, Alan Williams
! File Module1.f90 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Module dependency test - The Module module Module1
interface subroutine OutputStuff() end subroutine OutputStuff end interface
contains
! Output a message subroutine OutputStuff() write(,) 'Hello world.......' end subroutine OutputStuff
end module Module1
! File ModuleDepTest.f90 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Module compilation dependency test program ModuleDepTest use Module1 ! any change causes recompile
write(,) 'Testing module compilation depencies' call OutputStuff() end program ModuleDepTest