-
Notifications
You must be signed in to change notification settings - Fork 311
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
[All] Accelerating CMake generation #1464
Merged
fredroy
merged 5 commits into
sofa-framework:master
from
SofaDefrost:pr-accelerate-cmake
Aug 28, 2020
Merged
[All] Accelerating CMake generation #1464
fredroy
merged 5 commits into
sofa-framework:master
from
SofaDefrost:pr-accelerate-cmake
Aug 28, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
damienmarchal
added
enhancement
About a possible enhancement
pr: status to review
To notify reviewers to review this pull-request
labels
Aug 26, 2020
To keep cmake generation time low.
damienmarchal
added a commit
to SofaDefrost/sofa
that referenced
this pull request
Aug 27, 2020
Can't wait to test this today! Awesome idea! |
With my laptop i7-8850H, cpufreq at around 4.1 GHz: sofa-framework:master same options: Thank you sir! |
marques-bruno
approved these changes
Aug 27, 2020
So it work |
fredroy
added
pr: fast merge
Minor change that can be merged without waiting for the 7 review days
pr: status ready
Approved a pull-request, ready to be squashed
and removed
pr: status to review
To notify reviewers to review this pull-request
labels
Aug 28, 2020
guparan
changed the title
[all] Accelerating CMake generation
[All] Accelerating CMake generation
Jan 18, 2021
bakpaul
pushed a commit
to bakpaul/sofa
that referenced
this pull request
Feb 23, 2024
* [SofaMacro] Add the protecting guard & a new @PACKAGE_GUARD@ for .in * [all] Add protecting guard in every .cmake file * [all] Add @PACKAGE_GUARD@ in every .in file so it is expanded to a fully working guard. * [all] Add in every cmake.in the macro @PACKAGE_GUARD@ To keep cmake generation time low. * [all] Use the CMake include_guard() instead of our custom version.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
About a possible enhancement
pr: fast merge
Minor change that can be merged without waiting for the 7 review days
pr: status ready
Approved a pull-request, ready to be squashed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The cmake part of our build process is very slow and is getting slower and slower the more we add plugins/modules and packages.
I noticed that commands like include or find_package(XXXXX) imply the search, the loading and the execution of the requested package XXXX each time.
This is very problematic as this scale in an horrible (non linear) way.
So I tried a quick and dirty fix based on inclusion gard, 'à la #ifdef MYFILE_H'. I first checked if the file are really loaded multiple times (and this was the case) and implemented a quick test to stop the loading.
The fix accelerates a lot the cmake time on my machine reducing the generation from 1min20 down to 15 sec. So I'm curious to see if such solution is reliable enough to be used (I consider that if this is not the default design of cmake package there must be a rational behind) and what are the possible drawback.
This PR:
Reviewers will merge only if all these checks are true.