[CMake] incremental build slow because of F90 (cmake_copy_f90_mod)

Verweij, Arjen VerweijA at tass-safe.com
Mon Jul 12 13:23:05 EDT 2010

Hi Brad,

>Actually the copy-f90-mod step is a *feature* to make incremental
>rebuilds faster.  It is an optimization for the case that the .f90
>source file that provides a module gets recompiled but the *interface*
>to the module does not change.  Many compilers update the timestamp
>on the .mod file anyway.  In this case we do not want all the sources
>that use the module to recompile needlessly.  The copy-f90-mod step
>copies the .mod file to a module timestamp file in a way that does
>not modify the timestamp unless the module really changed.

Cmake_copy_f90_mod gets called every time I type make for (as far as I can tell) every F90 file that provides a module. So for instance I change a comment in my main.f, the compile and linktime for the executable (4000 ish files) NOT including the time spent in the F90 portion of the tree is <5 seconds, but the F90 part takes a minute.

I don't see any recompiling going on for the F90 part. Does cmake_copy_f90_mod get called even if you don't have to compile any F90 files?


More information about the CMake mailing list