阴道炎有什么症状| 高铁动车有什么区别| 什么地唱歌| 什么是血氧| 水火既济是什么意思| 葡萄糖是什么糖| 徐峥的老婆叫什么名字| 虾为什么叫对虾| 靖国神社是什么地方| 骨癌有什么症状有哪些| 邹的左边读什么| 什么是空腹血糖| 摩羯女和什么星座最配| 呕气是什么意思| 菱角什么时候成熟| 蟋蟀吃什么食物| 胃寒湿气重吃什么药效果最好| 82年的拉菲是什么意思| 牙根发黑是什么原因| 居心叵测是什么意思| 了什么意思| 中午一点是什么时辰| 在什么情况下最容易怀孕| 寒门什么意思| 俄罗斯是什么人种| 脾氨肽是什么| 柏拉图式恋爱是什么意思| 吃什么补充维生素b1| 手上长斑点是什么原因| 益生元是什么| 什么的走路| 色痨是什么病| 高血糖不能吃什么| guess是什么品牌| 溥仪什么时候去世的| casio手表是什么牌子| 疱疹挂号挂什么科室| 肌底液是干什么用的| 道歉送什么花| ru是什么意思| w代表什么意思| 口苦吃什么好| 儿童肠胃感冒吃什么药效果好| 手指发麻什么原因| 中国国花是什么| 乍一看是什么意思| 女性内科检查什么| vol是什么意思| 碳水化合物是什么东西| 例假提前是什么原因| 荨麻疹吃什么药| 海棠花什么季节开花| 2月18什么星座| sid是什么| 刘备属相是什么生肖| 凝胶是什么| 意味什么| ad是什么的缩写| 做梦梦到老婆出轨是什么意思| 擒贼先擒王是什么生肖| 什么地问填词语| 儿童内分泌科检查什么| 加拿大属于什么洲| 西红柿吃多了有什么坏处| cba什么时候开始比赛| 可可是什么饮料| 上午十点是什么时辰| laura是什么意思| 上学是为了什么| 世界上什么东西最大| 张家界地貌属于什么地貌| a7是什么意思| 肛门湿疹用什么药| 男生做爱什么感觉| 圣诞礼物什么时候送| 肾功能不好有什么症状| 日本是什么时候投降的| 牙龈肿痛用什么药| 急诊是什么意思| 狗狗吐黄水是什么原因| 婴儿奶粉过敏有什么症状| 滑膜炎吃什么好得快| 疖子是什么原因引起的| 林俊杰的粉丝叫什么| 老凤祥银楼和老凤祥有什么区别| 黄金为什么这么贵| 世界上最大的鸟是什么鸟| 五行属金什么字最好| 善变是什么意思| 为什么出汗有酸臭味| 山东吃什么主食| 虾皮不能和什么一起吃| 抑郁状态和抑郁症有什么区别| 武则天代表什么生肖| 情窦初开什么意思| 梦到打架是什么意思| 黑客帝国4什么时候上映| 洗牙有什么危害吗| 结婚14年是什么婚| 儿童胃肠型感冒吃什么药| 抗核抗体阴性说明什么| 撸铁是什么意思| 炎字五行属什么| 来月经前有褐色分泌物是什么原因| 杀马特什么意思| 71年属猪是什么命| 啄木鸟吃什么食物| 喝藿香正气水不能吃什么| cmb是什么意思| 津液不足吃什么中成药| 喝茶叶茶有什么好处| 立春吃什么| 人流是什么| 息肉样增生是什么意思| 孔雀蓝是什么颜色| 备孕挂什么科| 雯五行属什么| 鼻梁歪的男人说明什么| 今日属相是什么生肖| 胃窦黄斑瘤是什么病| 陪葬是什么意思| 小鸟站在高压线上为什么不会触电| 太息是什么意思| 喝酒尿多是什么原因| 炖牛肉放什么调料| 梦见佛像是什么意思| 支气管病变什么意思| 什么方法睡觉快速入睡| jz是什么意思| 黄体期什么意思| 狒狒是什么动物| tiamo是什么意思| 济州岛有什么好玩的| 什么颜色显瘦| 肾最怕什么食物| 一喝牛奶就拉肚子是什么原因| 煮酒论英雄什么意思| 条索灶是什么意思| 三星堆是什么意思| bm什么意思| 感冒鼻子不通气吃什么药| 中药为什么要热着喝| 脖子长痘痘是什么原因| 碳13是检查什么的| 体温偏高的人说明什么| 油菜花什么时候开| 摩羯座和什么座最配对| 什么情况下会猝死| 腰肌劳损用什么药最好| cpf是什么意思| 女命带驿马是什么意思| 尿道口流白色液体是什么病| 中国第一艘航空母舰叫什么| 梦到打架是什么意思| 女性适合喝什么茶| 水泡用什么药膏最有效| 枸杞子有什么功效| 减肥期间可以喝什么饮料| 嗓子发炎挂什么科| 吊什么意思| 舌尖发麻是什么原因引起的| 今天中国什么节日| 致五行属什么| 消化不良吃什么| 子宫切除后对身体有什么影响| 长期便秘吃什么药效果最好| 男人喝红糖水有什么好处| 女性婚检都检查什么| 五月掉床有什么说法| 身上长疮是什么原因引起的| 崇洋媚外是什么意思| 傻人有傻福什么意思| 做梦梦到自己生病了是什么意思| 射精无力是什么原因| 性激素六项什么时候检查| 相知相惜是什么意思| 蛋白粉什么味道| 煮玉米加盐有什么好处| 阿胶什么时候吃效果最好| 释放是什么意思| 脑梗吃什么中药| ds是什么意思| 降血糖吃什么菜| 红细胞分布宽度偏低是什么原因| 吃什么去肝火最快| 靖国神社是什么| 金钱草长什么样子图片| 7月31号是什么星座| 梦见别人穿红衣服是什么意思| 咽峡炎吃什么药| 圆圆的什么| 树挪死人挪活是什么意思| 你喜欢我什么| 养老院靠什么挣钱| 常乐我净是什么意思| 梦见鸡是什么意思| 淋病有什么症状| 迈之灵治什么病| 梦见女婴儿是什么意思| 拉黄尿是什么原因| zw是什么意思| 滋生是什么意思| 呆呆的笑是什么笑| levi是什么意思| 蓝颜知己什么意思| 七月十六号是什么星座| ttl什么意思| 虎皮膏药有什么功效| 喜用神什么意思| 枣红色配什么颜色好看| 慷慨解囊是什么意思| 乏是什么意思| 什么的公园| 软件开发需要学什么| 绞股蓝和什么搭配喝减肥| 嗝什么意思| 梦见月经血是什么预兆| 葡萄和什么不能一起吃| 草字头见念什么| 前列腺炎吃什么药效果好见效快| 门静脉增宽是什么意思| 高血糖是什么原因引起的| 怀孕不能吃什么药| 肝炎有什么症状| 女性得乙肝有什么症状| 夜宵和宵夜有什么区别| 化疗有什么副作用| 肉桂茶属于什么茶| 打完耳洞要注意什么| 白带多什么原因| 38是什么意思| 星辰大海是什么意思| 经常低血糖是什么原因| 阿莫西林什么时候吃| 乳清粉是什么| 2009属什么生肖| 抗缪勒氏管激素是检查什么的| 吃什么补内膜最快| 折耳猫什么颜色最贵| 怀孕了用排卵试纸测会显示什么| 果糖胺偏高说明什么| 七八年属什么生肖| 喝中药为什么会拉肚子| 有什么颜色| 血液病有什么症状| 肾的功能是什么| 心肌酶是什么| 贫血貌是什么表现| 办健康证需要检查什么| 游泳有什么好处| 骨科是什么| 泄身是什么意思| 吃什么对心脏好| 肌无力是什么原因引起的| 属马的本命佛是什么佛| 两个人背靠背是什么牌子| 辩证什么意思| 竹节麻是什么面料| 女生的逼长什么样| 文化大革命什么时候结束| 7月15日是什么节| 无期徒刑是什么意思| 老年人腿疼是什么原因引起的| 梦见给别人剪头发是什么意思| 百度
Jump to content

《星光大道》 20170930

From ArchWiki
百度 嘉琪的妈妈刘雪华今年也只有25岁,刘雪华一直在家照顾孩子和老人没有上班也没用收入,嘉琪和年迈的奶奶也需要刘雪华的照顾。

distcc is a program to distribute builds of C, C++, Objective C or Objective C++ code across several machines on a network to speed up building. It should always generate the same results as a local build, is simple to install and use, and is usually much faster than a local compile. Further, one can use it together with native Arch build tools such as makepkg.

Terms

client
The client is the computer initiating the compilation.
volunteer
The volunteer is the computer accepting compilation requests sent by the client. One can setup multiple volunteers or just a single one.

Installation

Install the distcc package on all participating PCs in the distcc cluster. For other distributions, or even operating systems including Windows through using Cygwin, refer to the distcc docs or the included man pages distcc(1) and distccd(1). Be sure to allow traffic through the port on which distcc runs (the default is 3632/tcp), see Category:Firewalls.

Configuration

Modes of operation

Distcc can be run in plain mode (default) or in pump mode. At a high level, the key difference is in how distcc deals with preprocessed source. Plain mode transfers the complete source and compiler arguments. Preprocessing is kept on the client. Pump mode distributes both preprocessing and compilation to the distcc cluster which, in many cases, is more efficient and faster. See distcc(1) for more details.

Volunteers

The configuration for the volunteer is stored in /etc/conf.d/distccd. At a minimum, add the --allow-private switch which covers a number of ipv4 private network ranges, or if you have a ipv6 capable network then use --allow with your ipv6 CIDR. Logging to a file is also nice for troubleshooting if needed.

DISTCC_ARGS="--allow-private --log-file /tmp/distccd.log"

Or if you need to allow ipv6 access and your network CIDR is /64:

DISTCC_ARGS="--allow-private --allow aaaa:bbbb:cccc:dddd:eeee:::/64 --log-file /tmp/distccd.log"

If multiple interfaces are present on the machine, consider passing the --listen ADDRESS option as well. Other options can be defined. Refer to distccd(1).

Start distccd.service on every participating volunteer. To have distccd.service start at boot-up, enable it.

Client

For use with makepkg

Edit /etc/makepkg.conf in the following sections:

  1. The BUILDENV array will need to have distcc unbanged i.e. list it without exclamation point.
  2. Uncomment the DISTCC_HOSTS line and add the host name or IP addresses of the volunteers. Optionally, follow this with a forward slash and the max number of threads they are to use. The subsequent nodes should be separated by a white space. This list should be ordered from most powerful to least powerful (processing power).
  3. Adjust the MAKEFLAGS variable to correspond roughly twice the number max threads per server. In the example below, this is 2x(9+5+5+3)=44.
Note: Hostnames can be used rather than IP addresses but if the intention is to build using devtools build scripts, name resolution in the build root is not currently supported, so stick with IP addresses in this scenario. Another reason to use the IP address is on networks running pi-hole for name resolution as pi-hole's logs will record every request from distcc thus spamming the logs with thousands of superfluous lines.
Warning: The -march=native flag cannot be used in the CFLAGS and CXXFLAGS variables, otherwise distccd will not distribute work to other machines.

It should be noted that there are no true universal configurations. Try one, test it, compare the results to other setups. The following are a few common setups:

Plain mode example
BUILDENV=(distcc fakeroot color !ccache check !sign)
MAKEFLAGS="-j44"
DISTCC_HOSTS="localhost/9 192.168.10.2/5 192.168.10.3/5 192.168.10.4/3"
Pump mode example
BUILDENV=(distcc fakeroot color !ccache check !sign)
MAKEFLAGS="-j70"
DISTCC_HOSTS="localhost/9 192.168.10.2,cpp,lzo 192.168.10.3,cpp,lzo 192.168.10.4,cpp,lzo"

Several things to call out here:

  • Pump mode generally performs better with a high value for MAKEFLAGS than plain mode.
  • In pump mode, the IP or hostname is suffixed with a literal ',cpp,lzo' as required by pump mode. Further, the localhost in this example was not. This means that distcc will load localhost with the 9 jobs defined and more aggressively distribute the code generation to the volunteers. It could be that in larger clusters, one might want to restrict the number of local jobs on the localhost to fewer to allow processing of distribution out to the cluster. One could also use the ,cpp,lzo suffix to the localhost as well.
  • As mentioned above, there is not a single configuration that will work efficiently with all distcc clusters/determining the optimal settings are derived empirically through testing and benchmarking.

For use without makepkg

Plain mode example

The minimal configuration for distcc on the client includes the setting of the available volunteers and re-defining the PATH.

$ export PATH="/usr/lib/distcc/bin:$PATH"
$ export DISTCC_HOSTS="localhost/9 192.168.10.2/5 192.168.10.3/5 192.168.10.4/3"
Pump mode example
$ export PATH="/usr/lib/distcc/bin:$PATH"
$ export DISTCC_HOSTS="localhost/9 192.168.10.2,cpp,lzo 192.168.10.3,cpp,lzo 192.168.10.4,cpp,lzo"

Compile

With makepkg

Plain mode example

No special steps are needed once /etc/makepkg.conf has been configured. Simply call makepkg as normal.

Pump mode example

The user must start pump prior to compiling whether with makepkg or on the shell. Since pump includes a check to make sure there is a set of DISTCC_HOSTS correctly configured, we need to first define a bogus DISTCC_HOSTS line. Remember that makepkg will use the values specified in /etc/makepkg.conf.

$ export DISTCC_HOSTS="localhost,cpp,lzo"
$ eval $(pump --startup)

Now call makepkg as normal.

When finished, optionally stop pump:

$ pump --shutdown
Tip: Alternatively, call makepkg with pump and it will close the include server automatically after makepkg finishes.

Without makepkg

Plain mode example

After exporting the two variables described in #For use without makepkg, simply call the compiler:

$ make -j44

Some programs may require one to define the CC and/or CXX variable to work properly:

$ make -j44 CC=distcc CXX=distcc

Pump mode example

Start pump as illustrated above. Compilation is no different than plain mode.

With CMake

Use the following CMake options to build a CMake-based project with distcc:

$ cmake -DCMAKE_C_COMPILER_LAUNCHER=distcc -DCMAKE_CXX_COMPILER_LAUNCHER=distcc ...

Monitoring progress

distcc ships with a cli monitor distccmon-text one can use to check on compilation status.

The cli monitor can run continuously by appending a space followed by integer to the command which corresponds to the number of sec to wait for a repeat query:

$ distccmon-text 3
29291 Preprocess  probe_64.c                                 192.168.10.2[0]
30954 Compile     apic_noop.c                                192.168.10.2[0]
30932 Preprocess  kfifo.c                                    192.168.10.2[0]
30919 Compile     blk-core.c                                 192.168.10.2[1]
30969 Compile     i915_gem_debug.c                           192.168.10.2[3]
30444 Compile     block_dev.c                                192.168.10.3[1]
30904 Compile     compat.c                                   192.168.10.3[2]
30891 Compile     hugetlb.c                                  192.168.10.3[3]
30458 Compile     catalog.c                                  192.168.10.4[0]
30496 Compile     ulpqueue.c                                 192.168.10.4[2]
30506 Compile     alloc.c                                    192.168.10.4[0]

Cross compiling with distcc

One can use distcc to help cross compile:

  • A machine running the target architecture must be used as the client.
  • Non-native architecture volunteers will help compile but they require the corresponding toolchain to be installed and their distccd pointing to it.

Arch Linux ARM as clients (x86_64 as volunteers)

This section details how to use Arch Linux (x86_64) volunteers to help an Arch ARM device cross-compile. See these tests for evidence that speed gains on the order of 2-4x can be realized with just a single x86_64 machine helping an ARM device compile.

Volunteers

The Arch ARM developers highly recommend using the official project toolchains which should be installed on the x86_64 volunteer(s). Rather than manually managing these, the AUR provides two toolchains as well as configuration and systemd service units:

Setup on the volunteer containing the arm/arm64 toolchains is identical to #Volunteers except that the name of the configuration and systemd service file matches that of the respective package. For example, for armv7h the configuration file is /etc/conf.d/distccd-armv7h and the systemd service unit is distccd-armv7h.service.

Note that each of the toolchains runs on a unique port thus allowing all four of them to co-exist on the volunteer if needed. Be sure to allow traffic to the port on which distcc runs see Category:Firewalls and distcc(1).

Target architecture Distcc Port
armv7h 3635
armv8h/aarch64 3636

Client

The easiest method to setup the Arch ARM client is to use distccd-arch-armAUR. It provides all four configurations and systemd service units covering all four flavors of Arch ARM. For example, if the Arch ARM client is running an armv7h image, optionally edit /etc/conf.d/distccd-armv7h and change the defaults therein. When ready to build, enable distccd-armv7h.service and compile.

For a more detailed tutorial, see usage-examples.

If one would rather setup the client without using the AUR package mentioned above, manual setup of the client is identical to #Client except, one needs to modify the following two files to define the now non-standard port the volunteers are expected to use. Refer to the table above if using the AUR package.

  1. /etc/conf.d/distccd: example on an armv7h machine: DISTCC_ARGS="--allow-private --log-level info --log-file /tmp/distccd-armv7h.log --port 3635"
  2. /etc/makepkg.conf: example on an armv7h machine: DISTCC_HOSTS="192.168.10.2/5:3635 192.168.10.3/5:3635"
Note about localhost on ARM clients

When building on Arch ARM devices using x86_64 volunteers, it is highly recommended to exclude the localhost directive from DISTCC_HOSTS since many ARM devices do not have the needed processing power.

To illustrate this effect, consider the following example compiling the linux kernel version 5.10.44's Image target. The client is a RPi4B (aarch64) and the volunteer (192.168.1.288) is a quad core/hyper threaded Intel machine. Each compile job was run only once and make clean was run in between them.

Running make -j15 Image CC=distcc CXX=distcc
DISTCC_HOSTS= Time (mm:ss) Fold slower
"192.168.1.288:3636/9" 6:50 -
"localhost/5 192.168.1.288:3636/9" 10:34 2.8x
"192.168.1.288:3636/9 localhost/5" 10:13 2.7x

Arch Linux (x86_64) as clients (Arch ARM as volunteers)

This section details how to use Arch ARM volunteers to help an x86_64 client cross-compile. See these tests for evidence that compilation times can be significantly sped up using even 1 Arch ARM volunteer and that up to 2 can double that gain.

Client

Setup of the client is identical to #Client with distcc running on the standard port 3632.

Volunteers

distccd-x86_64AUR will provide a toolchain to install on the Arch ARM devices to enable cross compilation.

Additional toolchains

  • EmbToolkit: Tool for creating cross compilation tool chain; supports ARM and MIPS architectures; supports building of an LLVM based tool chain
  • crosstool-ng: Similar to EmbToolkit; supports more architectures (see website for more information)
  • Linaro: Provides tool chains for ARM development

The EmbToolkit provides a nice graphical configuration menu (make xconfig) for configuring the tool chain.

Troubleshooting

Quirks compiling the Arch Linux kernel package

If building the kernel from the official PKGBUILD (or many from the AUR), distcc will not work due to the fact that the kernel is hard-coded to use GCC plugins which cannot be supported by distccd due to technical reasons.

A workaround is to edit the kernel source removing the hard-coded requirement of GCC plugins. This can be accomplished with a sed one liner in the PKGBUILD itself inserted before the make step:

sed -i '/HAVE_GCC_PLUGINS/d' arch/x86/Kconfig

Failure to do this will result in distcc not working during the build. See FS#64275.

Another option is to pass the CC=distcc and CXX=distcc variables as part of the build command:

make all CC=distcc CXX=distcc

Quirks compiling chromium

Compiling chromium which uses clang is currently affected by issue#386. In order to circumvent the bug, add the following to the _flags array in the PKGBUILD:

'is_cfi=false'
'use_gold=false'
'clang_use_default_sample_profile=false'
'chrome_pgo_phase=0'

Journalctl

Use journalctl to find out what was going wrong:

# journalctl $(which distccd) -e --since "5 min ago"

Adjust log level

By default, distcc will log to /var/log/messages.log as it goes along. One trick (actually recommended in the distccd manpage) is to log to an alternative file directly. Again, one can locate this in RAM via /tmp. Another trick is to lower to log level of minimum severity of error that will be included in the log file. Useful if only wanting to see error messages rather than an entry for each connection. LEVEL can be any of the standard syslog levels, and in particular critical, error, warning, notice, info, or debug.

Either call distcc with the arguments mentioned here on the client or appended it to DISTCC_ARGS in /etc/conf.d/distccd on the volunteers:

DISTCC_ARGS="--allow 192.168.10.0/24 --log-level error --log-file /tmp/distccd.log"

Limit HDD/SSD usage by relocating $HOME/.distcc

By default, distcc creates $HOME/.distcc which stores transient relevant info as it serves up work for nodes to compile. This will avoid needless HDD read/writes and is particularly important for SSDs.

$ export DISTCC_DIR=/tmp/distcc

For distccd-alarm

No such file or directory

Errors similar to the following indicate that the user is mistakenly running the distccd service provided by distcc and NOT provided by the distccd-alarm packages (i.e. distccd-alarm-armv7hAUR, or distccd-alarm-armv8AUR.)

Be sure to start the correct service for the target architecture.

distcc[25479] (dcc_execvp) ERROR: failed to exec armv7l-unknown-linux-gnueabihf-g++: No such file or directory

Avahi-daemon stops publishing when distccd.service starts

The factual accuracy of this article or section is disputed.

Reason: This does not fix anything if the user restarts the service later. (Discuss in Talk:Distcc)

Launching distccd.service as a service might cause avahi-daemon to stop working. This can be mitigated by making sure avahi-daemon.service starts after distccd.service by editing avahi-daemon.service's unit file (see Systemd#Editing provided units) and adding After=distccd.service at the end of the [Unit] section:

/etc/systemd/system/avahi-daemon.service
...
[Unit]
Description=Avahi mDNS/DNS-SD Stack
Requires=avahi-daemon.socket
After=distccd.service
...

See also

十二生肖它第一是什么生肖 害羞的近义词是什么 户口本丢了有什么危害 慷慨什么意思 转氨酶高是什么原因
牛油果有什么功效 为什么会被鬼压床 刘少奇属什么生肖 婴儿湿疹用什么 对口高考班是什么意思
少将是什么级别 十月十七是什么星座 说女人强势是什么意思 凉栀是什么意思 什么样的手相最有福气
红月亮是什么兆头 胃字出头念什么 什么颜色属火 四联用药是些什么药 内膜增厚是什么原因
ddp是什么化疗药hcv8jop4ns8r.cn 火镰是什么意思hcv8jop6ns9r.cn 富豪是什么意思hcv8jop7ns0r.cn 什么是钾肥hcv8jop8ns5r.cn 冬天开什么花hcv9jop3ns8r.cn
27岁属什么jasonfriends.com 脱敏处理是什么意思hcv8jop6ns4r.cn 顶臂长是什么意思hcv7jop6ns4r.cn 乙型肝炎表面抗体高是什么意思hcv8jop5ns7r.cn 女人得性瘾什么症状hebeidezhi.com
荔枝都有什么品种hcv8jop6ns7r.cn 增强免疫力吃什么维生素hcv8jop0ns8r.cn 人不出汗是什么原因hcv7jop5ns0r.cn 生理盐水和食用盐水有什么区别hcv8jop4ns2r.cn 月柱代表什么xjhesheng.com
小孩流鼻涕吃什么药hcv9jop6ns1r.cn 什么是原生家庭hcv9jop5ns6r.cn 高密度脂蛋白胆固醇低是什么意思hcv9jop4ns7r.cn dolphin是什么意思hcv8jop5ns0r.cn 脚心发热吃什么药hcv8jop9ns8r.cn
百度