[dpdk-dev] FYI: Using ccache a linux compiler caching tool with DPDK
keith.wiles at intel.com
Mon Jun 27 20:10:02 CEST 2016
FYI, Just to help document the issue here.
Using ccache on Linux can improve your compile time from a few minutes to a few seconds depending the use case.
On my machine Ubuntu 16.04 up to date as of 06/26/2016 using:
sudo apt-get install ccache
Model Name : Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
sysname : Linux
release : 4.4.0-24-generic
version : #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016
machine : x86_64
nthreads : 2
ncores : 18
nsockets : 2
nbooks : 1
nlcores : 72
72 lcores, 2 socket(s), 18 cores per socket, 2 hyper-thread(s) per core
Note: I have added the environment variable ‘CCACHE_CPP2=yes
Builds using DPDK 16.07-rc0 on 06/27/2016
Build with ‘time CCACHE_DISABLE=true make install T=x86_64-native-linuxapp-clang’ gives:
Rebuild with no changes, just issue the above line again:
If you issue the above line with –j appended give:
remove x86_64-native-linuxapp-clang build directory.
Build with ‘time CCACHE_DISABLE=true make install T=x86_64-native-linuxapp-clang -j’ gives:
cd x86_64-native-linuxapp-clang directory
time CCACHE_DISABLE=true make
make # just to fill the ccache
time make –j
As you can see the performance gain is very nice and I ccache does seem to work correctly except in a few cases.
It appears the ccache and clang have a few problems without the global having the environment variable set:
Without this environment variable clang starts to complain about a number of issues. If you see a compile problem please rebuild with ccache disabled using ‘sudo CCACHE_DISABLE=true …’ or uninstall ccache ‘sudo apt-get remove ccache’
It is possible that GCC will also have compiler issues, but I do not seem to see any, just try without ccache to verify.
Here is a link to help explain more details:
See e.g. http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
If the build works then I have not found any issues with using ccache except a faster build time ☺ YMMV
More information about the dev