-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fpm recompiles the whole project when a line is modified #967
Comments
I was surprised to read this and I haven't used fpm in several weeks so I went back to look. What I observe is actually that if I change one source file (but not changing a procedure interface), fpm rebuilds only the sources that depend on the module(s) in that source file (as opposed to the whole project). This makes sense to me assuming that fpm is only checking if a source file has changed, rather than actually analyzing the source to determine if an interface has changed. Indeed, doing the same experiment with CMake, sources that depend on that file are not recompiled (if an interface hasn't changed, as you wrote). |
To do so, you will have to use |
I don't use submodules (I personally do not find them useful, I prefer to just write my functions in a regular module, it's less code and I have all the code in one place). CMake looks at the mod file, if it changed, it will assume the interface changed and it will recompile. This does not work with all compilers. For example Intel apparently embeds a timestamp in it, so cmake always recompiles. LFortran stores all the code in the mod file, so the file also always changes. I think that this points to a broader issue: the build system must cooperate with the compiler. For example, LFortran could generate just the interface part, so that cmake could check it if it changed. Possibly it can just output a hash of the interface part, that would be easily to deal with. |
On the other hand, cmake only recompiles the given module (if not function interface was changed) and links everything together, so things are much faster.
So this is a big usability deterioration compared to cmake.
The text was updated successfully, but these errors were encountered: