metomi / fab

Flexible build system for scientific software

Home Page:https://metomi.github.io/fab/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IFort module file changes even though API hasn't

MatthewHambley opened this issue · comments

IFort regenerates the module file every time it is invoked even if the interface which it represents has not. Since the file includes a time stamp this means that from Fab's point of view the file changes with every compile. This will kick of a rebuild cascade.

To be clear, Intel considers this correct behaviour although other compiler vendors and certainly this user disagree. That means this behaviour will not be changed. It is not currently clear whether OneAPI Fortran compiler behaves the same way.

It may be possible to work around this behaviour by zeroing out the timestamp after compilation.

See https://stackoverflow.com/questions/20421163/why-mod-files-differ-after-every-time-i-compile-a-f-file

One potential solution is to zero out the timestamp in the module file after it has been built. This will mean that the module files don't change their content if only the timestamp has changed.

The potential wrinkle is if this interferes with subsequent compilation or linking. If that is the case then something more elaborate involving re-instating the previous timestamp will be needed.