Developers: fast build, without recompiling dependencies?

Sergey Chulkov sergeya... at
Mon Aug 29 12:01:39 UTC 2016

Hi Rustam,

this problem may be caused by your Fortran compiler.

The current rebuild strategy is to recompile all source files that depend 
on a modified module (.mod) file. Each Fortran module file contains public 
API that the corresponding source file exports and ideally should be 
updated only when you change such API (e.g. prototype of public functions, 
structure of public derived types, public generic interfaces, etc.). If the 
only thing you do is to tweak the body of a public function without 
changing its prototype, the compiler should only update the relevant object 
(.o) file, so no dependent files will be recompiled. At least the latest 
gfortran acts this way.

Best wishes,


On Thursday, August 25, 2016 at 2:44:35 PM UTC+1, Rustam wrote:
> CP2K developers,
> Is the any way to build exe without recompiling ALL dependencies?
> A couple of years ago the standard make target did not recompile all 
> dependencies. As a result minor code modifications recompiled fast. Now, 
> make carefully creates a list of all dependencies and recompiles all of 
> them. Nice safety feature but recompiling minor local changes seems to take 
> forever, debugging becomes a major pain.
> Is there any make TARGET that can build exe by recompiling only the 
> modified files and their corresponding libraries?
> Thanks,
> Rustam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the CP2K-user mailing list