faster compiling using gcc

General support for problems installing or using Deluge
Post Reply
shirish
Seeder
Seeder
Posts: 163
Joined: Fri May 25, 2007 4:01 am
Location: South Asia, India

faster compiling using gcc

Post by shirish »

Hi all,
Just came to know there is a tool called ccache which helps in faster compilation. All the tutorial is courtesy eternalswd.

First that tool needs to be downloaded & installed :-

Code: Select all

sudo aptitude install ccache
Now one has to set the environment up for it. There are two ways, one doing stuff in .bashrc or better yet, doing it in /etc/enviroment (globally) guessing the second is so if its a multi-user environment then everybody else also benefits. If you do the same in .bashrc then only you benefit. I went the /etc/environment way :-

The first thing is to make sure to backup your /etc/environment

Code: Select all

 sudo cp /etc/environment /etc/environment_backup
Then make the changes, the path atleast in my /etc/environment was :-

Code: Select all

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
changed it so now it reads :-

Code: Select all

PATH="/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
This should make compile times faster for sure.
Debian Sid, Intel Dual-Core, 512 kbps DL , 64 Kbps UL, deluge-1.3.5, pieces plugin, GNOME 3.4.x

All posts under creative commons http://creativecommons.org/licenses/by-nc/3.0/
eternalsword
Member
Member
Posts: 44
Joined: Fri Jun 22, 2007 8:08 pm

Re: faster compiling using gcc

Post by eternalsword »

not all distros use /etc/environment in fact, so check with your distro to see where PATH is sourced if you want to go globally. You can also export in your shell's configure on per user basis. eg, I added this to my .zshrc file. (bash would use .bashrc)

Code: Select all

export PATH=/usr/lib/ccache:$PATH
Per user is safe no matter what distro.
Post Reply