Skip to content
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

Closed

Conversation

achirkin
Copy link
Contributor

Enable (s)ccache when found in $PATH to speed up builds, preferring sccache over ccache.

@achirkin achirkin requested a review from a team as a code owner May 16, 2022 08:16
@achirkin achirkin added 3 - Ready for Review improvement Improvement / enhancement to an existing function non-breaking Non-breaking change and removed cpp CMake labels May 16, 2022
##############################################################################
# - Setup cache --------------------------------------------------------------

find_program(CCACHE sccache NAMES sccache ccache)
Copy link
Contributor

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.

Copy link
Contributor Author

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)?

Copy link
Contributor

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:

  1. 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>

  2. 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.

@github-actions
Copy link

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review improvement Improvement / enhancement to an existing function inactive-30d non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants