Changes between Version 2 and Version 3 of DevelopmentTools/DistCC


Ignore:
Timestamp:
May 20, 2011, 8:37:19 PM (14 years ago)
Author:
brecht
Comment:

first draft

Legend:

Unmodified
Added
Removed
Modified
  • DevelopmentTools/DistCC

    v2 v3  
    1 http://article.gmane.org/gmane.os.haiku.devel/8761
     1== Introduction ==
    22
    3 Useful links:
     3distcc can distribute compilations across a network, greatly reducing compile times. Even if you only have one other computer available, it can already make a noticeable difference.
     4
     5
     6== Usage instructions ==
     7
     8The following instructions assume your main development machine is running Haiku and the helper machines run Linux.
     9
     10=== Preparing helper machines ===
     11
     12* Install [http://code.google.com/p/distcc/ distcc], using the package manager or from source
     13
     14* Check out the build tools
     15{{{
     16svn co http://svn.haiku-os.org/haiku/buildtools/trunk buildtools
     17}}}
     18
     19* Check out partial Haiku tree
     20{{{
     21svn co --depth=immediates http://svn.haiku-os.org/haiku/haiku/trunk haiku
     22svn update --set-depth infinity build headers/config headers/os headers/posix
     23}}}
     24
     25* Build the cross-compilers
     26{{{
     27mkdir generated.x86gcc2
     28mkdir generated.x86gcc4
     29cd generated.x86gcc2
     30../configure --use-32bit --alternative-gcc-output-dir ../generated.x86gcc4 --build-cross-tools ../../buildtools/
     31cd ../generated.x86gcc4
     32../configure --alternative-gcc-output-dir ../generated.x86gcc2 --build-cross-tools-gcc4 x86 ../../buildtools/
     33cd ..
     34}}}
     35
     36* Make the cross-compilers available under a verbose name. Run {{{gcc -v}}} to find  out the exact version. Verify that they are the same as on the Haiku machine.
     37{{{
     38mkdir bin && cd bin
     39ln -s ../generated.x86gcc2/cross-tools/i586-pc-haiku/bin/gcc i586-pc-haiku-gcc-2.95.3-haiku-100818
     40ln -s ../generated.x86gcc4/cross-tools/i586-pc-haiku/bin/gcc i586-pc-haiku-gcc-4.4.4-haiku-101111
     41cd ..
     42}}}
     43
     44* Start the distcc daemon
     45{{{
     46PATH=$PWD/bin:$PATH distccd --allow <IP of Haiku machine>
     47}}}
     48
     49
     50=== Preparing the Haiku machine ===
     51
     52* Make GCC 2 and 4 available under the verbose names.
     53{{{
     54ln -s /boot/develop/abi/x86/gcc2/tools/current/bin/gcc /boot/common/bin/i586-pc-haiku-gcc-2.95.3-haiku-100818
     55ln -s /boot/develop/abi/x86/gcc4/tools/current/bin/gcc /boot/common/bin/i586-pc-haiku-gcc-4.4.4-haiku-101111
     56}}}
     57
     58* Adjust {{{generated.x86gcc2/build/BuildConfig}}}
     59{{{
     60HAIKU_CC ?= distcc i586-pc-haiku-gcc-2.95.3-haiku-100818 ;
     61}}}
     62
     63* Adjust {{{generated.x86gcc4/build/BuildConfig}}}
     64{{{
     65HAIKU_CC ?= distcc i586-pc-haiku-gcc-4.4.4-haiku-101111 ;
     66}}}
     67
     68* Add hostname or IP addresses of the helpers to {{{/boot/common/etc/distcc/hosts}}}
     69
     70* Uncomment {{{127.0.0.1}}} in {{{/boot/common/etc/distcc/hosts/clients.allow}}}
     71
     72* Start the distcc daemon
     73{{{
     74distccd --allow 127.0.0.1
     75}}}
     76
     77Now you can run {{{jam}}} as usual, but you should pass twice the total number of cores in the distcc network to the {{{-j}}} option. During a build, you can see what is happening by running
     78{{{
     79distccmon-text 1
     80}}}
     81
     82If you want to use distcc in combination with with [wiki:DevelopmentTools/ColorGCC colorgcc], you can mask simply the distcc executable
     83{{{
     84cd /boot/common/bin
     85mv distcc distcc_real
     86wget http://dev.haiku-os.org/raw-attachment/wiki/DevelopmentTools/DistCC/distcc
     87chmod +x distcc
     88}}}
     89
     90== References ==
    491* [http://ports.haiku-files.org/wiki/sys-devel/distcc/3.1/1 distcc on HaikuPorts]
    592* [http://www.gentoo.org/doc/en/cross-compiling-distcc.xml distcc and cross-compilers]
     93* [http://article.gmane.org/gmane.os.haiku.devel/8761 Using distcc (www.distcc.org) to speed up building Haiku]