← 返回命令列表

Linux command

distcc 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Compile with distcc

distcc [gcc] -c [file.c] -o [file.o]

Set hosts for distribution

export DISTCC_HOSTS="[host1] [host2] [localhost]"

Run make with distcc

make -j [8] CC="distcc gcc"

Monitor compilation

distccmon-text [1]

Show host status

distcc --show-hosts

说明

distcc distributes C/C++ compilation across multiple machines on a network. It sends preprocessing output to remote hosts for compilation, speeding up large builds by parallelizing across available CPUs. The tool acts as a compiler wrapper, deciding whether to compile locally or remotely based on host availability and load. It's transparent to build systems that support CC variable override.

参数

--show-hosts
Display configured hosts.
--show-principal
Show Kerberos principal.
-j _n_
Maximum jobs (in make).
--randomize
Randomize host order.
--help
Display help information.

FAQ

What is the distcc command used for?

distcc distributes C/C++ compilation across multiple machines on a network. It sends preprocessing output to remote hosts for compilation, speeding up large builds by parallelizing across available CPUs. The tool acts as a compiler wrapper, deciding whether to compile locally or remotely based on host availability and load. It's transparent to build systems that support CC variable override.

How do I run a basic distcc example?

Run `distcc [gcc] -c [file.c] -o [file.o]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --show-hosts do in distcc?

Display configured hosts.