Icecream is a program created by SUSE and is based on ideas and code by distcc. Similar to distcc it takes compile jobs(both portage and manual compilations) and distributes them to remote machines. The main difference to distcc is that is uses a central server, the scheduler, to distribute the jobs. This pays off mostly for shared computers, as it also takes the load of each machine into account and will therefore only use (mostly) idle machines.
Let's have a look at how compiling a program works. Usually you execute something like this:
$ cc -c -o hello_world.o hello_world.c $ ld -o hello_world hello_world.o
After the installation of icecream your
To do the job the helper node needs a compiler (who would have thought of
that?). But it will
After the compilation is finished it will send the
To use icecream you need at least two computers. They don't need to be of the same architecture and they even don't need to run the same operating system, but they do need to run the same version of icecream. However cross-compiling requires some extra work, if you use identical systems (e.g. two Linux/i686 systems) it works out of the box.
There also need to have a fairly fast network connection to each other (>10Mbit). The exact requirement depends on how much parallel jobs you are planning to run... just don't try it using a dial-up connection. ;)
Install icecream on all boxes that you want to add to your compilation cluster.
$ emerge ">=sys-devel/icecream-0.9.1-r1"
As mentioned in the introduction icecream uses one central server (the scheduler) to distribute jobs across all nodes. This box needs to be online every time you want to run a compilation on any of the other nodes.
You don't need to dedicated a complete machine for this, the scheduler can also be a helper node and do compilation jobs.
After you made up your mind, edit
As of 08/2008 portage has no explicit support for icecream (such as
On each machine that you want to benefit from your icecream setup do:
$ nano -w /etc/make.conf(Set N to a suitable number for your particular setup) (A common strategy is setting N as twice the number of total CPUs available + 1) MAKEOPTS="-jN"(Use icecc instead of your normal cc) PREROOTPATH="/usr/lib/icecc/bin"
To make manually compilations (those you do by typing
$ nano -w /etc/profile(Add this to the end of the file) export PATH="/usr/lib/icecc/bin:$PATH"
Starting icecream is simple, just execute those two commands on all boxes (scheduler and helper boxes):
$ /etc/init.d/icecream start $ rc-update add icecream default
First, set up portage to use ccache them same way you'd set it up without
icecream. Information about setting up ccache can be found in the
After you've set up ccache, all you need to do is add
For portage:
$ nano -w /etc/make.conf(Use icecc with ccache instead of your normal cc) PREROOTPATH="/usr/lib/ccache/bin:/usr/lib/icecc/bin"
For manual compilations:
$ nano -w /etc/profile(Add this to the end of the file) export PATH="/usr/lib/ccache/bin:/usr/lib/icecc/bin:$PATH"
Did you read the
Let's assume you have two machines, one
In that case you need a cross-compiler that runs on i686 and produces code for
sparc (
To create one you can use
Luckily there are lots of tools to help you to do that, you just need to execute these three commands on the i686 box:
(Install Gentoo's cross-toolchain generator) $ emerge sys-devel/crossdev(Create a cross-toolchain for sparc-unknown-linux-gnu) $ crossdev -t sparc-unknown-linux-gnu(Create the icecc environment) $ icecream-create-env sparc-unknown-linux-gnu
Now you have a file with a name similar to
Move it to the sparc machine. You can put it anywhere you want and give it a
more significant name, e.g.
The native environment icecream created automatically is located in
It's a good practice to store all environments in the same directory. Let's
assume you copied it to
After that you need to tell icecream about it by setting the
[ architecure(output of uname -m) ]: [ path to tar.gz icecc environment ]
In our case you'd need to add this to
$ nano -w /etc/profile(Add this to the end of the file) export ICECC_VERSION="i686:/var/icecc/host-i686-target-sparc.tar.gz,sparc64:/var/icecc/host-sparc-target-sparc.tar.gz"
Now restart icecream on the sparc box and your're done.
If you also want the sparc box to assist the i686 box you need to create the
cross-icecc environment on the sparc box, copy it to the i686 and set
Imagine you have an i686 box with an arm-linux-gnu cross-toolchain installed which you are using to compile programs for your cell phone and you want to use icecream to speed up compilations?
First, create a few symlinks to invoke icecream instead of your normal compiler:
$ icecream-config --install-links arm-linux-gnu
After that you need to set
(Install Gentoo's cross-toolchain generator) $ emerge sys-devel/crossdev(Create a cross-toolchain for arm-linux-gnu) $ crossdev -t arm-linux-gnu(Create the icecc environment) $ icecream-create-env arm-linux-gnu
Icecream has no authentication at all and the icecc daemon is run as root.
Distcc has a --allow parameter to specify clients that are allowed to connect,
icecream has no such thing, it only provides the config option
Therefore it is best to block icecream's ports in your firewall and only allow connections from trusted hosts. These are the ports icecream uses: