Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Makefile rule $(RM) $@ $*.mod causes unnecessary compilations #1280

Open
matthewhoffman opened this issue Mar 28, 2017 · 1 comment
Open
Labels

Comments

@matthewhoffman
Copy link
Member

MPAS Makefiles include this line:

.F.o:
        $(RM) $@ $*.mod

which causes the *.o and *.mod files to be deleted before they are compiled. This forces every source file in a directory to be re-compiled at each invocation of make, leading to a lot of unnecessary compilation in some situations. I believe this is related to issue with Fortran .mod files and make, e.g.:
http://lagrange.mechse.illinois.edu/f90_mod_deps/
and it does not appear that there is a simple solution, but I'm curious if it is possible to improve the current implementation.

@matthewhoffman
Copy link
Member Author

Note: one possible solution is to use Fortran 2008 submodule files, which are similar to C header files, e.g.:
https://software.intel.com/en-us/articles/fortran-2008-submodule-support-in-intel-fortran-compiler
However, from what I hear from a reputable source, they don't work with XLF.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant