7. Distcc and ccache

7.1. Set up

7.1.1. Set up distcc

Giving -D argument to OmoiKondara will rebuild packages while having the environment variable set for distcc.

To specify building host(s) add the following in .Omoikondara.

      DISTCC_HOST host1
      DISTCC_HOST host2:11111

Add as many lines for the hosts as in <host name>[:<port number>]. Specify port number after the host name. If not specified, port 3632 will be used.

To set up, the number of CPU used for NUMJOBS in .OmoiKondara may be used as a standard.

       NUMJOBS 4

If you want the building done quickly and do not mind sluggish behaviour of your machine, you can double the number mentioned above.

Please set up separately depending on your environment, such as setups for services, xinitd, etc.

7.1.2. Set up through ssh

distcc after version 2.1, even if it has not started, can start automatically via ssh.

Please set up like

      export DISTCC_HOSTS="localhost @remote1 @remote2"


      export DISTCC_HOSTS="localhost user1@remote1 user2@remote2"

To connect to distcc that has been started already, do the following:

      export DISTCC_HOSTS="localhost remote1 remote2"

7.1.3. Set up spec

In spec files, change in %build section where it says

     make ......


     %make  ......

and it should be OK.

However, for noarch packages you do not need to use make -j.

7.1.4. Note

At the terminal specified by DISTCC_HOST if top is performed cc1 can be checked. It does not correspond to crossing compile yet. Since there is a limit also in distcc, it is necessary to make the same version as gcc installed in your machine. However, library and header files are OK with the one being installed in the host that performs OmoiKondara.

7.1.5. ccache

Previously, symlinks were in /usr/bin/ccache/gcc but are moved to /usr/libexec/ccacheand ccache itself is now /usr/bin/ccache.

[IMPORTANT] In case ccache version 2.2-1m or before has been installed, do rpm -e to uninstall it. rpm can not overwrite a directory with a new file having the same name.

Similar to ccache, symlink such as gcc that were in /usr/bin/ccache/gcc are moved to /usr/libexec/distcc and distcc itself is now /usr/bin/distcc.

7.2. Setup to use both distcc and ccache at the same time

distcc can be used along with ccache.

1. Use only ccache

Set up as follows:

       export PATH="/usr/libexec/ccache:$PATH"

2. Use only distcc

Set up as follows:

     export PATH="/usr/libexec/distcc:$PATH"

3. Use both ccache and distcc

Set up as follows:

      export PATH="/usr/libexec/ccache:$PATH"
      export CCACHE_PREFIX="distcc"