Skip to content

Performance issue with "fpm build" #554

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

Closed
oyvindyr opened this issue Sep 2, 2021 · 2 comments
Closed

Performance issue with "fpm build" #554

oyvindyr opened this issue Sep 2, 2021 · 2 comments

Comments

@oyvindyr
Copy link

oyvindyr commented Sep 2, 2021

First of all: Thank you for your effort in making it easier to build Fortran programs!

I have started experiencing with fpm and have made a small fpm project that depends on stdlib. I know fpm does not yet support building of stdlib and pre-processed code (fypp) in general. So I made a branch of stdlib where I generate .f90 files of all the .fypp files and let my project depend on this branch instead. I included a minimal .toml file and run "fpm build". At first I got an out-of-memory error in gfortran that I resolved by setting the MAXRANK parameter to 4 in common.fypp. Then it works!

As expected, building everything takes quite some time. But it also takes some time (about 10 seconds) before the compilation starts. Running fpm build again (without modifying any source code) takes again about 10 seconds before finishing, without any compilation taking place. I tried to replace the dependency to the git branch with a dependency to a local folder, but that did not help the performance issue.

Is it the reading of all source files to sort out the dependencies that takes time? If so, it should perhaps be possible to tell fpm that no dependencies have changes since the last build? That would be useful when only making changes within a subroutine.

I am running windows.

@zoziha
Copy link
Contributor

zoziha commented Sep 2, 2021

If you use the latest fpm0.4.0, you should be able to feel the increase in compilation speed. The problem you mentioned is resolved in #507.

Regarding stdlib's fpm support, I submitted a PR to stdlib yesterday, considering using github-ci to build the stdlib-fpm branch, see fortran-lang/stdlib#508.

@oyvindyr
Copy link
Author

oyvindyr commented Sep 2, 2021

Thats great! I tried fpm0.4.0 now and it is much faster indeed:-)

@oyvindyr oyvindyr closed this as completed Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants