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
  • 1
    If you don't know what you are doing, why are you concerned with increasing efficiency? Shouldn't you be more focused on figuring out the very basics? You should figure out what your end goal is, then figure out how to get there. Ask questions here about specific things you are trying to figure out that get you to that goal. If you don't know what a path is, then forget about ccache. – Paul May 15 '14 at 01:26
  • so what's a PATH (in Linux definition, I know what path is in windows environment) – user97662 May 15 '14 at 01:32
  • See http://askubuntu.com/questions/141718/what-is-path-environment-variable-and-how-to-add-it – Seth May 15 '14 at 01:40

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
  • 845
  • 6
  • 9
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++