Editing Icecream Scratchbox Howto

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
''Original instructions written by Anderson Lizardo.''
 
-
 
= Icecream + Scratchbox HOWTO =
= Icecream + Scratchbox HOWTO =
-
'''''NB:''' With some Scratchbox versions, distributed arm target compilations occasionally fail due to gcc/g++ targeting wrong ARM variant. Once a workaround is developed, this warning will disappear.''
+
''Original instructions written by Anderson Lizardo. This version copied verbatim from the INdT wiki.''
From Icecream web page <ref>http://en.opensuse.org/Icecream</ref>:
From Icecream web page <ref>http://en.opensuse.org/Icecream</ref>:
Line 13: Line 11:
This document describes how to use icrecream for parallel compilation inside
This document describes how to use icrecream for parallel compilation inside
Scratchbox.
Scratchbox.
-
 
-
== Prerequisites ==
 
-
 
-
''Skip this section if you have a working Icecream setup on your network.''
 
-
 
-
Before attempting to use icecc with Scratchbox, be absolutely certain it runs without any issues on the host itself (and that the processes migrate properly in the network). Basic Icecream installation includes once machine running the scheduler and every participating host running the icecc daemon.
 
-
 
-
On Ubuntu, a basic Icecream setup can be achieved by installing the package icecc on every participating host. On the scheduler, modify /etc/default/icecc to enable the scheduler daemon. If some host can't find the scheduler, modify /etc/icecc/icecc.conf to explicitly set the scheduler hostname.
 
-
 
-
Make sure the host sees the scheduler by running icemon (package icecc-monitor on Ubuntu). You can leave icemon running to observe the task migration during compilations.
 
-
 
-
To enable automatic distributed compilations on the host OS in Ubuntu, add the following snippet to $HOME/.bashrc:
 
-
 
-
<pre>
 
-
# set the ICECC version and enable it by default
 
-
. /etc/lsb-release
 
-
procfamily=$(uname -m)
 
-
icecc_tarball="$(readlink -f $HOME/icecc/icecc-$procfamily-$DISTRIB_CODENAME.tar.gz)"
 
-
if [ -f "$icecc_tarball" ]; then
 
-
    export ICECC_VERSION=$icecc_tarball
 
-
    export PATH=/usr/lib/icecc/bin:$PATH
 
-
    export DEB_BUILD_OPTIONS=$DEB_BUILD_OPTIONS,parallel=12
 
-
fi
 
-
unset icecc_tarball procfamily DISTRIB_ID DISTRIB_RELEASE DISTRIB_CODENAME DISTRIB_DESCRIPTION
 
-
</pre>
 
-
 
-
Note that on other distributions than Ubuntu, you might have to modify this, depending on the contents on /etc/lsb-release.
 
-
 
-
Also note the "parallel=N" parameter being added to DEB_BUILD_OPTIONS. This enables parallel builds (limited to N parallel jobs) for those packages that support it. Alternatively, if you are doing your own builds by calling "make", you should instead pass the "-jN" parameter to enable parallel builds, e.g. "make -j12".
 
-
 
-
Then, create directory $HOME/icecc and run <pre>icecc --build-native</pre> there. Symlink the created tarball to a descriptive name, e.g. icecc-i686-karmic.tar.gz (this name has to match the $icecc_tarball variable in the .bashrc snippet above).
 
-
 
-
Now, open a new terminal and ensure that $ICECC_VERSION variable is set. Then run a test compilation to see that the compilation tasks really migrate to other hosts.
 
-
 
-
Do not proceed beyond this point before you have made a test compilation and seen that your Icecream setup works as intended.
 
== Compiling icecc ==
== Compiling icecc ==
Line 91: Line 54:
<li>Run the script for each target you wish to use icecc for. E.g.:</li>
<li>Run the script for each target you wish to use icecc for. E.g.:</li>
<pre>
<pre>
-
host$ ./icecc_create_env_sbox.sh FREMANTLE_ARMEL
+
host$ ./icecc_create_env_sbox.sh maemo5-armv7
-
host$ ./icecc_create_env_sbox.sh FREMANTLE_X86
+
host$ ./icecc_create_env_sbox.sh maemo5-i486
</pre>
</pre>
</ol>
</ol>
Line 100: Line 63:
* a symbolic link to this tarball, named "icecc_box-<compiler_name>.tar.gz"
* a symbolic link to this tarball, named "icecc_box-<compiler_name>.tar.gz"
-
Place the tarballs in $HOME/icecc inside Scratchbox. These tarballs will be used later when running icecc. It is important that they uniquely identify the toolchain, because all peers in the build network will use the same tarball, and will cache the toolchain locally using that name. Therefore we use the MD5 signature, plus a symlink to easily map it to the actual Scratchbox toolchain name.
+
These tarballs will be used later when running icecc. It is important that they uniquely identify the toolchain, because all peers in the build network will use the same tarball, and will cache the toolchain locally using that name. Therefore we use the MD5 signature, plus a symlink to easily map it to the actual Scratchbox toolchain name.
== Using icecc ==
== Using icecc ==
Line 124: Line 87:
sbox_compiler="$(sb-conf show --compiler)"
sbox_compiler="$(sb-conf show --compiler)"
# use the tarball name with the MD5, avoiding conflicting names in peer caches
# use the tarball name with the MD5, avoiding conflicting names in peer caches
-
icecc_tarball="$(readlink -f $HOME/icecc/icecc_sbox-$sbox_compiler.tar.gz)"
+
icecc_tarball="$(readlink -f $HOME/icecc_sbox-$sbox_compiler.tar.gz)"
if [ -f "$icecc_tarball" ]; then
if [ -f "$icecc_tarball" ]; then
-
    export ICECC_VERSION="i486:$icecc_tarball"
+
export ICECC_VERSION="i486:$icecc_tarball"
-
    # comment the following line if you don't want to build in parallel by default
+
-
    export MAKEFLAGS="-j12"
+
fi
fi
unset icecc_tarball sbox_compiler
unset icecc_tarball sbox_compiler
Line 160: Line 121:
</pre>
</pre>
</ol>
</ol>
-
 
-
The snippet above can be placed in .bashrc as well.
 
You can now build applications normally and they will automatically use icecc when calling gcc or g++.
You can now build applications normally and they will automatically use icecc when calling gcc or g++.

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)