3

I am completely noob at this. I don't know what the make file is, and I don't know what bashrc is.

But I do know where to download source code and use source somebash.sh then make file (as was told by someone to run those commands).

I did some research and found out ccache can speed up sequential build speed, but I have no idea what am I supposed to do when reading those online instructions (include ccache in path, what path, where and how, and gcc, colorgcc, and bashrc. What are these?)

What is a step-by-step instruction?

user97662
  • 157

3 Answers3

7

I would read this documentation, and then

  1. sudo apt-get install ccache
  2. Assuming you're build a "standard" source package,
export CC="ccache gcc"
export CXX="ccache g++"
./configure

If you really want to "override" the standard gcc and g++ you could then

ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc
5

You can look into this documentation, for example. Briefly:

  1. Install the ccache package -- you know, sudo apt-get install ccache
  2. Put the following line into your ~/.bashrc:

export PATH="/usr/lib/ccache/bin/:$PATH"

Of course, please check if /usr/lib/ccache/bin really exists, it might be installed elsewhere.

thiagowfx
  • 865
1

Make install from source. It's working for me.

Download:

wget https://www.samba.org/ftp/ccache/ccache-3.3.3.tar.gz

Uncompress:

tar -zxvf ccache-3.3.3.tar.gz

Enter folder:

cd ccache-3.3.3

To compile and install ccache, run these commands:

./configure
make
make install

Create a symbolic link for ccache:

cp ccache /usr/local/bin/
cd /usr/local/bin/
ln -s ccache /usr/local/bin/gcc
ln -s ccache /usr/local/bin/g++
ln -s ccache /usr/local/bin/cc
ln -s ccache /usr/local/bin/c++