Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't ccache used with gcc more often?

Tags:

c++

ccache

I've been wondering...

Are there some limitations with ccache?

If the difference in later compile times are so large, why aren't more Linux developers using ccache more often?

like image 365
Hakkar Avatar asked Aug 10 '12 16:08

Hakkar


People also ask

How do I know if ccache is used?

The only way you should be able to tell that you are using ccache is the speed. Currently known exceptions to this goal are listed under BUGS. If you ever discover an undocumented case where ccache changes the output of your compiler, please let us know.

How does ccache work?

Ccache is a compiler cache. It speeds up recompilation by caching the result of previous compilations and detecting when the same compilation is being done again. Ccache has been carefully written to always produce exactly the same compiler output that you would get without the cache.

Can I delete ccache?

Keyboard Shortcut for Most Browsers. If you are using Internet Explorer, Edge, Google Chrome, or Mozilla Firefox you can quickly clear cache with a keyboard shortcut. While in your browser, press Ctrl + Shift + Delete simultaneously on the keyboard to open the appropriate window.

How do I enable ccache?

To enable ccache, simply add '/usr/lib/ccache' to the beginning of your PATH. This directory contains symlinks to ccache, and ccache is smart enough to look at the name of the calling executable to determine which real executable to run.


1 Answers

I guess that the simple answer is that ccache is great when the build system is broken (i.e. the dependencies are not correctly tracked, and to get everything built correctly you might need make clean; make). On the other hand, if dependencies are correctly tracked, then ccache will not yield any advantage over plain make, and will actually incur the cost of maintaining the cache and updating it (the size of the cache might be huge depending on the size of the project)

like image 72
David Rodríguez - dribeas Avatar answered Oct 03 '22 00:10

David Rodríguez - dribeas