-
Notifications
You must be signed in to change notification settings - Fork 197
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
Use sccache or ccache when available #651
Use sccache or ccache when available #651
Conversation
############################################################################## | ||
# - Setup cache -------------------------------------------------------------- | ||
|
||
find_program(CCACHE sccache NAMES sccache ccache) |
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.
This should be a build.sh
option and not something that implicit runs on a machine. We shouldn't presume that a user of RAFT that has both sccache and ccache always wants sccache.
As discussed here: rapidsai/cuml#4534 (comment) The option to control this should be allow the user to specify which tool they want when using build.sh
. For users that aren't using build.sh
they can use the CMake supported enviornment variables to control this if they don't want to specify them on the command line.
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.
Thanks for pointing this out for me! I'd be happy to add similar flags in this PR. Is there any fundamental reason to not enable one of the tools by default (if no flags/env vars specified)?
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.
Yes we shouldn't infer intent from the lack of setting the compiler launcher. For a couple of reasons:
-
Both ccache and sccache also support the use case when they are the actual compiler provided to CMake. This pattern is used by developers and package managers. When this is happening and you have ccache/sccache as the compiler launcher you get errors as both don't support a syntax of
ccache <ccache-symlink>
-
At times developers need to benchmark the compile time cost / improvement of a change. By automatically injecting a ccache / sccache into the the compile line it will break presumptions of actual performance.
This PR has been labeled |
Enable (s)ccache when found in $PATH to speed up builds, preferring sccache over ccache.