distcc usage

Pressure in the development process of the project, where a plurality of developers focused on a linux machine within the network to develop a unified development often, as more and more developers, project build more and more frequent, increasingly developed machine the larger, so consider to ease the pressure developed by the machine code for cross compiler manner.

distcc Overview: On the server requires the use of distcc, install distcc software.

(1) should loom as a machine with the compiled, distcc need to start the service on this machine;

(2) when needed on the other machine cross compile a loom, the loom which loom require additional configuration information, the other machine's environment variable to be added to this ip DISTCC_POTENTIAL_HOSTS.

 

distcc installation:

1, first installed in accordance with official website https://distcc.github.io/


      # the If ./autogen.sh "the configure" does not already exist.
      ./configure
      the make
      the make the Check # Optional! Should have have Python> = 3.1 Installed.
      the make install # by You May need to use "sudo" for the this the Command.
      the make installcheck # ! Optional Should have have Python> = 3.1 Installed.
      Update-distcc-symlinks # Needs "sudo" IF you install the Run Again the this / the Remove Compilers.

2, / when the configure error:. configure: error: Can not find libiberty. This is because of the lack libbinutils libraries, install binutils-devel.

3, make time to discover make unsuccessful, make a pause:


if test -z ":"; then    \
  echo "Not building include-server: No suitable python found"; \
else                                            \
  mkdir -p "./_include_server" &&      \
  DISTCC_VERSION="3.3.2"                        \
  SRCDIR="."                            \
  CFLAGS="-g -O2 -MD -W -Wall -Wimplicit -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wmissing-declarations -Wuninitialized -pthread -Wp,-U_FORTIFY_SOURCE -Wno-missing-prototypes -Wno-missing-declarations -Wno-write-strings"           \
  CPPFLAGS="-DMINILZO_HAVE_CONFIG_H -DHAVE_CONFIG_H -D_GNU_SOURCE -DLIBDIR="\"/usr/local/lib\"" -DSYSCONFDIR="\"/usr/local/etc\"" -DPKGDATADIR="\"/usr/local/share/distcc\"" -Isrc -I"./src" -I"./lzo" -I"./popt""                        \
  : "./include_server/setup.py" \
      build                                     \
        --build-base="./_include_server"  \
        --build-temp="./_include_server"; \
fi

According to the official website https://raw.githubusercontent.com/distcc/distcc/master/INSTALL description, python version must be greater than 3.1.

4, installed on the server python3.4, there can be a case as long as python3.4 / user / bin / directory, Python default installation in / usr / local, can ./configure --prefix = / usr. After python successful installation, to re-run under distcc ./configure, then make.

5、ln -s /usr/lib/distcc/ /usr/local/lib/distcc

 

distcc configuration

1, for cross-compiling machine, you need to run distcc service, usually with the following command:

distccd --user nobody --daemon --allow 127.0.0.1 --allow 192.168.2.0/24

2, need to use cross-compilation services in general, add the following command to compile the script:

  export DISTCC_HOSTS="localhost 192.168.2.236 192.168.2.238"

  export DISTCC_POTENTIAL_HOSTS="localhost 192.168.2.236 192.168.2.238"

  export DISTCC_LOG = "./ distcc.log" # compiler log

3. If you are using cmake, you can use the following command:

  cmake -DCMAKE_C_COMPILER=/usr/lib/distcc/cc -DCMAKE_CXX_COMPILER=/usr/lib/distcc/g++ ../

 

Need to confirm which file is compiled on which servers, you can use the command distccmon-text 1,1 represents 1 second update time.

Guess you like

Origin www.cnblogs.com/ljm0/p/11224726.html