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

doc: dev add a note about ccache #14478

Merged
merged 1 commit into from May 9, 2017

Conversation

Projects
None yet
4 participants
@theanalyst
Member

theanalyst commented Apr 12, 2017

Signed-off-by: Abhishek Lekshmanan abhishek@suse.com

@theanalyst theanalyst requested review from , smithfarm and tchaikov Apr 12, 2017

@ghost

ghost approved these changes Apr 12, 2017

Using ccache to speed up local builds
-------------------------------------
`ccache`_ can speed up rebuilds significantly, since `make clean` is a common

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor
s/`make clean`/``make clean``/

This comment has been minimized.

@theanalyst

theanalyst Apr 12, 2017

Member

ah the markdown -> rst stuff, there are few others too in the pr, I'll get this

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor

also, "so" or "hence" would be better than "since" in this context

This comment has been minimized.

@theanalyst

theanalyst Apr 12, 2017

Member

I thought I'll mention how to do clean rebuilds as well
See this:

Rebuilds of the ceph source tree can benefit significantly by using `ccache`_.
Many a times while switching branches and such, one might see build failures for
certain older projects mostly due to older build artifacts. These rebuilds can
significantly benefit the use of ccache. For a full clean source tree, one could
do ::

  $ make clean

  # note the following will nuke everything in the source tree that
  # isn't tracked by git, so make sure to backup any log files /conf options

  $ git clean -fdx; git submodule foreach git clean -fdx

This comment has been minimized.

@theanalyst

theanalyst Apr 12, 2017

Member

s/projects/branches

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor

@theanalyst Looks good; just one nit: "These rebuilds can significantly benefit from the use of ccache."

This comment has been minimized.

@theanalyst
enough developer practice. ccache is available as a package in most distros.
It is recommended to set symlinks to ccache to your compiler for speeding up
all builds. This can be done by symlinking ccache to the compiler, assuming
ccache is installed & in `/usr/bin/ccache` ::

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor
s#`/usr/bin/ccache`#``/usr/bin/ccache``#

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor

can you also change this:

OLD: "assuming ccache is installed & in `/usr/bin/ccache`"

NEW: "assuming ccache is installed and the binary is in the standard location `/usr/bin/ccache`

This comment has been minimized.

@theanalyst
$ ln -s /usr/bin/ccache /usr/local/bin/c++
for more details refer to the `run modes`_ in the ccache manual. The default
settings of `ccache` can be displayed with `ccache -s`. It is recommended to

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor
s/`ccache`/``ccache``/
s/`ccache -s`/``ccache -s``/

This comment has been minimized.

@theanalyst
@smithfarm

This comment has been minimized.

Contributor

smithfarm commented Apr 12, 2017

@theanalyst Thanks, looks great. Just some minor nits.

@smithfarm

Thanks, looks great - just some minor nits

enough developer practice. ccache is available as a package in most distros.
It is recommended to set symlinks to ccache to your compiler for speeding up
all builds. This can be done by symlinking ccache to the compiler, assuming
ccache is installed & in `/usr/bin/ccache` ::

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor

can you also change this:

OLD: "assuming ccache is installed & in `/usr/bin/ccache`"

NEW: "assuming ccache is installed and the binary is in the standard location `/usr/bin/ccache`
$ ln -s /usr/bin/ccache /usr/local/bin/cc
$ ln -s /usr/bin/ccache /usr/local/bin/c++
for more details refer to the `run modes`_ in the ccache manual. The default

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor

the "run modes" section of the ccache manual

This comment has been minimized.

@theanalyst
by symlinking ccache to the compiler, assuming ccache is installed and the
binary is in the standard location ``/usr/bin/ccache`` ::
$ ln -s /usr/bin/ccache /usr/local/bin/gcc

This comment has been minimized.

@tchaikov

tchaikov Apr 12, 2017

Contributor

to build ceph with ccache, one can:

cmake -DWITH_CCACHE=ON ..

to enable the cmake build without pointing gcc/g++/cc/c++ to ccache.

This comment has been minimized.

@smithfarm

smithfarm Apr 12, 2017

Contributor

@tchaikov That's a cmake-only feature, though, right? Not available for autotools builds?

This comment has been minimized.

@tchaikov

tchaikov Apr 12, 2017

Contributor

yes. for automake, one can just use make CC='ccache gcc' CXX='ccache g++', that's a less intrusive way which works even if you don't have the root access of the building host.

This comment has been minimized.

@theanalyst

theanalyst Apr 12, 2017

Member

hmm alright I'll add these options as well

This comment has been minimized.

@liewegas

liewegas Apr 25, 2017

Member

I'd just do the cmake instructions since autotools is gone now

This comment has been minimized.

@theanalyst

theanalyst Apr 26, 2017

Member

updated

$ cmake -DWITH_CCACHE=ON ..
ccache can also be used for speeding up all builds in the system. This can be

This comment has been minimized.

@tchaikov

tchaikov Apr 26, 2017

Contributor

it's a nice introduction to ccache. but i think what we need is doc specific to ceph.

This comment has been minimized.

@theanalyst

theanalyst Apr 26, 2017

Member

I guess I can just point to the run-modes link and drop the commands etc.

This comment has been minimized.

@theanalyst

theanalyst May 9, 2017

Member

dropped the section

doc: dev add a note about ccache
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
@tchaikov

This comment has been minimized.

Contributor

tchaikov commented May 9, 2017

@smithfarm are your comments addressed in the latest change?

@smithfarm

This comment has been minimized.

Contributor

smithfarm commented May 9, 2017

Jenkins re-test this please

@tchaikov tchaikov merged commit a0ee9e6 into ceph:master May 9, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment