-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Added ccache speedup compilation #7105
base: main
Are you sure you want to change the base?
Conversation
Please sign your commit ( |
What kind of speedup did you see? Was there any speedup on an initial build, or only on subsequent builds? |
Yep, more effective recompilation after checkout branches. |
How much speedup? Our CI does not have ccache installed, based on the cmake output in the logs. It wouldn't have any effect on CI anyway since that's a single compilation. |
You're right, it doesn't apply to CI, it's convenience for developers. |
on most Linux distros where ccache is installed, it does get used automatically: git clone https://github.com/gnuradio/gnuradio
mkdir gnuradio/build-defaultconfig
cd gnuradio/build-defaultconfig
cmake ..
grep CMAKE_CXX_COMPILER CMakeCache.txt yields CMAKE_CXX_COMPILER:FILEPATH=/usr/lib64/ccache/c++
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib
//ADVANCED property for variable: CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 without any further ado (on Fedora). You also want to have a definitive way to disable it, as well. I'm not sure on which systems this is actually needed, so I'm kind of sceptical it's generally a good idea; we'd really need a killswitch to disable it in the face of compiler and linker trouble, or when you just don't want to use ccache, because you know this is going to be a modified one-off build. |
By the way, @willcode:
Definitely on my to-do list, we could (after adding ccache to the CI builders) have a CI run that we execute once per push to maint-3.10 or main, which then gets pushed as artifact; all the regular CI runs would first download and extract the ccache before running the build. |
I've seen it get picked up automatically in the past, too. @GermanAizek ccache is not used automatically on your distro? Which one is that? I actually stopped using ccache when SSDs first came out and were pretty small, since the cache was always using up a lot of space. Haven't tried it again recently. |
I have been also using |
Unclear whether this is needed on most systems, and DCO (git signoff) missing, so changing to draft for now. |
Debian and FreeBSD |
Debian? Interesting! So, we're now a bit on a crossroads:
In both cases the current form of the PR isn't going to get us where we want! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, won't do; this needs to respect an already defined CMAKE_{LANGUAGE}_COMPILER_LAUNCHER
Description
More effective helped after compilation checkout branches.
More information on https://ccache.dev