Fun times!
Distcc: A fast, free distributed C/C++ compiler
11–20 of 103 posts
Re: Distcc: A fast, free distributed C/C++ compiler
#12Re: Distcc: A fast, free distributed C/C++ compiler
#13So:
/opt/ourcompany/dev/bin/cc
absolutely *needs* to be the same on all machines involved or you risk very hard to spot issues.
For that reason, either use the absolute same distribution for everyone (and then run /use/bin/cc but watch out for alternatives!) or roll-out your own toolstack but make sure to put its version in the path.
Re: Distcc: A fast, free distributed C/C++ compiler
#14> distcc is not itself a compiler, but rather a front-end to the GNU C/C++ compiler (gcc), or another compiler of your choice. All the regular gcc options and features work as normal.
Re: Distcc: A fast, free distributed C/C++ compiler
#15Is there a reason to uses this over something like bazel build?
Re: Distcc: A fast, free distributed C/C++ compiler
#16Good gracious. Just looked at CHANGELOG. It was 20 years ago this month that I made modest code contribution to this project.
Re: Distcc: A fast, free distributed C/C++ compiler
#17* use make -j to run multiple task at once
* replace¹ gcc with a script that picked a host and ran the task on that²
This had many limitations that distcc lists it doesn't have (the machines had to have the same everything installed, the input and output locations for gcc had to be on a shared filesystem mounted in the same place on each host, it only parallelised the gcc part not linking or anything else, and it broke if any make steps had side-effects like making environment changes, etc.) and was a little fragile (it was just a quick hack…), but it worked surprisingly well overall. For small processes like our Uni work it didn't make much difference over make -j on its own³ but for building some larger projects like libraries we were calling that were not part of the department's standard Linux build, it could significantly reduce build times. On the machines we had back then a 25% improvement⁴ could mean quite a saving in wall-clock time.
One issue we ran into using it was that some makefiles were not well constructed in terms of dependency ordering, so would break⁵ with make -j even without my hack layered on top. They worked reliably for sequential processing which is presumably the only way the original author used them.
----
[1] well, not actually replace, but arrange for my script to be ahead of the real thing in the search path
[2] via rlogin IIRC, this predates SSH (or at least my knowledge of it)
[3] despite the single-core CPUs we had at the time, task concurrency still helped on a single host as IO bottlenecks meant that single core was less aggressively used without -j2 or -j3
[4] we sometimes measured noticeably more than that, but it depended on how patballisable the build actually was, and the shared IO resource was also shared by many other tasks over the network so that was a key bottleneck
[5] sometimes intermittently, so it could be difficult to diagnose
Re: Distcc: A fast, free distributed C/C++ compiler
#18Re: Distcc: A fast, free distributed C/C++ compiler
#19How do these distributed build tools work across the Internet, i.e. outside of a local LAN office setting? Does the increased latency and slower bandwidth become a bottleneck?
Re: Distcc: A fast, free distributed C/C++ compiler
#20Is there a reason to uses this over something like bazel build?
Is bazel build distributed? distcc lets you use a lot of machines to speed up the wallclock-time of your compilation.
Yes, that's the main feature of Bazel. And it caches the generated files. Although you could do theoretically cache using ccache with distcc.