Slashdot Mirror


Reduce C/C++ Compile Time With distcc

An anonymous reader writes "Some people prefer the convenience of pre-compiled binaries in the form of RPMs or other such installer methods. But this can be a false economy, especially with programs that are used frequently: precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine. If you use a distributed compiler, you get the best of both worlds: fast compile and faster apps. This article shows you the benifits of using distcc, a distributed C compiler based on gcc, that gives you significant productivity gains."

292 comments

  1. DistCC is good, but there's some info missing by PacketCollision · · Score: 5, Informative

    While distCC is a great tool, there are a couple things to mention. First, the article blurb states that distCC is "a distributed compiler based on GCC." It is actually a method of passing files to GCC on a remote computer in such a way that the build scripts think it was done locally.

    The article also says that other than distCC, the computers need not have anything in common; this is not strictly true. Different major versions of GCC can cause problems if you are trying to compile with optimization flags that are only on the newer version. I have run into this on my gentoo box, trying to use an outdated version of GCC on a redhat box.

    Another thing is that some very large packages have trouble with distributed building of any sort (either multiple threads on the same machine, or over a network like with distCC). As far as I know, at least parts of xfree86, KDE and the kernel turn off distributed compiling during the build. Some of this might just be in the gentoo ebuilds, but I tink some of it is in the actual Makefiles. If a program has trouble compiling, it's always worth a shot to turn off distCC.

    A good resource for setting up distCC on a gentoo system (since compiling is so large of gentoo, this is particularly important) is gentoo.org's own distCC guide

    1. Re:DistCC is good, but there's some info missing by PacketCollision · · Score: 2, Informative

      Um...Can I mod myself down -1 Idiot?

      The article clearly states that you have to have the same version of GCC. For some reason I read it as distCC, hence the comment about different versions of GCC causing problems.

      I stand by my other points

    2. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 2, Funny

      Just by looking at her code I can tell she's hot.

    3. Re:DistCC is good, but there's some info missing by Hex4def6 · · Score: 1

      It is also worth noting that apart from the version of gcc you are running, there doesn't need to be anything else common about the machines: they needn't share a filesystem, header files, or libraries, or even be running the same Linux kernel or distribution.

      nuff said.

    4. Re:DistCC is good, but there's some info missing by XO · · Score: 4, Informative

      Actually, you do NOT need to have the exact same version of GCC. However, there are certain points where the compile options given to one version will fail when given to another version. I used DISTCC quite happily between my two RedHat 7.2 boxes and my Debian box, until Debian upgraded beyond I think it was GCC 3.2.0 or so.. with the RedHat boxes having been on 2.96 i think.

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    5. Re:DistCC is good, but there's some info missing by meowsqueak · · Score: 2, Informative

      Even if the major versions are the same, Gentoo applies patches to gcc 3.3.3 that are not present in Debian's 3.3.4 (the major version is 3.3). For example, Debian's gcc doesn't recognise -fno-stack-protector which Gentoo's does, and distcc fails.

    6. Re:DistCC is good, but there's some info missing by jaclu · · Score: 1

      >As far as I know, at least parts of xfree86, KDE >and the kernel turn off distributed compiling >during the build.

      You are missinformed.

      However kernels cant be compiled with make -j
      You have to set CONCURRENCY_LEVEL instead.
      First part of compile only uses one thread, but 90% or so of the kernel-compile will take advantage of distcc

    7. Re:DistCC is good, but there's some info missing by meowsqueak · · Score: 4, Informative

      It's not a requirement, it's a recommendation. Mixing gcc versions will give you unpredictable results, some of which are perfectly acceptable, and some of which are fatal.

    8. Re:DistCC is good, but there's some info missing by questforme · · Score: 1

      I can confirm it not working with 2 versions of gcc. I tried it with my midtower running 3.4.0 and a laptop with 3.3.3, it no worky.

    9. Re:DistCC is good, but there's some info missing by sonicattack · · Score: 4, Informative

      And I've compiled the Linux kernel with distcc splitting the load over two different architectures - one Intel box running Linux, and one UltraSPARC running Solaris (with a cross-compiling GCC).

      No problems. That I noticed. Wouldn't compile a production system kernel this way, though. :)

    10. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 0
      Just by looking at her code I can tell she's hot.

      Depends on your definition of hot, I guess... Lisa Marie Seelye (Gentoo "featured developer of the week" about a year ago). She's no Natilie Portman (with or without hot grits and/or petrification), but whatever floats yer boat...

    11. Re:DistCC is good, but there's some info missing by 0racle · · Score: 2, Interesting

      No there are parts of KDE, Gnome, X and others, for instance Net-SNMP, that have problems with anything other then make -j1. The make process fails to find a library that it hasn't built yet, passing make -j1 fixes everything, well these problems anyway.

      --
      "I use a Mac because I'm just better than you are."
    12. Re:DistCC is good, but there's some info missing by jaclu · · Score: 2, Informative

      Well I'm using debian unstable on my laptops and workstations, and have been compiling my kernels with CONCURRENCY_LEVEL=10 for the last half year or so with no problems.
      when I look in distccmon, I clearly see paralell compiles, also the compile times clearly shows that its much faster than a singlle compile would be.

      I never tried compiling KDE / Gnome / X with distcc so I wouldnt know about them.

      What I have noticed is that on FreeBsd all the ports seem to fail when compiling with -j > 1

    13. Re:DistCC is good, but there's some info missing by meowsqueak · · Score: 1

      Of course I meant 'minor' not 'major':

      major.minor.??? (revision?).

    14. Re:DistCC is good, but there's some info missing by digitalpeer · · Score: 1

      It's important to note that you only need the same compiler version, not the same libraries on every computer running the distcc daemon.

      The computer you initiate the compile from only needs to have the headers you need and the libraries to link with. Individual object files are compiled by the remote machines.

    15. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 0

      She doesn't look like her.

    16. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 0

      ummm yeah she has nice little sideburns

    17. Re:DistCC is good, but there's some info missing by rixstep · · Score: 0, Flamebait

      Glad you guys find joy in this, and I sympathise with you, for I suspect the culprit is not C but C++. I've never had a problem with C compile times in any environment, but OTOH when has C++ been anything but a problem?

      A fake OO language with link-time binding, incremental linking, hopeless attempts to retrofit dynamic binding, pre-compiled headers (oh jesus) - it never stops: there are not enough crutches to hold that loser language up on its tiny confused wobbly legs.

      I do Objective-C 100% today (thank you very much) and I was worried about build times for a while - until I discovered there was yet another C++ crutch built into GCC - and when you omit that crutch by using 'no-cpp-precomp' (and you figure out what it stands for) then things go blazingly fast.

      So might I suggest that the answer to everyone's prayers is not in distCC but in ostracising that horrid language C++ once and forever and sending Bjarne back home to Aahus?

      Gotta go - someone's at the door (I think it's Domino's.)

    18. Re:DistCC is good, but there's some info missing by garaged · · Score: 1

      I've been compiling kernel, KDE, and portage apps since ages with distcc, the only thing i take care is that the other machines have a new gcc, i use gentoo, and the remote compilers are debian, redhat and fedora.
      Ocasionally there is a problem, but deleting the offending box from $DISTCC_HOSTS is all I have to do

      --
      I'm positive, don't belive me look at my karma
    19. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 1, Informative

      No problems. That I noticed. Wouldn't compile a production system kernel this way, though. :)

      Why not? Last I checked gcc doesn't generate any polymorphic code based on the platform you are compiling on.

    20. Re:DistCC is good, but there's some info missing by MyDixieWrecked · · Score: 1
      When I saw this article on the main page, the first thing I was going to say was "here's a link to the gentoo guide! I set up distcc on all my gentoo boxes my OSX server-box (running regular OSX, not OSX-Server) and it seriously speeds up compilation."

      Although it can be a pain in the ass to set up, it's a seriously great tool.

      --



      ...spike
      Ewwwwww, coconut...
    21. Re:DistCC is good, but there's some info missing by GreyWolf3000 · · Score: 1

      major.minor.teeny

      --
      Slashdot: Where people pretend to be twice as smart as they really are by behaving like children.
    22. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 0

      I believe the GNU versio number convention is major.minor.patchlevel.

    23. Re:DistCC is good, but there's some info missing by thaWhat · · Score: 1

      Hear, hear... If someone can explain why big slow code improves upon what C is all about, I'm ready to listen. But they'd better be coherent and well informed, as my experience is that C++ = major bloat (here comes flamebait) it might be bigger, but it is in no sense faster (machine code kills all - if you're dedicated)

      --
      If all you have is a hammer, everything looks like a thumb.
    24. Re:DistCC is good, but there's some info missing by sonicattack · · Score: 1

      I may be overly cautious, and of course, if it is the same version of the compiler, a cross compiler should generate exactly the same code as a native compiler, given identical input.

      But the fact that half of the code is cross compiled on a different operating system still makes me a bit cautious about the end result, and when it comes to important systems, well, I try to err on the side of caution. :^)

    25. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 0

      I bet you are the kind of person who closes all of your applications before shutting down your computer. Try this sometime, compile a kernel using your distcc method, then compile a kernel soley on both the intel and sparc platforms. Compare the results (crc32, md5, sha1, whatever makes you feel better). The files will be indentical. If the files are identical, then surely they must be generating the same code, correct?

    26. Re:DistCC is good, but there's some info missing by Anonymous Coward · · Score: 0

      I think the OP probably doesn't keep track of other things besides GCC... such as what header or libraries he has.

      I may be wrong... probably am since I'd be paranoid also, and I know at least enough that the code shouldn't be different when compiled under a different CPU (not unless you're using a CPU optomized GCC, that itself had problems, right?)

      Error on the side of caution is not reason to poke fun at someone saying they close all their apps when shutting down. Some people will take an extra step so they aren't a burdensome BOFH. Save your disdain for the people who power off the computer w/o shutting down (oh yeah, I got lots of Linux boxen on instant off ATX or still using AT power supplies. Whoops there went your files nice one!)

  2. I'm not sure how this is news by Anonymous Coward · · Score: 5, Informative

    It's also been been discussed here on Slashdot (two years ago!) in "A Distributed Front-end for GCC" and earlier this year in "Optimizing distcc."

    Distcc is great for installing Gentoo on an older computer because you can have other (faster) computers help with the compile, and if you like distcc, you may also like ccache.

    1. Re:I'm not sure how this is news by Anonymous Coward · · Score: 0
      I'm not sure how this is news


      I see your point, but what's newsworthy to me is the fact that IBM has published a short HOWTO guide. I've known about DistCC for quite a while, but I've never gotten around to investing the time to check it out. This brief intro is exactly what I needed.

  3. *sigh* by OverlordQ · · Score: 0
    --
    Your hair look like poop, Bob! - Wanker.
  4. Gentoo by Anonymous Coward · · Score: 0

    Those of us who use Gentoo have known about, and relied on distcc for quite awhile now.

    1. Re:Gentoo by morbuz · · Score: 1

      Gentoo is not my cpu of tea ;-)

      --
      CAPS LOCK IS LIKE CRUISE CONTROL FOR COOL!
  5. D00d! by 0xdeadbeef · · Score: 5, Funny
    1. Re:D00d! by Anonymous Coward · · Score: 0

      How does that Ghandi quote go again...?

    2. Re:D00d! by Anonymous Coward · · Score: 2, Funny

      Ah, yes. He was a great man.

    3. Re:D00d! by Ricwot · · Score: 1

      Well, there are 2 I can think of,
      "An eye for an eye and the whole world is blind" or "I believe concentration camps are a good idea" and when they were explained to him, "If everyone in concentration camps killed themselves there wouldn't be a problem"

      One of those is a sensible one, oh, such a great man he was.

  6. Awesome! by Anonymous Coward · · Score: 3, Funny

    Now one can install Gentoo in _only_ 5 days!

    1. Re:Awesome! by Anonymous Coward · · Score: 0

      sorry, typo there! I meant months

  7. nc: a better tool for distributed builds by Eric+Smith · · Score: 5, Interesting
    Instead of distcc, I use nc by Steven Ellis. It seems to be more flexible, though I'm not an expert on distcc, so I'm not certain.

    I think nc can be used like distcc by redefining CC="nc gcc". However, more commonly it is done by putting $(NC) at the beginning of the build rules. Then you can use nc for any build rules, not just C compiles.

    In addition to use with make, nc works well with SCons.

    1. Re:nc: a better tool for distributed builds by XO · · Score: 5, Informative

      it appears that NC requires both computers having access to the same filesystem.. whereas with DISTCC it doesn't... loooks to be a fairly sizeable difference

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    2. Re:nc: a better tool for distributed builds by joe_bruin · · Score: 1

      sorry, "nc" is netcat (or, if you prefer, gnu netcat). you have committed a namespace violation. your application will be ignored until you find a name that does not conflict with a currently maintained, widely used application.

      regards,
      the management

    3. Re:nc: a better tool for distributed builds by Ford+Prefect · · Score: 1

      you have committed a namespace violation. your application will be ignored until you find a name that does not conflict with a currently maintained, widely used application.

      I suggest changing to the name 'Phoenix'. No, wait...

      --
      Tedious Bloggy Stuff - hooray?
    4. Re:nc: a better tool for distributed builds by boots@work · · Score: 1

      See the distcc FAQ:

      nc requires the machines to have a shared filesystem mounted at the same point, synchronized clocks and exactly the same headers, libraries and tools installed. (Similarly for all the dozens of other times this idea has been invented: Sun dmake, pvmake, doozer, dbuild, ....)

      If you have that setup and you're sure everything will always be in sync, fine, you can distribute many jobs. Although distcc requires the compilers be the same, it is far more forgiving of all the variables. It may also be faster, depending on the setup: NFS is pretty awfully slow on modern machines.

      The whole point of distcc is that you can install it without needing root privileges, without needing to use NFS, and without needing to reconfigure your machines.

      Both of them are likely to break on buggy makefiles that can't handle -j. So fix your makefile, or, as you say, use SCons. SCons rocks,
      and rocks even harder with distcc.

    5. Re:nc: a better tool for distributed builds by steve_ellis · · Score: 1
      True, nc has higher requirements than distcc, and it may not be for everyone, however, it is generally very easy to set up.

      If you have common filesystems (not necessarily even mounted in the same place, though this requires some unattractive transformation rules in the nc config file), and a synchronized clock (anyone heard of ntp?), nc will either definitely be faster than distcc, or will bring your NFS server to its knees (occasionally both).

      I personally liked working with NetApp support explaining how 1 user doing 1 make could swamp a NetApp F840 (pushing about 1.6Gbit/sec over load balanced gig links to a cluster of 10 4-processor ultrasparcs). Our build, which would normally take ~1.5 hours (with -j4 on one machine) could finish in only about 12 minutes with nc.

      When used across a workgroup, with distributed ccache, CCACHE_HARDLINK, scons and content signatures, it still rocks with a much more lame fileserver (it spreads the ccache jobs over the cluster, and most writes are just creating hardlinks on the server).

      This may not help people trying to build random packages they picked up, but if you work on a large project in a workgroup environment, all of these tools:

      deserve a close look.

      -se

      (My apologies for the shameless self-promotion)

    6. Re:nc: a better tool for distributed builds by boots@work · · Score: 1

      I agree, those four make a great toolkit. I will have to check out nc sometime.

      If I already had my source on a fast NFS server, nc might be a good deal. In my experience development on NFS is noticeably slower than working with a checkout on a local disk, but I suppose it could be made faster.

    7. Re:nc: a better tool for distributed builds by JTunny · · Score: 1

      It's also a client program for nedit

  8. RPM's save time by Anonymous Coward · · Score: 0

    Convenience? How about just plain saving time.

  9. Really does help by Mazaev2 · · Score: 2, Informative

    I just installed a second Gentoo box, a lowly Pentium 2 400mhz with 128mb RAM and read up on distcc. It certainly makes compiling Gentoo a LOT faster when the otherwise poor underpowered box can ask my AthlonXP 2400 for some compiling help.

    It also requires rather minimal configuratio on my part and for the most part "Just Works[tm]"

    Hehe.. now if only I had a beowolf cluster....

    1. Re:Really does help by Jeffrey+Baker · · Score: 2, Interesting

      So, do you really think there is a significant difference between the optimum gcc-compiled output on a P2 and an AthlonXP? Why don't you just save yourself a LOT of time and electricity by transferring the binaries from the fast machine to the slower one?

    2. Re:Really does help by TheRealMindChild · · Score: 1

      Try a sparcstation 5 @ 80mhz. You have no idea what "lowly" is

      --

      "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
    3. Re:Really does help by pyr0 · · Score: 1
      It's not that simple. If he/she optimized the binaries enough, they will contain instructions not capable of running on the p2. The main one being -march=athlon-xp.

      What you can do (and I have before) is use a faster box to build a gentoo userland inside a chroot, and then transfer that to a slower machine.

    4. Re:Really does help by pyr0 · · Score: 1

      I should also have mentioned to be sure to set proper compiler flags for the p2 in the chroot!

    5. Re:Really does help by Wonko · · Score: 1

      Try a sparcstation 5 @ 80mhz. You have no idea what "lowly" is

      I compiled my first Linux kernel on a 386 40mhz with 4 meg of ram. Do you know how long it takes to do that with 4 meg of ram???

      I have no idea exactly how long it took, I started it one afternoon and came back to it the next day :p.

    6. Re:Really does help by Mazaev2 · · Score: 1

      Basically what pyr0 said. The athlon box has march=athlon-xp and the P2 has march=pentium2.

  10. I have only one computer by tepples · · Score: 2, Interesting

    My family can't afford more than one computer, you insensitive clod!

    But seriously, is there a way to make use of the concepts embodied in distcc in a home computing environment? Or is distcc designed for use by for businesses and schools?

    1. Re:I have only one computer by EvilTwinSkippy · · Score: 2, Insightful
      You would only see a performance improvement if the participants in a distcc cluster are all on the same LAN. Unless you have a really slow computer, the time it takes to upload the code and download the results over a broadband connection exceeds the time savings in shipping the job out.

      In my home environment, I have my slow lil' K6 400 ship it's compile jobs to my Athlon XP with 512MB of RAM. Both are on the same local network. In a home environment, if you have a brawny box and a scrawny box, DISTCC is your best friend. (Assuming you have to do a pile of compiles.)

      Another approach is to simply compile all your stuff on a powerful box, and copy the binaries to the scrawny ones.

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    2. Re:I have only one computer by eatjello · · Score: 1

      I run distcc on my three gentoo boxen at home, the slowest being a 75 MHz cyrix... the more the merrier, but as long as you can tap one good computer, it is worth it. Also, bandwidth is a consideration, but you can still connect to one or two remote machines over DSL or cable (I haven't tried more than two remote machines). So, if you can hoodwink your friends into helping you compile, it should be manageable.

    3. Re:I have only one computer by ShadeARG · · Score: 2, Funny

      And this is why we throw Linux on the toaster, microwave oven, coffee maker, food processor, game consoles, you name it. Anything with a processor helps. And I bet all this time you just thought we were crazy zealots.

    4. Re:I have only one computer by boots@work · · Score: 4, Interesting

      Absolutely, I use it at home all the time. It's great for sofa computing: sit on the sofa with a modest laptop, and send your compile jobs across a wireless network to a faster machine in the study.

      If you use the LZO compression option then it's quite useful even on 5Mbps wireless.

      You can also tell distcc to run as many jobs remotely as possible to keep the laptop from scorching your lap.

      It's really nice to be able to build the kernel from source in a reasonable time on a 800MHz machine.

  11. Slashdot/OSNews Merger? by illuminata · · Score: 0, Insightful

    Well, they might as well merge sites if they're going to share stories.

    --


    Until Slashdot fixes the funny modifier, use insightful or interesting. The poster knows your intentions.
  12. Gentoo has that covered by Sexy+Commando · · Score: 1
    The portage system will use this feature automatically. Together with ccache, it can save considerable amount of time compiling large sources such as kde.

    One of the problem I have encounted is that distcc only works reliablely with homogeneous envirnment where each box has same version of gcc on the same platform. I have yet to find a way to make my Gentoo box work with my cygwin box.

    1. Re:Gentoo has that covered by XO · · Score: 1

      You probably need to set up cross-compiling capability on the Cygwin, if you want to compile to target the Gentoo, or the other way around if you want to target the Cygwin.

      The reason it wouldn't work just by default, is because your binaries are being targeted for different platforms.

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    2. Re:Gentoo has that covered by EvilTwinSkippy · · Score: 1
      Well that's easy. Upgrade the GCC on cygwin, or downgrade the GCC on Gentoo. Custom package masks are your friend. I use them for my box at home, because my ATI All-In-Wonder needs a heap of patches to the Kernel and X11 for the video capture board to work properly. Basically I mask off all versions of xfree86 that are higher and lower than the current one.

      One of these days I'm going to get around to fixing the Gatos ebuild that is supposed to take care of all this for me. I guess while I'm at it I'll fix the Win4lin kernel ebuild that never seems to work too...

      Man OSS is no fun. You can't bitch about something not working. You are then compelled to fix it yourself. It's like owning your own house. If it bothers you, fix it or get over it.

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    3. Re:Gentoo has that covered by swillden · · Score: 1

      The reason it wouldn't work just by default, is because your binaries are being targeted for different platforms.

      I'm pretty sure the .o files produced by gcc on cygwin are the same as the .o files produced by gcc on Linux. I expect that the link step on cygwin produces different binaries, but generally gcc isn't used to invoke the linker (on non-toy projects, anyway).

      I actually have been able to use distcc with a cygwin box doing some of the building for my Gentoo system. It seems to work fine for some packages but fail for others.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    4. Re:Gentoo has that covered by Helamonster · · Score: 3, Informative

      Just last weekend I set up distcc via cygwin on 3 PCs to help my Gentoo box compile. Unfortunately, I wasn't able to successfully compile the cross compiler under cygwin, so I used a pre-built version, available under the Gentoo forums thread linked below. It seems to work well so far, although the Windows boxes are definitely slower than equivalent Linux boxes. But as they are not my computers to begin with, I won't be complaining anytime soon ;)

      Gentoo has a HOWTO entitled:
      "HOWTO: Use a Windows box as a distcc server for linux."

      http://forums.gentoo.org/viewtopic.php?t=66930

    5. Re:Gentoo has that covered by Brandybuck · · Score: 1

      The portage system will use this feature automatically.

      Really? I just plug a gcc-containing system into the network and Gentoo magically discovers and utilizes its compiler? Wow!

      Or is some new definition of "automatically" that I wasn't previously aware of?

      --
      Don't blame me, I didn't vote for either of them!
    6. Re:Gentoo has that covered by Sexy+Commando · · Score: 1
      Or is some new definition of "automatically" that I wasn't previously aware of?

      Yes.

    7. Re:Gentoo has that covered by Synn · · Score: 1

      By "automatically" the guy meant that portage is built to use distcc if you simply flip a switch in it's config file. The packages are even written to not use distcc for those pieces of software that won't compile correctly under it.

      So in the Gentoo world, yeah, that's pretty friggen automatic.

    8. Re:Gentoo has that covered by mrchaotica · · Score: 1

      Actually, that's not as magical as you think it would be - Macs already do that (at least in XCode; I would hope command-line gcc does too). If you consider that they just released Rendesvous for Linux, I would expect Gentoo to do that in the near future.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    9. Re:Gentoo has that covered by Trejkaz · · Score: 1

      I was always thinking that would be a nice laugh. In a company with 100 largely-unused Windows computers, the lone Gentoo user could have a ball.

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
    10. Re:Gentoo has that covered by Brandybuck · · Score: 1

      Aaah! So you have to install a special daemon that keeps track of other Gentoo systems on the network. I was right, this WAS a new definition of "automatically" I had never heard of.

      Sheesh. I can understand this with the Mac, because Macs install everything plus the kitchen sink. And I could understand it with Fedora, Mandrake and SuSE as well. But Gentoo?!?!? Isn't this a minimalistic system? Isn't it a system where nothing gets installed but what you tell it to install? So where does this Rendezvous-like functionality come from?

      --
      Don't blame me, I didn't vote for either of them!
    11. Re:Gentoo has that covered by mrchaotica · · Score: 1
      Well, of course installing the thing isn't automatic, the automatic part is this:
      Rendezvous lets you create an instant network of computers and smart devices just by getting them connected to each other. The computers and devices take over from there, automatically broadcasting and discovering what services each is offering for the use of others.
      (from here, and emphasis mine)

      So, assuming you have two computers with distcc and rendezvous installed, you can just connect them together physically (either ethernet or 802.11, or whatever), then they'll automatically use distcc.

      Of course, this is hypothetical anyway; AFAIK Gentoo doesn't have it yet (they only announced Rendezvous for Linux less than a week ago, after all!) But it would be a huge feature -- typing "emerge distcc" is easy, but configuring it to see the other computers and actually work is more difficult (although, since another poster said "just flip a switch in the config file", I might have done something wrong).
      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    12. Re:Gentoo has that covered by Brandybuck · · Score: 1

      Gentoo doesn't have it yet

      Which just happens to be my whole point!

      --
      Don't blame me, I didn't vote for either of them!
    13. Re:Gentoo has that covered by mrchaotica · · Score: 1

      Damn, you're bitchy! I said that in my first post; I assumed you bothered to read it: "I would expect Gentoo to do that in the near future". It was hypothetical from the beginning!

      I should have known from your second post, but NOOOO -- I was trying to be NICE, since you asked me a question, but all you wanted was to have a pissing contest or something.

      All you people complain about "Gentoo Zealots" (and I am not one, by the way), and now you've become some sort of Anti-Gentoo Zealot.

      Fucking HYPOCRITE! It's petty jerks like you that give Slashdot a bad name!

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    14. Re:Gentoo has that covered by Anonymous Coward · · Score: 0

      linux:
      $ gcc -c foo.c
      $ file foo.o
      foo.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped

      cygwin:
      $ gcc -c foo.c
      $ file foo.o
      foo.o: 80386 COFF executable not stripped - version 30821

      You could build an i686-pc-linux-gnu cross compiler for cygwin, though.

    15. Re:Gentoo has that covered by Brandybuck · · Score: 1

      I see I've caught you on a bad day. Did your dog die, or have you gone cold-turkey?

      --
      Don't blame me, I didn't vote for either of them!
  13. gcc or another compiler by Anonymous Coward · · Score: 0

    Shouldn't you be using another compiler than gcc
    if you want faster apps?
    As far as I know, gcc is not the fastest, most
    optimized compiler that is available?

    1. Re:gcc or another compiler by Anonymous Coward · · Score: 0

      Optimizing code and a fast compiler are two different things.

  14. This is news? by EvilTwinSkippy · · Score: 0
    I've been using DISTCC for almost a year for my Gentoo builds.

    File under "old news".

    --
    "Learning is not compulsory... neither is survival."
    --Dr.W.Edwards Deming
    1. Re:This is news? by Bertie · · Score: 1

      (Obligatory)

      Is it finished yet?

      Ho ho.

      (Incidentally, I'm typing this on a Gentoo machine. It's the daddy, it really is)

    2. Re:This is news? by EvilTwinSkippy · · Score: 1

      It would have been, but they unmasked a new release of GLIBC and QT...

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
  15. Productivity Gains My Arse by Anonymous Coward · · Score: 2, Insightful

    Any application I have to compile before using with the 'correct optimizations for my machine' will take more time to get up and running than any 'productivity gains' it might produce. This is why Linux is still not accepted by mainstream computer users. They don't care how it works, just that it does.

    1. Re:Productivity Gains My Arse by tmbg37 · · Score: 1

      Who says that mainstream computer users have to compile all their apps from source? This is what binary packages are for, the end user can choose between them.

      --
      This comment was thought up very late at night and does not necessarily reflect my views at a more reasonable hour.
    2. Re:Productivity Gains My Arse by JohnFluxx · · Score: 1

      Yes. Linux isn't accepted because some people recompile their programs. Wow what brilliance you have, AC.

    3. Re:Productivity Gains My Arse by XO · · Score: 1

      And, most of them don't even care about that, just witness how many people in the world use substandard crappy software.

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    4. Re:Productivity Gains My Arse by Anonymous Coward · · Score: 0

      Any application I have to compile before using with the 'correct optimizations for my machine' will take more time to get up and running than any 'productivity gains' it might produce. This is why Linux is still not accepted by mainstream computer users. They don't care how it works, just that it does.

      Well said by a truly bored person who has nothing better to do than watch programs compile. Really, if the program takes a while to compile, like WINE, who sits through the whole thing? I get up and take a needed break or read something. If the program doesn't take a while to compile, not much is lost. Either way, the time when I need to use the program is far more valuable than the time when I install the program. And about mainstream use: if a person doesn't mind an application running slowly, he/she won't mind a slower install.

      On less related note, I'm surprised no distro's made the blaringly obvious step of having .tar.gz and .tar.bz2 files run ./configure, make, and make install in a nice GUI by default.

    5. Re:Productivity Gains My Arse by gl4ss · · Score: 1

      are you just stupid or ac because your karma got too low?

      if 'productivity' is dependant on compile time then anything to speed it up is useful.

      It's quite hardcore to develope in c or c++ if you never compile anything.

      --
      world was created 5 seconds before this post as it is.
    6. Re:Productivity Gains My Arse by Anonymous Coward · · Score: 0

      "Any application I have to compile before using with the 'correct optimizations for my machine' will take more . . . . "

      You have no idea what you're talking about do you?

    7. Re:Productivity Gains My Arse by Anonymous Coward · · Score: 0

      "I'm surprised no distro's made the blaringly obvious step of having .tar.gz and .tar.bz2 files run ./configure, make, and make install in a nice GUI by default."

      I'm surprised you haven't realized the blatantly obvious negative implications of this. It would fail constantly as many of the archives being passed around in those files formats are not applications that need to be compiled in such away. Furthermore, many people want to include flags in the install command and many applications require a slightly different setup process.

    8. Re:Productivity Gains My Arse by Anonymous Coward · · Score: 0

      If you had to compile X or OO.org on a daily basis, you'll sure as hell wish you had distcc.

      Obviously, this is for people that need to compile tons of stuff, and do it often. I'm not one of them, so I don't use it. Frankly, I don't have enough computers to make it worthwhile.

    9. Re:Productivity Gains My Arse by Anonymous Coward · · Score: 0

      I'm sorry. I should have specified I meant desktop distros. Now to nitpick a post apparently made by someone less than fourteen years old.

      It would fail constantly as many of the archives being passed around in those files formats are not applications that need to be compiled in such away.

      I said that it should run as an executable "by default." If you want to extract, you can still right-click->extract. And it's not too difficult for a program to see if the archive contains a configure or makefile. If one of those files is in the archive, go for installing. If they're not in the archive, open the archive.

      Furthermore, many people want to include flags in the install command and many applications require a slightly different setup process.

      People who use flags are using the command line, so this GUI will not apply to them. People who want stuff to "just work" will gain from this kind of a program; I see no losers.

    10. Re:Productivity Gains My Arse by Trejkaz · · Score: 1

      It would be even better if everyone distributed something like GoboLinux's recipes or Gentoo's ebuilds, instead of distributing the source packages. Then you really could just double click on the ebuild to install the application. It should be a trivial GUI to write, actually... actually, what GUI? I guess it could show the progress or the log while it's working or something.

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
  16. false savings by Yojimbo-San · · Score: 5, Insightful

    Compare the speed cost of loading a "generic" binary to an "optimised" one, multiply by the number of times you load that binary.

    Then look at the time required to compile the optimised copy.

    How often, in the lifetime of a particular version of a binary, do you really need to reload it?

    The promise of distcc is closely related to source distributions like Gentoo. The benefit is overstated. Don't waste your time.

    --
    Quick wafting zephyrs vex bold Jim
    1. Re:false savings by gregmac · · Score: 1

      The promise of distcc is closely related to source distributions like Gentoo. The benefit is overstated. Don't waste your time.

      Like many code optimizations, this sounds like one of those things that you spend a lot of time on when really, you can spend a few dollars and buy the next faster up processor to get the same gain. Not really worth it, espessially if the amount of money you're getting paid (assuming you're getting paid) is greater than or equal to the cost of the upgrade..

      --
      Speak before you think
    2. Re:false savings by petabyte · · Score: 2, Interesting

      Yes, you're trolling but I feel the urge to bite. Gentoo really isn't about CFLAGS. Its about USE flags. I can build programs as I want with whatever options I want. Portage takes care of the dependencies and my systems are _exactly_ as I want them to be.

      If you like binaries, fine, there's no shortage. You use what you want, I'll use what I want. Keep your insults to yourself.

    3. Re:false savings by gl4ss · · Score: 2

      I would have supposed that 'boosting up productivity' would have referred to using distcc to make faster builds of something that you're actively developing and thus need to compile dozens of times per day perhaps.

      in this kind of scenario distcc can be really useful, cheapo clustering power.

      --
      world was created 5 seconds before this post as it is.
    4. Re:false savings by Yojimbo-San · · Score: 1

      No, I wasn't completely trolling ...

      Many people react to distcc by thinking that they need to find large gobs of code to compile, or there's no point distributing. Then they decide that the OS is the thing to compile, and they end up (correctly) with Gentoo (although possibly for the wrong reasons).

      After all, they have loads of old machines running Linux around the house, doing nothing, so they may as well be used to compile ...

      But that whole scenario is a false saving. It's a great learning exercise, and has value that way, but it's not a magic bullet to "performance" and efficiency.

      I'm generally happy taking Debian's packages. I occasionally want to build their packages with different options, so I have to grab the source, build it, and make a deb for my own repository to farm out. I guess Gentoo would make that part of my life easier :-)

      --
      Quick wafting zephyrs vex bold Jim
    5. Re:false savings by petabyte · · Score: 1

      But that whole scenario is a false saving. It's a great learning exercise, and has value that way, but it's not a magic bullet to "performance" and efficiency.

      This I agree with. I spend some time in #gentoo arguing with people new to game that -march=blah -O2 -pipe is fine. The use -fobliterate-regparms-nstacks-nstuff isn't really going to benefit anyone. Of course the same people have their boxes overclocked and then wonder why gcc can't compile programs.

      Some people like gentoo, others don't want to be bothered trying to keep the system up to date and move off to slackware or somesuch. If nothing else the install procedure gives them some idea how everything runs.

    6. Re:false savings by Anonymous Coward · · Score: 0

      It's not "false savings" in my case. We compile ParaView frequently during development. It's over 1200 C++ classes and takes at least an hour to compile from scratch on a fast machine. Even small changes to a single header file can cause large numbers of files to be recompiled. And we like to run continuous, experimental, and nightly builds (with DART) for testing purposes. Since we run ParaView on clusters, it's nice to be able to build in parallel, too. With the demise of pmake, it's good to see some open source tools for distributed compilation being developed. distcc isn't ideal (cpp and ld must be run on the head node and there can only be a single head that passes does load distribution), but it's a lot better than being stuck on a single node.

    7. Re:false savings by fermion · · Score: 1
      First, the post is not talking about loading, it is talking about the locally compiled code running faster, which, presuming it is true, will result in some cost savings.

      However, whether this is a real economy was the first thing I thought of. There is issue of computer time, labor, and even quality control. Such cacluations are extremely complicated, but estimates are generally possible.

      Given the estimate, one can say how long the program will have to run to payback the initial outlay. Once done we can ask if the software be running that long? For instance, will an update, that will require a new build, be released prior to the payback date?

      BTW, I do not undersand the statements elsewhere about buying a faster CPU. The CPU would likely speed up some of the program, but might no take into acount stream optimization, for instance. Also, a faster CPU would certainly make the build faster, which would reduce the payback time. It would seem both of these would work in tandem to help the firm design a suitable solution. The cost of the CPU, and installation, testing, ets, would have to be justified, just like the cost of the local build. Perhaps the local build is cheaper that the new kit.

      --
      "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
    8. Re:false savings by Anonymous Coward · · Score: 0
      How often, in the lifetime of a particular version of a binary, do you really need to reload it?


      True. And how often, in the life of your car, do you really need to use the cheese grater?

    9. Re:false savings by GimmeFuel · · Score: 1
      This I agree with. I spend some time in #gentoo arguing with people new to game that -march=blah -O2 -pipe is fine. The use -fobliterate-regparms-nstacks-nstuff isn't really going to benefit anyone. Of course the same people have their boxes overclocked and then wonder why gcc can't compile programs.

      I'd recommend -Os instead of -02. It's all the -O2 optimizations, except for the ones which increase code size. The end result is slightly slower binaries that are often significantly smaller, meaning they fit better into cache, which often can outweigh the loss of some optimizations.

    10. Re:false savings by boots@work · · Score: 1

      cpp is very cheap to run; you can go up to about 20 helper machines before the client runs out of CPU to run the preprocessor.

      ld is more of a problem, because it can take a long time to run and is hard to parallelize. But for many programs there are only a few linker invocations right at the end, so doing them locally doesn't hurt too much.

    11. Re:false savings by GimmeFuel · · Score: 1

      Have you looked into ccache as well? It caches compiled code, so parts of your project that haven't been updated don't get rebuilt again.

    12. Re:false savings by boots@work · · Score: 2, Insightful

      Insightful, or Troll? The eternal question....

      The promise of distcc is closely related to source distributions like Gentoo. The benefit is overstated.

      The promise has nothing to do with Gentoo. distcc was released before Gentoo was well-known, and is useful to people who never run Gentoo.

      You see, some of us actually develop our own software, rather than building distributions from source. If you write your own code in C or C++, you need to compile it, probably many times per day. If you work on large projects, getting builds done in seconds rather than minutes can make the whole development process more pleasant.

    13. Re:false savings by dvdeug · · Score: 1

      Keep your insults to yourself.

      How about polite discourse? I didn't perceive the original poster as insulting at all, be he right or wrong.

      Gentoo really isn't about CFLAGS. Its about USE flags. I can build programs as I want with whatever options I want. Portage takes care of the dependencies and my systems are _exactly_ as I want them to be.

      How many programs do you really need fine-grained control over? It's not really a misery to have an extra 100k library or two that you don't really need around, and most programs don't have that many compile-time options to mess with. For those that do, it's not much of a problem to recompile them in Debian or most binary-based distributions.

    14. Re:false savings by Torne · · Score: 1

      -Os is not just -O2 without size-increasing optimisations. It also includes size-decreasing optimisations which can decrease speed further still. The speed difference between -Os and -O2 is actually quite dramatic.

      Most binaries don't usually have working sets sufficiently large to make much difference, given that modern CPUs have huge caches. =)

    15. Re:false savings by Gordonjcp · · Score: 1

      Well, optimised compiling would make the difference between, for instance, mplayer running on a machine perfectly well, or not running at all. If I compile for i486, it won't play back Divx on a P2-350. If I compile for P2, it's perfect even at fullscreen.

    16. Re:false savings by Anonymous Coward · · Score: 0

      Of course there's a savings. You don't just sit there and do nothing while compiling. There's this thing known as multi-tasking. As long as you don't need the software five minutes from last week, there's little cost to taking the time to compile with optimizations. It's basically "free" time. By taking the time to do the compile when you don't need the software, you save time later when you do need the software.

  17. Less and less necessary in the future by Mnemia · · Score: 2, Interesting

    Personally, I think that distcc will become more and more useless as computers get faster. My new machine (P4 2.8, 1 GB RAM, SATA drives) can compile a complete Gentoo desktop system in just about two hours. That's pretty damn cool considering that it used to take like 24 on my old laptop when I first started using Gentoo several years ago. It would probably only take about an hour to setup a server system on Gentoo on my same machine since the biggest component, X, would not need to be compiled.

    Computing power is outstripping the size of source code that needs to be compiled. Soon there will be little difference in install time between the source and binary distros, and all the jokes about Gentoo's compile time will be pretty much obsolete. Already, once you have your system installed, the time required to keep current/install new apps is minimal. My system can compile any new program (except maybe OpenOffice) in under 25 minutes. Even Mozilla can be compiled in that time.

    1. Re:Less and less necessary in the future by ThisNukes4u · · Score: 5, Insightful

      There are still enterprise uses where coders need to compile huge projects from scratch that take too long on a single workstation. Instead of that build taking 15 minutes on a single workstation, they can tap the power of all the workstations and build it in a few minutes or perhaps even seconds.

      --
      thisnukes4u.net
    2. Re:Less and less necessary in the future by Anonymous Coward · · Score: 0

      Mine can't. I've got a headless 1.8GHz Athlon and a duff Celeron notebook on the network, precisely so that I don't have to wait 3 days for my main work machine, which is now the oldest machine in the house at a stately 600MHz, to install anything recent. So yeah, the average machine may be getting faster, but individual computers need all the help they can get. Why don't I buy a new machine? I don't need to spend the cash! Why waste my money on a Bright Shiny New My Heatsink's Bigger Than Yours radiator, when thanks to the efforts of people like those that put together distCC, I can buy beer instead, and still compile faster than I can think as well, which, depending on the cash/beer ratio may not actually be that fast, but you get the point.
      Oh yeah. And 640K should be enough for anyone.

    3. Re:Less and less necessary in the future by evilviper · · Score: 3, Interesting
      Soon there will be little difference in install time between the source and binary distros

      As your CPU gets faster, installing the binary will be quicker too.

      But most of all, you will see programs getting a Mozilla complex... Lots and lots of bloat, with no effort going into optimizing anything. KDE and GNOME have that problem. Even formerly lightweight programs like XFce are now heavy programs (thanks in no small part to the bloat of GTK2).

      If processing power continues to rise, pretty soon you'll see programming becomming far sloppier, and waste a lot more time. Sure, you can compile mozilla in under 25 minutes now, but you could do the same with other browsers before Mozilla, when slower CPUs were king. When Mozilla 2 comes along, it'll be massive, and we'll be back where we started. Telling people to waste tons of money on new hardware, rather than paying a bit larger salary for a better programmer than can make a full-featured browser that will run on a 100MHz processor. Think about it, is there anything fundamental that Mozilla can do that Netscape 3 couldn't?
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    4. Re:Less and less necessary in the future by Phleg · · Score: 1

      Take a closer look--you're probably kidding yourself. Mozilla in binary form is a few megabytes, which is no more than a minute or two download. From source, add in the source download to the compile time, and you're way beyond that.

      In my work environment, we like to be productive. Taking a thirty minute break while new software compiles does not fit that criteria, when you could have spent five minutes downloading the software, and be configuring it for the twenty-five minutes left.

      --
      No comment.
    5. Re:Less and less necessary in the future by Jeremy+Erwin · · Score: 1

      Think about it, is there anything fundamental that Mozilla can do that Netscape 3 couldn't?

      I can see that this argument is going to hinge on a redefinition of "fundamental." Nevertheless, Netscape 3 is closed source, and doesn't support CSS.

    6. Re:Less and less necessary in the future by Anonymous Coward · · Score: 0

      "hat's pretty damn cool considering that it used to take like 24 on my old laptop when I first started using Gentoo several years ago."

      Several Years ago? Gentoo is only like two years old.

    7. Re:Less and less necessary in the future by lpontiac · · Score: 1
      Personally, I think that distcc will become more and more useless as computers get faster. [...] on there will be little difference in install time between the source and binary distros,

      Some of us are actually writing code, compiling it, testing, editing, recompiling, test again, edit some more, recompiling... rather than just downloading someone else's code and compiling it once.

    8. Re:Less and less necessary in the future by boots@work · · Score: 2, Interesting

      It's more likely that programmers will just use languages that waste machine time but save programmer time.

      On the other hand the death of C or C++ has been predicted for about 20 years now, and it's still pretty popular. So I don't think large C packages will go out of style any time soon.

    9. Re:Less and less necessary in the future by Mnemia · · Score: 1

      "Two" counts as several. And I've been using Gentoo for longer than that (I started before the 1.0 version was released). I started using it in December 2001.

    10. Re:Less and less necessary in the future by Anonymous Coward · · Score: 1, Informative

      Yes there is lots Mozilla can do that Netscape 3 couldn't. CSS, proper rendering (gasp), the myriad of tags that have been added to HTML since those days, lots of new Javascript abilities (did NS3 even have Javascript?), and so on. It might not fully excuse the bloat, but its not as bad as you make it out to be. Things HAVE gotten more advanced.

    11. Re:Less and less necessary in the future by evilviper · · Score: 1
      Netscape 3 is closed source

      I think you misunderstood my point... I was trying to point out that Mozilla is just bloated. Those CPU cycles aren't being used to accomplish anything, they are just being wasted. I'm looking for fundamental differences in functionality that would justify it being a huge, CPU-crunching, memory hog.

      and doesn't support CSS.

      That's something, but adding CSS support to Netscape 3 wouldn't cause it to baloon to Mozilla's size.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  18. Speeding up compile times by Anonymous Coward · · Score: 2, Interesting

    Well, as someone who recompiles FreeBSD/DragonFly quite frequently, I've got to say that the best way to reduce the time it takes is to build eveything in a ramdisk. I've cut 100 minute compile times down to about half an hour by mounting /usr/obj in a ramdisk instead of on my hard drive.

    http://bsdvault.net/sections.php?op=viewarticle&ar tid=53

    1. Re:Speeding up compile times by Anonymous Coward · · Score: 0

      I've done that (or something rather similar--gcc likes to spew enormous intermediate, very transitory files into /tmp, so I have that mounted on a tmpfs ramdisk on my Linux box). Problem is, it's only 256 MB, which is usually good enough, but I remember one crazy Glade-based program that wanted to eat 1 GB of temp space. When you consider that this is for a single .o file, that's crazy, and probably has more to do with the application + Glade rather than the general approach. However, you're always going to be able to set aside a larger amount of disk space for temporary stuff than virtual address space, so for some people, I imagine they might have problems.

    2. Re:Speeding up compile times by ceswiedler · · Score: 1

      Doesn't that say something about the buffer cache on the OS (FreeBSD?) you're compiling on? It really shouldn't be that much different. At the very least you should be able to tune the cache to effectively use all available RAM, which is basically the same thing as a RAM disk.

    3. Re:Speeding up compile times by Anonymous Coward · · Score: 0

      Similar speedups have been found while compiling software in Linux ramdisks. If this really is a problem, it's universal.

  19. But ... by Eru-sama · · Score: 1, Funny

    how long does it take to compile "Hello World"?

  20. distcc and rendezvous by brucehoult · · Score: 4, Interesting

    We use the distcc that Apple distributes with XCode even though we dont' use XCode itself. It really helps to get a few dual-CPU G5's working!

    The cool thing about Apple's version is that by default it uses Rendezvous to determine which machines are available to distribute work to.

    1. Re:distcc and rendezvous by Anonymous Coward · · Score: 0

      Huh, I had no idea distcc is what Apple used for cluster compiles. Since Apple is making their mDnsResponder available for Linux, it shouldn't be too hard to add advertise a "distcc" service from your Linux box. You could even use mDNS to specify the versions of gcc a machine had available for use.

      Does anyone know how Xcode advertises distcc over Rendezvous so we could be compatible with their implementation? Does it advertise architecture/OS/compiler versions? Is that a security problem? :-)

    2. Re:distcc and rendezvous by boots@work · · Score: 1

      Yes, it's a security problem. Someone on your network segment can fuck with your builds. Don't turn it on unless you trust your network.

    3. Re:distcc and rendezvous by RockinRobStar · · Score: 1

      I have set up a sourceforge project at http://sourceforge.net/projects/zeroconfcompnts to encourge people to support zeroconf (aka Rendezvous) on Linux/BSD. DistCC is on the list of 'todo' apps.

  21. No, no, no! by JustinXB · · Score: 2, Interesting

    Reducing compile time by distributing the load isn't reducing it all, it's just distributing it. Try using a compiler that compiles fast -- such as Plan 9s compilers.

    1. Re:No, no, no! by evilviper · · Score: 3, Insightful
      Try using a compiler that compiles fast -- such as Plan 9s compilers.

      Well, that won't help anyone, since almost nobody runs Plan 9.

      Also, advising people to use faster compilers is bad advice. The point is to make the application faster, and the slower the compile, the faster the application is likely to run. eg. GCC2 vs GCC3

      Reducing compile time by distributing the load isn't reducing it all

      Yes, you are reducing the time it takes to complete the process. It doesn't reduce CPU-time, it reduces real-time. You know, the real world, in which we live... The only thing that really matters.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    2. Re:No, no, no! by JustinXB · · Score: 1
      Compiling with -03 to drip 0.03% faster run time is not worth it. For most applications, the 10% difference between optimizations in GCC doesn't matter at all.

      I'd take a quick compile over fast execution of code in most situations.

    3. Re:No, no, no! by evilviper · · Score: 3, Insightful
      I'd take a quick compile over fast execution of code in most situations.

      I wouldn't. I compile my programs once, then use them for MONTHS on end. Even a tiny speed improvement in something like Mozilla will save a HUGE ammount of time overall, and by far make up for the compile time.

      When I am programming, I'll disable ops so I can test my changes quicker, but that's not what we are talking about here...
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    4. Re:No, no, no! by F2F · · Score: 1

      I compile my programs once, then use them for MONTHS on end.

      And then they spend most of their time waiting for IO.

      Only in HPC do you ever look for ultra-optimized code and even then you end up running your code twice (or more) to verify your answer.

      Most machines (including yours) are running at load levels way below 1 (unless they aren't dedicating wasted cycles to SETI or somesuch, which itself confirms they have cycles to waste).

      Plan 9's compilers may produce 20% slower code, but when a (true) developer sees 10 times decrease in compile time they immediately realize the benefit. Just ask DeRaadt or Viro whether they would prefer a kernel compile in 8, 80 or 800 seconds (and guess which one they get with Plan 9's C compilers).

    5. Re:No, no, no! by NuShrike · · Score: 1

      Oh no! You better tell them folks at Seti, and Folding@Home, Distributed.net, and theGrid, etc etc...

      I'm sure they'll appreciate this obvious wisdom.

    6. Re:No, no, no! by boots@work · · Score: 1

      Of course the Plan 9 compiler couldn't actually build the Linux or BSD kernel, which is a slight drawback to your otherwise clever plan...

      distcc gives you sub-minute builds, without needing to rewrite your whole kernel into a new C dialect. Sounds like a good deal to me.

    7. Re:No, no, no! by F2F · · Score: 1

      nothing but gcc can compile the linux kernel anyway :)

      sure you can get sub-minute compile times with 1024 machines at your disposal -- it's an embarrasingly parralel problem. you can even get less than 10-second compile with a 32way pSeries p690. at what cost, though?

    8. Re:No, no, no! by JustinXB · · Score: 1

      You are missing the point: The compiler isn't actually faster. With SETI, Distributed.net, or whatever, each client isn't very fast, there just happens to be a lot of people using the client.

    9. Re:No, no, no! by boots@work · · Score: 1

      nothing but gcc can compile the linux kernel anyway

      So it's a bit silly to suggest using another compiler, isn't it? Personally I find /bin/true is even faster than Plan 9, when I don't care about the results. :-)

      I don't think "embarrassingly parallel" means what you think it means, because compiling the kernel clearly is not such a problem. There are dependencies between tasks, only a limited number of tasks can be issued at a time and the whole thing ends up in two big links that can't be parallelized at all. In that benchmark, you end up with all but one CPU idle for the last second or so.

    10. Re:No, no, no! by F2F · · Score: 1

      I've seen "non-embarrassingly parralel" tasks and, believe me, compiling a kernel isn't one. Proof: distcc for Plan 9 is implemented in 10 lines of shell code.

      BTW, I wasn't suggesting Ken's C compilers for Linux, not at all -- Linux can have gcc (and distcc for that matter), for they deserve each other :)

      Don't get caught offguard by the snide remarks. If you think P9 is elitist then you're quite right -- the compilers were designed and written by Ken Thompson, the gui and editors by Rob Pike, the networking code by Dave Presotto, the group manager was Dennis Ritchie. With such a team you're guaranteed to end up with a well thought-out system, compared to which such puny hacks as distcc seem a waste of time and lack of vision.

      Sure, nobody's using it. Everyone tries to emulate it, though. Unsuccessfuly.

    11. Re:No, no, no! by boots@work · · Score: 1

      That doesn't look like a proof to me. It looks like you don't understand the definition (or spelling) of "embarrassingly parallel". Maybe you should ask Ken.

      So you have a beautiful operating system which no one will use, but which you continue to loudly insist is superior. Great, I'm very happy for you. Please join the VMS, Amiga and BeOS trolls and play amongst yourselves.

    12. Re:No, no, no! by boots@work · · Score: 1

      You know, there are few better ways to turn people off Plan9 than to say that every other project sucks. If you want to make sure p9 continues to be ignored, you're doing just the right thing.

      I've had a good impression of Plan 9 since I first read about it >10 years ago... until I read your post history. Congratulations.

    13. Re:No, no, no! by evilviper · · Score: 1
      And then they spend most of their time waiting for IO.

      Could have fooled me. 'top', and all other system monitoring programs must be lying to me, since you're absolutely sure I'm IO bound. Encoding to MPEG-4 from a DVD must be IO bound, despite the fact I'm reading from a 16X DVD-ROM at about 1X, and writing about 1GB to disk over the course of 4 hours. Right, IO bound.

      Most machines (including yours) are running at load levels way below 1 (unless they aren't dedicating wasted cycles to SETI or somesuch, which itself confirms they have cycles to waste).

      Approximately 3/4 of the time my multimedia system is running, the CPU is maxed-out, encoding. A 50% reduction in effeciency is not tolerable.

      Let's assume that I'm only maxing out my CPU half the time, and a faster compile will only cost me 10% performance improvement. Well guess what, that's a couple minutes saved in the compile, and HOUR AFTER HOUR wasted in video encoding after the fact.

      Just ask DeRaadt or Viro whether they would prefer a kernel compile in 8, 80 or 800 seconds (and guess which one they get with Plan 9's C compilers).

      Yes, they would prefer quicker compiles while they are developing the programs. However, when it comes time to compile something you aren't developing... something you are going to use... you spend the extra time with the slower compiler to make something that is much more optimized. You go ask DeRaadt if he would ship an OpenBSD CD that was compiled 50% faster, at the expense of 10% performance loss, and/or 10% larger filesize.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    14. Re:No, no, no! by Anonymous Coward · · Score: 0

      "Also, advising people to use faster compilers is bad advice. The point is to make the application faster, and the slower the compile, the faster the application is likely to run. eg. GCC2 vs GCC3"

      Yeah, having g++ compile faster would be a bad thing. Is it nice on your planet?

      gcc and g++'s performance is embarassingly awful. Having used native language compilers from many other languages (as well as other c++ compilers), they're stupendously inefficient. I think the original poster's right--distcc (which I use daily) is a necessary hack for g++'s unbelievably shitty performance.

      As a mostly relevant aside, WTF is g++ doing with templates that takes so f'ing long? And, god forbid, you do any template meta-programming. It seems to increase compile times exponentially. No sh*t, I once had a (mostly pathological) 20 line program take over 90 minutes to compile on a 700 mhz PIII with 192 MB of RAM.

  22. Yes, it doesn't work with everything... by cbreaker · · Score: 2, Insightful

    Which makes it a pain in the ass if you ask me.

    I have tried to use distcc for a lot of stuff, but it doesn't work on some packages, and that's enough to make me not use it.

    I don't want to have to hand-pick which packages to use it with and which ones to not use it with. Fortunately, a lot of Gentoo packages have a rule built in to not use distcc automatically, but it's not always the case.

    The other thing about distcc is that it won't increase the speed of the compile by any large magnitude with each machine added because the machine performing the actual compile has to do a lot more work then the slaves.

    Unless I was trying to compile something on a REALLY slow machine, I don't bother with distcc.

    --
    - It's not the Macs I hate. It's Digg users. -
    1. Re:Yes, it doesn't work with everything... by Anonymous Coward · · Score: 0

      Unless I was trying to compile something on a REALLY slow machine, I don't bother with distcc.

      Bingo. Whenever I compile anything sizable on my mini-ITX system that I want-right-now, I fire up the workstation for a distCC compile.

  23. Right, whatever by Anonymous Coward · · Score: 3, Insightful

    Precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine

    And there are maybe about ten to fifteen people on all of slashdot who actually know how to go about setting the right optimizations for their own machine.

    1. Re:Right, whatever by Helamonster · · Score: 2, Interesting

      If you have a pretty sticker on the front of your computer that says "Intel inside," "AMD Athlon XP," or whatever, and you can click a button corresponding to that, then you know enough to optimize your binaries ;)

    2. Re:Right, whatever by Anonymous Coward · · Score: 0

      I have a sticker that says "Intel inside: AMD Athlon C3", you insensitive clod!

    3. Re:Right, whatever by Anonymous Coward · · Score: 1, Funny

      Agreed, anyone who has enough time to learn a bunch of command line switches for each program they need to compile and BEFORE it even runs needs a girfriend. (not bitter about painting all Canada day weekend *^%^&%^&) If you're writing the code, fine compile it, if someone else wrote it NOBODY CARES! Give me something that works out of the box

  24. Productivity gains if and only if.... by Kjella · · Score: 3, Insightful

    "(...) a distributed C compiler based on gcc, that gives you significant productivity gains."

    Assuming
    a) That compiling will give you any significant performance increase (which I kinda doubt, it's not like the defaults are braindead either)
    b) You don't spend more time mucking about with distCC / compiling than you'll actually use the software
    c) Your software is actually code bound (and not "What do I type/click now?" human bound, or bandwidth bound or whatever)

    I can't think of a single thing I do that's code bound. And I actually do a bit of compiling, but I spend those seconds thinking about what to code next. Either that, or it is bandwidth bound or non-time critical (i.e. does it take 6,5 hours or 7 hours? Who cares. The difference is half an hours work for my computer, 0 for me. So the time I'd spend to improve it is - gasp - 0.

    Kjella

    --
    Live today, because you never know what tomorrow brings
    1. Re:Productivity gains if and only if.... by Anonymous Coward · · Score: 0

      Fine. Don't use it, then. For those of us doing deep trickery inside big packages, it's nice. Really nice. I'll use it, you won't. You don't need to wait half an hour between code iterations, and now neither do I. Hardly even needs commenting on, really...

    2. Re:Productivity gains if and only if.... by evilviper · · Score: 4, Interesting
      I can't think of a single thing I do that's code bound.

      The obvious and most popular answer is encoding video. I think a great many people do a lot of this. Since no processor is fast enough to encode DVD-res video at 16X, it isn't bound by IO speeds either. I can start videos encoding in far less time than it takes to complete the process as well. Pure CPU number-crunching.

      Other applications are any form of crypto. Reduce the time you have to wait for PGP to encrypt. Reduce the delay on your SSH sessions.

      Then there are databases. Sure, they're often IO bound, but it is commonly a CPU limitation.

      Also any heavy-load service. If apache is serving lots of threads, especially PHP/Perl compiled pages, you are going to be maxing out your CPU.

      Then there are the programs that are just bloated. Mozilla/Firefox is still quite slow, and I can open pages far, far faster than they can be rendered. Anything that makes it even 1% faster is very welcome, as those savings eventually add-up to large ammounts of time.

      If you really never use any of those, hooray for you, but most people certainly do.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    3. Re:Productivity gains if and only if.... by Chris_Jefferson · · Score: 1

      If you spend your time working on large pieces of software and occasionally need to do a clean compile, then distcc can make the difference between waiting 20 minutes to recompile and 8 minutes (I use the 4 computers around the house, and don't quite get a quarter, but it's close enough for me).

      Just beacuse distcc isn't useful for you doesn't mean there aren't people who do a large amount of compiling and therefore find it very useful.

      --
      Combination - fun iPhone puzzling
  25. Any advice on flags for K6-2 CPUs? by whoever57 · · Score: 1

    I have 2 machines with K6-2 processors. Currently, I use "-Os" because I have read that reducing the code size can improve perfomance better than "-O3" on machines with small caches.

    Does anyone have any advice about this? Are there any objective comparisons that relate to my configurations?

    --
    The real "Libtards" are the Libertarians!
    1. Re:Any advice on flags for K6-2 CPUs? by EvilTwinSkippy · · Score: 2, Informative
      Fagetaboutit

      O2 is your best all-around setting. Os does make smaller code, but the stuff it outputs is slower. It also causes weird problems with certain apps. It could be useful to condense the memory footprint of properly designed code (like GlibC.) But remember, decreased memory footprint=more hoops the computer has to go through. Think of it like employing fold out-tables. Sure it saves space, but you spend time folding it and unfolding it.

      O3 is a waste of time, except for certain scientific computing apps, or apps where you don't mind blowing out your memory for the sake of speed (i.e. games).

      --
      "Learning is not compulsory... neither is survival."
      --Dr.W.Edwards Deming
    2. Re:Any advice on flags for K6-2 CPUs? by Jeremy+Erwin · · Score: 1

      Getting more memory is often cheaper than springing for a new cpu.

    3. Re:Any advice on flags for K6-2 CPUs? by Anonymous Coward · · Score: 0

      That's not the point. That's slow main memory which is generally going to be running 100's of cycles slower than the cache memory. Most programs actually execute almost completely in the CPU cache, only pulling code in from main memory every few 100, 1000, or even 1000000's of CPU cycles. Running exclusively from main memory will make your computer run like a 486--try disabling the CPU cache in your BIOS to see what I mean.

    4. Re:Any advice on flags for K6-2 CPUs? by Jeremy+Erwin · · Score: 1

      try disabling the CPU cache in your BIOS to see what I mean.

      It's how I play "Pirates Gold" on my PowerMac. Good way of slowing down the 68040 emulator. Of course, 68040 emulator performance is a special case-- it did lead Apple to eschew the somewhat respectable, but cache poor PPC 603 for the PPC603+.

      Shutting off the L3 cache normally results in a 10 percent penalty; the L2+L3 cache, a 33% penalty. But I do think that this exaggerates the effect of potentially bloated code. It's not as if netscape fits in a 256 K cache.

  26. It's news to some people by cbreaker · · Score: 4, Insightful

    It's news to people that don't read slashdot every day.

    I don't mind revisiting older topics once in awhile - it's only annoying when it's two days in a row. And even then, it's not that big of a deal, I simply pass over it.

    Posts like this are more waste of space then then a duplicate article post, and you get a lot more posts like yours then we do dupes. It's especially annoying when people say "We talked about this TWO YEARS AGO!!!" Well here's some news for you: I don't memorize every slashdot story since the beginning, and there's been a lot of new members since then.

    --
    - It's not the Macs I hate. It's Digg users. -
    1. Re:It's news to some people by Anonymous Coward · · Score: 0

      Then you'll love next week's story on this new operating system called Linux.

    2. Re:It's news to some people by JohnFluxx · · Score: 1

      It was discussed earlier this year.. let's repeat all the stories every few months just because some people don't read slashdot every day.

      When I miss slashdot, I just browse the old stories bit for anything interesting. I don't expect the stories to be repeated just for me.

    3. Re:It's news to some people by Anonymous Coward · · Score: 0

      I don't expect the stories to be repeated just for me.

      It sounds like you expect them not to be repeated just for you.

    4. Re:It's news to some people by tuxnduke · · Score: 1
      It's especially annoying when people say "We talked about this TWO YEARS AGO!!!" Well here's some news for you: I don't memorize every slashdot story since the beginning, and there's been a lot of new members since then.

      ..Not to mention the fact that tools such as distcc evolve a lot and maybe even if someone remembers mentioned software/app/tool from an article two years back, it is revealing to hear news about stuff you don't necessarily follow from week to week and read the latest changelogs after every 0.0.1 increment in version number.
  27. Linux (GCC) Compile Times VS MS Compile times? by SmileeTiger · · Score: 3, Interesting

    Other then distributed compiler tools like distcc and nc are there any other ways of speeding up a linux compile with gcc?

    I was blown away when my project group compiled a Qt app that we developed on the Linux platform with the MS VC++ compiler. The compilation took 1/10th the time! We were using Makefiles generated by QMake in both cases.

    Should I just switch compilers? If so does anyone have any suggestions?

    1. Re:Linux (GCC) Compile Times VS MS Compile times? by Anonymous Coward · · Score: 1, Interesting

      gcc is horribly slow and getting slower on each new version. I've browsed the gcc developers list every now and then, and it seems that while everyone agrees that slower compiles are a problem, most developers prefer to work on cool optimization algorithms to speed up the compiler output, rather than optimizing the cleaning up the algorithms they already have to speed up the compiler.

      Apple has put some paid gcc developer hours towards speeding up compiles, but they haven't been able to turn the tide of all other developers adding up fancy and slow algorithms to gcc. That's probably why they integrated distcc to XCode.

      But this reminds me, the intel compiler is supposed to be extremely compatible with gcc and freely available for home use... anyone know if it's any faster than gcc?

  28. As seen on OSNews.com by pixas · · Score: 1

    Story is copy/pasted straight outta' OSNews.com

  29. Speaking of Gentoo ;-) by rd_syringe · · Score: 1
  30. distcc is only workaround to an unsolved problem by Rolman · · Score: 2, Informative

    The problem with compiling your own binaries is that you are effectively forking code from the original distribution at the low level. To do this you really must know what you're doing, and that can be a very difficult thing when working with applications you didn't write yourself.

    Just look at the Linux Kernel Mailing List and how many errors can be traced to a GCC specific version. That's why Linus enforces a standardized compiler environment, developers can't be wasting their time fixing compiler-induced errors.

    I know it's attractive to just recompile your whole distribution to your specific hardware combination because there are real world performance gains, but sometimes there are weird bugs caused by it and you'll probably be out of luck trying to find some documentation on them. What are the chances of somebody having the same hardware configuration? And remember we're not talking about branded components and specific models, we must throw in firmware, drivers, BIOS settings and whatnot into the mix.

    As long as the PC components are not standardized, this problem is never going to be away. I seriously considered Mandrake and Gentoo a couple of times in the past and they had very different bugs on each version every time I tried them. Even though they have gotten better on each release, I'd still refuse to put them on a production machine, there's a reason why every distro ships with a precompiled i386 kernel.

    I, for one, just recompile the most important parts of a system that do require most of the CPU time, like the kernel, Apache, and other runtime libraries whenever I do need that extra punch, not a second before. distcc is a geek tool and has that coolness-factor and all, but I'm not on a frenzy to use it to recompile all my servers' software, I care about stability first.

    --
    - Otaku no naka no otaku, otaking da!!!
  31. Wow! by Brandybuck · · Score: 1

    Wow! My company has been doing distributed compiles for about fifteen years now (with gcc, nonetheless). It's old hat. But along comes some guy telling Gentoo users to use distributed compiles, and suddenly it's the next best thing to sliced bread! This is like the sixth or seventh distcc article I've seen in the last month.

    It's really nice that you guys have discovered this, but don't act like it's something new and amazing, or even that it's something unique to Linux.

    --
    Don't blame me, I didn't vote for either of them!
    1. Re:Wow! by Anonymous Coward · · Score: 0

      Well, have you made your implementation available to everyone? Is it generic enough to work for any project, or does it require lots of Makefile/ssh/etc. configuration? If it's all that and a piece of toast, why not submit a Slashdot story about it instead of complaining that other people are getting all the attention?

  32. Compiling Gentoo for speed.... with gcc? by scheveningen · · Score: 2, Insightful

    Honest question: gcc has the reputation of not producing the fastest code for x86, so why should I bother compiling gentoo with gcc or distcc?
    Does anyone know if there are distro's compiled with, say, the Intel compiler?

    1. Re:Compiling Gentoo for speed.... with gcc? by GammaTau · · Score: 1

      Does anyone know if there are distro's compiled with, say, the Intel compiler?

      I don't know of such distro but at least according to Gentoo documentation Gentoo has some kind of support for icc. I don't know how widely and how well it works. (I've never used Gentoo.)

    2. Re:Compiling Gentoo for speed.... with gcc? by Anonymous Coward · · Score: 0

      A whole distro can't be compiled with icc because the kernel itself can't be compiled with icc. They're working on it, and I even heard that they've gotten the kernel to compile somewhat (though not at production-grade) but the kernel is rather gcc-specific. So much for portable code, I guess, but that never was really the aim, I suppose.

  33. I'm content with .src.rpm, thank you by 21mhz · · Score: 2, Informative

    While I haven't RTFA yet, I find the premise stated in the posting somewhat far-fetched. If I need binaries tuned finer than those provided by binary .rpm's, I can take their respective .src.rpm's and rebuild them. The RPM build system, in the distributions I know, provides a convenient way to override optimization flags via system- or user-settable macros. As for compilation time, it's not an issue for most packages these days, as many Gentoo users here can testify.

    --
    My exception safety is -fno-exceptions.
  34. Say it ain't so! by JUSTONEMORELATTE · · Score: 1

    Today, if the boss catches me reading /. I can say "I only do it during long compiles, honest!"
    This could ruin EVERYthing!

    --

  35. I did this by drawfour · · Score: 1

    1999, my senior project in college. There were 5 of us working on it. We were sponsored by a company that was a subsidiary of IBM (cannot for the life of me remember their name). Our first iteration used TCP/IP for the connectivity between the "master server" and the clients.

    There was no guarantee that your client would be selected for use -- but it could be and was an optional system. It of course used distrubuted file systems for the project. In the end, all the OBJ files were linked together by the machine that initiated the build process.

    We had methods to list what compiler you were using (so only machines with that compiler would be used), we had machine "ratings" so that a faster machine would be more used than a slow one, and were planning on monitoring CPU usage and other things to determine on the fly what machines were suitable. Of course, we didn't have time to do everything.

    The second iteration we took on it (this was all done over a 20-week period, the first 10 weeks design, the next 10 weeks coding), we used CORBA for the inter-machine communication.

    This is also the same project where I stupidy this this.

    1. Re:I did this by drawfour · · Score: 1

      And as soon as I posted this, I remember the name of the company. Tivoli Systems. Was an interesting and fun senior project. :)

  36. Excellent. by base3 · · Score: 1

    It's good to see that commercial-scale compiling is now available to the dedicated hobbyist. This and other applcations of distributed computing have the potential to not only put to some useful purpose the generation or two of old machines from previous upgrades, but to inspire the creation of other distributed applications for them.

    --
    One CPU cycle wasted on digital restrictions management is ONE TOO MANY.
  37. Prebuilt binaries by kieronb · · Score: 1

    I use prebuilt binaries for most applications because it saves the hassle of having to keep recompiling whenever a patch comes out - a quick up2date or apt-get every now and then and all is good.

    The only things I generally recompile are the Linux kernel itself and Apache/PHP, and then only on the production servers where speed is at all an issue - for desktop use the out-of-the-box binaries run just fine, even on my old sub-1GHz machine!

  38. Testing a distro built with the Intel compiler? by FyRE666 · · Score: 1

    I'd be interested to see what speed improvements would be found if say a Gentoo system was built using the Intel compiler (with an intel CPU, obviously ;-) instead of GCC. Anyone tried created RPMs or a whole distro using another compiler?

    1. Re:Testing a distro built with the Intel compiler? by Anonymous Coward · · Score: 0

      Unfortunately much code in a linux system (especially the kernel) *strongly* depends on gcc.

      Some linux magazine here in germany (Linux-Magazin.de) heavily patched the kernel sources to even have it compiled and running (and no guarantees for it to run flawlessly on production systems).

      They only got a 1-20% speed increase over a vanilla kernel compiled with gcc (depending on which kernel function they tested, the 20% being task switches, IIRC)

  39. Pre-compiled by Matt+Perry · · Score: 1
    But this can be a false economy, especially with programs that are used frequently: precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine.
    Not being a programmer, I have to ask, does this matter that much? I mean, other than the kernel or glibc, it seems that most programs spend their time waiting on an event, be it user input or some type of request from another program or service.

    When would it make sense to compile my apps from source and turn on all of the optimization? Would it help much for a desktop user or is it something better suited for someone who has a specific busy task, like a busy web server?

    --
    Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
    1. Re:Pre-compiled by Nicopa · · Score: 3, Funny

      If you fell sad, alone. If you think you are wasting your youth in many lonely nights, then compiling your Gentoo distribution with dedicated and optimizing flags may suit you.

    2. Re:Pre-compiled by anti-NAT · · Score: 1

      Not being a programmer, I have to ask, does this matter that much? I mean, other than the kernel or glibc, it seems that most programs spend their time waiting on an event, be it user input or some type of request from another program or service.

      You're on your way to becoming a programmer, because you are rightly questioning "hearsay" regarding across the board CPU optimisations.

      --
      The Internet's nature is peer to peer - 20050301_cs_profs.pdf
  40. Works well! by Sansavarous · · Score: 2, Interesting

    I've got two Gentoo systems that run distccd.

    I did some non-scientific testing with distcc.

    System one:
    Athalon 1400 XP
    512 Meg RAM

    System two:
    Pentium III 450
    512 Meg RAM

    I compiled GAIM on System one with distccd running on system one and two, also compiled with just distccd running on system one.

    I found that with both systems running distccd I got about a two minute faster compile. Then with just distccd running on system one.

    With distccd running on just system one I found that it would process many of the individual compiles in parallel ah-la SMP, thing is it's a single processor system. I've not tested the time on system one of distccd vs no distccd. I imagine that with the parallel compiles it works faster. It all depends on what you set your -jN to, where N is the number of "systems" X2 +1. I found that with two systems I could run well with a -j of 7. A bit higher then suggested.

    It is correct that many programs that have sensitive builds, XFree and Opera for example, it turns off the -j option. Not a big deal, just means a longer coffee break.

    Distccd has come in very handy when I was installing Gentoo on an old Gateway 2100 Solo laptop. The laptop only has a Pentium 120 and 40 Megs of memory.

    I'd suggest distcc for anyone who does quite a bit of source builds, a must for a Gentoo install!

    --All programmers are playwrights and all computers are lousy actors.

  41. Share the pain! by bender647 · · Score: 1

    I like the idea -- can you tell it not to use your CPU at all so you can browse the web quickly while the rest of the LAN bogs down compiling your kernel?

  42. Wait a sec by EvilStein · · Score: 2, Insightful

    The Anti-Gentoo zealots always say stuff like "It's not going to be faster.." etc etc..

    Now someone is saying: "precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine."

    So, the Gentoo users that are claiming that stuff compiled with the right optimizations *is* faster?

    I'm confused. Which is it supposed to be? Are Gentoo users full of crap, or are they correct?

    I use Gentoo and have found things to be a hell of a lot easier to deal with than RPM based binary distros anyway.
    I just want the scoop. :P

    Oh, distcc has been in Gentoo for a while.. surprised to see it listed like it's a new thing.

    1. Re:Wait a sec by acceleriter · · Score: 1
      Oh, distcc has been in Gentoo for a while.. surprised to see it listed like it's a new thing.

      I'm not surprised it's been there--heck, if anything could benefit from a compile farm, it's Gentoo!

      --

      CEE5210S The signal SIGHUP was received.

    2. Re:Wait a sec by caluml · · Score: 3, Interesting
      From what I understand, it is the fact that you configure your system to never build packages with support for a, b, and c, and with support for x, y, and z.
      No point building mozilla with GTK2 support if you don't need it, is there? Or Samba with any of the following with question-marks:
      _COMMON_DEPS="dev-libs/popt
      readline? sys-libs/readline
      ldap? ( kerberos? ( virtual/krb5 ) )
      mysql? ( dev-db/mysql sys-libs/zlib )
      postgres? ( dev-db/postgresql sys-libs/zlib )
      xml? ( dev-libs/libxml2 sys-libs/zlib )
      xml2? ( dev-libs/libxml2 sys-libs/zlib )
      acl? sys-apps/acl
      cups? net-print/cups
      ldap? net-nds/openldap
      pam? sys-libs/pam
      python? dev-lang/python"
      It's the fact that you get packages on your system that match the settings you set before, not the fact you can compile every package with -fomit-frame-pointer that gives Gentoo its strength.
    3. Re:Wait a sec by tupps · · Score: 1

      While Gentoo helps you once, the people who get a benefit from a compile farm are developers.

      Typical developer will go through many:

      Change code,
      Compile
      Test
      Repeat

      Sometime hundreds of times a day. If you can make your compile times drop form 2 minutes to 1 minute you will save over an hour a day.

      --
      Go out and get sailing!
    4. Re:Wait a sec by ArmorFiend · · Score: 1

      Maybe I'm confused, but I don't know/care whether my system was configured with support for ldap. I just want [whatever I'm working on] to work. I suppose that's why distro-kernels ship with almost everything compiled as a module. Now most software isn't quite so multiple-choice as the kernel, but on the other hand there are seemingly ~10 --configure-with-gl=yes options to the typical program, and it seems you'd get into recursive recompilation hell all the time if you had to compile back to bedrock if you one day woke up and decided to install DRI+OpenGL or for some perverse reason decided you didn't want "readline" on your system anymore.
      ?

    5. Re:Wait a sec by Mazaev2 · · Score: 1

      This thing with Gentoo is that the USE flags also apply to dependency management. What makes it really useful is that if you specify USE=ldap, then the package you're emerging will also download the ldap libraries, as well as compile the specific program with support for it. If you tell it not to use ldap, it will keep ldap off your system if you don't need it. In the end, this adds up to saving you a lot of clutter and some secutiry risks.

    6. Re:Wait a sec by cas2000 · · Score: 3, Insightful

      > I'm confused. Which is it supposed to be? Are
      > Gentoo users full of crap, or are they correct?

      for almost all programs, it's not going to be *noticably* any faster. on average, you can get maybe 1% to 5% performance improvement from CPU-optimised binaries. this generally isn't worth the time and effort it takes to do the custom compile.

      for heavy graphics processing or number crunching, you'll probably notice that. you almost certainly wouldn't notice it on anything else.

      so, yes, the gentoo users are full of crap....the same kind of crap that obsessive overclockers are full of when they get so self-impressed by the 1% extra performance that they get out of their combination CPU/egg-frier.

    7. Re:Wait a sec by 0x0d0a · · Score: 1

      Anti-Gentoo zealots

      This is a new one. Just because someone dislikes Gentoo does not remotely make them an "anti-Gentoo zealot". I've yet to see someone that I'd categorize as an "anti-Gentoo zealot", though I suppose there are a few, and many that I'd call "Gentoo zealots" -- ignoring reason to argue in favor of their favorite distro.

      Now someone is saying: "precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine."

      So, the Gentoo users that are claiming that stuff compiled with the right optimizations *is* faster?


      Both wrong and right.

      If you choose the "best" optimization choices for your particular machine, you won't lose anything. Of course, those choices vary significantly from package to package, and that doesn't mean that you'll gain much, either.

      There are a few packages that can see significant improvements -- gzip is one, but it's quite rare to see significant performance improvements for anything above a basic -O2 -fomit-frame-pointer, and generally binary-based distros provide packages for different architectures for the few packages where a significant difference can be made (the kernel and glibc, for instance). It just doesn't generally make a significant measurable difference in performace as to what optimization options are used. Compilers (especially C compilers) just don't produce a huge difference in optimization.

      Oh, distcc has been in Gentoo for a while.. surprised to see it listed like it's a new thing.

      Distcc has been available for anyone for a long time, and packaged by a number of people. The reason you don't see a lot of people using it is because most folks don't have a cluster handy, and generally it isn't worth the effort to build a cluster to save compilation time unless you're doing a truly massive amount of compilation, like an entire distro (which obviously has a lot of interest for Gentoo types).

      For most developers, ccache is a better idea (if you're just building a single software package consisting of most of the same source most of the time). distcc is really best used when you have huge amounts of code htat will be compiled once.

  43. My experiences with distcc by meowsqueak · · Score: 5, Informative

    I've spent the last week setting up a Gentoo cluster with distcc and I've noticed a few things:

    1. when *recompiling*, the advantage due to ccache far outweighs the performance of distcc on the first compile. If you're testing distcc you need to be aware of this and disable ccache.

    2. most large packages either disable distcc (e.g. xfree by limiting make -jX) or compile small sets of files in bursts and spend the majority of time performing non-compilation and linking. Distcc helps with the compilation but because it's only a small part of the total build time, the overall improvement isn't as great as you might have hoped.

    3. distccmon-gnome is very cool.

    4. using distcc with Gentoo transparently involves modifying your path and this can make non-root compilations troublesome (permissions on distcc lock files). I haven't figured this one out yet other than to specify the full path to the compiler: make CC=/usr/bin/gcc rather than CC=gcc.

    5. the returns from adding an extra distcc server to the pool drop considerably after the first few machines. Even on a 1 gigabit LAN the costs of distcc catch up with the benefits after a while. This is more of a concern when compiling lots of small files.

    6. it can handle cross-compilation with a bit of configuration.

    So although distcc can often reduce build time, it's not quite as effective as you might assume or hope at first.

  44. Distributed Compiles by elderbro · · Score: 1

    How do the major distributors - Red Hat, SuSE. ... manage their compiles?

  45. Obligatory "No" by timotten · · Score: 5, Insightful

    precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine

    A straw man. Precompiled binaries may have been compiled with the optimal settings for your machine, and binaries which you compile may not have the optimal settings. Identifying the optimal settings can actually be non-trivial. Source-based distributions are not necessarily the best fix to the 'one-size-fits-all' approach used by some distro's.

    1. Re:Obligatory "No" by sploxx · · Score: 1

      Identifying the optimal settings can actually be non-trivial.

      True. No task for a human. Tedious work.

      But have you heard of this, a genetic optimizer for the compile time optimization parameters to GCC?

      Oh and to start dreaming about new features: Maybe GCC can implement such a feature to find the best optimization parameters for each function which is being compiled? :)

    2. Re:Obligatory "No" by HuguesT · · Score: 1

      Hi,

      Thanks, I had never heard of this project before and this is a useful contribution. However that project more or less proves the point that fiddling with the optimization parameters is a waste of time for all but the most CPU-intensive applications.

      Over all of the benchmarks, the optimal optimization parameters achieve a runtime gain of 4% over -O3 and 7% over -O2. Note that some of the options used for these gains are a bit frightening, such as "-funsafe-math-optimizations".

      For most applications this is not worth worrying about. It might be worth it for the kernel, libc and a few other crucial components, but I cannot see the point of recompiling X or KDE to achieve at best this kind of gain, when the bottleneck is clearly going to be I/O, not CPU.

      Also many of these options not being in -O1 or -O2 are not well tested, for reliability purposes I would never use them in production software.

  46. Excellent for software development by inflex · · Score: 5, Interesting

    I came across distcc by chance about 4 months ago, and I must say, it has utterly improved things around here.

    We reguarly develop/compile/debug a moderate-small sized software package, typically taking about 1 minute per compile. Now, while 1 minute doesn't sound like a long time, it starts adding up when you find yourself recompiling 100+ times a day.

    With the inclusion of distcc into the whole situation, we're able to reduce that 1 minute compile down to a little less than 20 seconds; highly appreciated (although now we have less excuses to go get a coffee :-( ).

    Distcc is a great package which can be extremely useful.

    PLD.

    1. Re:Excellent for software development by Zugot · · Score: 1
      Have you tried ccache?

      ccache is a compiler cache. It acts as a caching pre-processor to C/C++ compilers, using the -E compiler switch and a hash to detect when a compilation can be satisfied from cache. This often results in a 5 to 10 times speedup in common compilations.

      This might be a better fit for your situation.

      --
      -- Bryan
    2. Re:Excellent for software development by inflex · · Score: 1

      Yes, we've tried Cachegrind as well - it was faster still. Though we prefer to use distcc generally for reasons of consistancy of the compile. I'm not saying that cachegrind is broken, rather I'm saying that we prefer the extra security of rebuilding the modules each time from scratch (in the past, we've been badly bitten by a bug).

      Paul.

  47. Try ccache by AT · · Score: 2, Informative

    While it is slightly different in concept, check out ccache. It only uses a single computer but it can significantly speed up your compiles. It works by caching the results of each compilation; it will only help if you compile the same code over and over.

  48. Phht. by Mark_MF-WN · · Score: 1
    Phht. Just wait until Microsoft releases Gentoo/Windows.

    Seriously though -- Microsoft is the one company that can guarantee that their source code sizes will continually outstrip computational power. I wonder what kind of clustering solution they use to get their Windows builds to compile in a reasonable timeframe?

  49. Re:distcc is only workaround to an unsolved proble by IshanCaspian · · Score: 1

    "The problem with compiling your own binaries is that you are effectively forking code from the original distribution at the low level."

    Wow. That is blatantly false and misleading. "Forking code" refers to one piece of code diverging into two separate projects, ala X.org and Xfree86. All binaries have to be compiled somewhere...when the guys at Red Hat or Suse do it for you, they generally do it in a very generic, compatible way, and when you do it yourself, you can take some more risk or tailor it to your own needs.

    Furthermore, unless you use a different version / environment settings, the result is exactly the same as if someone else did it. There's nothing inherently dangerous or "fork-inducing" about compiling your own source code...only if you use an unstable version of the compiler or pass dangerous optimization flags.

    "Just look at the Linux Kernel Mailing List and how many errors can be traced to a GCC specific version."

    OK, there are glitches in some versions of GCC, so what? You seem to have a problem with people compiling their own source and distcc, but none of this has anything to do with GCC. The point is, whatever you're compiling, distcc is going to get it done faster. Sure, there may be reasons why people who don't really have a firm grasp on linux may need to avoid using unstable versions of GCC or aggressive compiler options, but that is really unrelated to the idea of a distributed compiling architecture.

    --

    But there is another kind of evil that we must fear most... and that is the indifference of good men.
  50. If you need perf, fine. But you lose testing by Flexagon · · Score: 4, Interesting

    But this can be a false economy...

    Every time something that is distributed in binary is rebuilt from source for local use, by definition it's to change some assumption that was inherent in the testing of the original binary (or else the binary distribution would suffice). And with that, some non-0 confidence that was built into the binary release by that testing is wiped out and must be recovered by local analysis and testing (i.e., time and effort) or reduced expectations. Otherwise, it's running on blind faith. This is particularly true with programs that are used frequently, i.e., one expects to depend on them repeatedly. So in my mind, "the best of both worlds" is more meaningful if it refers to fast and reliable apps. I don't care how fast the compiler is if I can't trust the results anymore. That is a different economy equation, and completely justifes the "convenience" of pre-compiled binaries in many applications.

  51. 2 hours!!! it only takes me 2 seconds by oliverthered · · Score: 1

    Astounded, think I'm lying, then you were wrong.

    Not that it doesn't take me two seconds, but that 'Computing power is outstripping the size of source code that needs to be compiled.'

    --
    thank God the internet isn't a human right.
  52. Looks like an ancient VM by ncaHammer · · Score: 0, Offtopic

    How is that better than JVM or even better CLI ?
    It is an attempt to solve a problem already solved (in a much more elegant and portable format) using outdated techniques.

    Just mho

  53. unsermake by Anonymous Coward · · Score: 1, Interesting

    i wnated to point out , if you are going to try distcc , run it with unsermake for example to compile kde. try google with unsermake - it make compiling distributed much faster.

    best ist : ccache, distcc and unsermake.

  54. precompiled headers by oliverthered · · Score: 1

    Precompiled headers can give more than a 50% performance improvement, though they don't work for a lot of things, but it kinda works with QT

    In the real world pre-compiled headers, offset caching and all that kinda crap would be seemless, quick and easy, but in the GCC (portability) world they havn't quite made it yet.

    --
    thank God the internet isn't a human right.
    1. Re:precompiled headers by mapinguari · · Score: 1

      Is seemless the same thing as unseemly?

    2. Re:precompiled headers by Anonymous+QWord · · Score: 1

      Seamless, quick and easy.
      Aparrently the poster is extreamley orthorgraphicly challanged.

    3. Re:precompiled headers by akihabara · · Score: 1

      The reason GCC is slow is nothing to do with portability. It's that the data structures and algorithms suck.

    4. Re:precompiled headers by oliverthered · · Score: 1

      Could that be because the spent more time on portability than making it fast?

      --
      thank God the internet isn't a human right.
    5. Re:precompiled headers by oliverthered · · Score: 1

      No, seemless - unnoticeable.

      --
      thank God the internet isn't a human right.
  55. super fat... by Anonymous Coward · · Score: 0

    ... is sitting on a sl5500, compiling something right now with a fleet of 20 x86-based 'blades', on various parts of the vpn, at various parts of the the world which i hope to someday never have to visit to administer!

    #/usr/src/c_climber/./configure; make ; make install

  56. Productivity *lost* in setting up dist'ed env? by Anonymous Coward · · Score: 1, Interesting

    How much productivity is lost in setting up the distrubuted compilation network and enviornment when compared to just doing a few "./configure; make install" commands?

    1. Re:Productivity *lost* in setting up dist'ed env? by Anonymous Coward · · Score: 0

      Very little, actually -- the setup of distcc is for the most part a one-off -- it's a fixed cost. Once it's set up, you can ./configure && make -jxxx && make install to your hearts content, and it'll use your distcc'd boxen out of the box. No user intervention required.

      So it's the marginal cost of doing each compilation that's brought down. When doing software development, for example, it makes a lot of sense.

  57. whoa!!!! by Anonymous Coward · · Score: 1, Funny

    Imagine a Beowulf Cluster of these! Oh wait....

  58. your sig by Anonymous Coward · · Score: 0

    piqued my interest.

    what does it mean?

  59. I use it for OSX by streak · · Score: 2, Interesting

    My main use for distcc currently is building software for my powerbook.
    I do a lot of work with Qt on both Linux and Mac, and lets just say Qt compiles very slow on my powerbook (which is an older 800 mhz G4).
    Also, I've had to build all of Qt on this machine because the fink packages are old and don't even use the Mac version (they use the X11 version which really sucks and makes apps on Macs look like crap).

    So at work we have a couple dual G5s I use, and also a few Linux machines which I've built darwin cross-compilers for (yes its a pain in the ass).

  60. Time is a constant. distcc helps. by adolf · · Score: 2, Interesting

    I remember compiling 2.0.x kernels on my own 100MHz Pentium. It took -forever-.

    Later on, I built a 350MHz K6-2 machine for a customer, and it was a screamer compiling its 2.0.x kernel, taking just a few minutes.

    Fast forward: I've got a very similar K6-2 350 as a miscellaneous server and firewall here. Compiling its 2.6 kernel takes -forever-.

    But the new 2.4GHz HT 800MHz FSB P4 box I built recently for work is again a screamer, compiling its 2.6 kernel in a few minutes. This box is in roughly the same relative performance league as that K6-2 was Back In The Day.

    Moral of this story: The more things change, the more they stay the same. Program and compiler complexity has kept pace with increases in processor speed, leaving the time to compile x more or less constant over at least the past few years.

    'Sides, even if you can build a proper desktop system in two hours, distcc serves well to decimate the amount of time required. Whether it is used to cut that two-hour-long run down to 30 minutes minutes, or a 5-minute compile down to 60 seconds, distcc will always have its place[1].

    [1]: Yes, yes, I know. People everywhere are saying "But who cares if it takes 5 minutes instead of 60 seconds? It's not like I can't continue using the machine while it's compiling." These people are ignoring the human aspect of the whole thing, which can be summarized as follows: Wife, house, kids, cars, jobs = 4 minutes worth of life that has been rescued from the computer by distcc.

  61. distcc causes kernel panic... by kidlinux · · Score: 4, Informative

    At the moment there's a bug in Linux kernel 2.4.26 that causes the remote compiling systems to encounter a kernel panic (and crash.)

    It's a known bug and has been discussed on the lkml. The bug is also discussed on the gentoo bugzilla. A patch is also available, though the patch program didn't work for me so I had to apply it manually.

    The patch seems to be holding up, too. If you're using distcc on systems with vanilla 2.4.26 kernels, I'd suggest patching them.

    --
    -kidlinux.
    1. Re:distcc causes kernel panic... by boots@work · · Score: 1

      If you're suffering this, it's easy to avoid by simply setting DISTCC_MMAP=0 DISTCC_SENDFILE=0. This avoids the kernel bug at a slight performance cost.

  62. mozilla vs netscape 3 by EventHorizon · · Score: 1

    Think about it, is there anything fundamental that Mozilla can do that Netscape 3 couldn't?

    mozilla firefox 0.9 can run 3 hours under Linux without a SIGBUS. Communicator 4.79 cannot.

    1. Re:mozilla vs netscape 3 by evilviper · · Score: 1
      mozilla firefox 0.9 can run 3 hours under Linux without a SIGBUS. Communicator 4.79 cannot.

      First of all, Communicator 4.79 is not Netscape 3.

      Secondly, stability problems are not a fundamental difference. It's not as if a program has to be massive bloated (like Mozilla) to be stable.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  63. It's great for OS-X compiles by Anonymous Coward · · Score: 3, Interesting
    When building large Macintosh applications, we've been using Objective-C and this distributed compiler.

    It's so PAINFULLY SLOW to build anything for the Mac, with this inefficient Objective-C compiler and large linking requirements for Carbon, that without these distributed tools and some G5 servers, it would be hard for us to develop.

    Interestingly, our Windows version of this product, built in C#, compiles extremely fast with no distributed trickery needed.

    1. Re:It's great for OS-X compiles by TomorrowPlusX · · Score: 1

      Just out of curiosity, are you using Objective-C++?

      I'm not a professional, so take this all with a grain of salt, but my personal work involves a 30 kloc app linking against about 30 more kloc of C++ libraries I wrote. Now, the app is Cocoa, and is about, say, 50% pure C++, 30% Objective C++ and the rest is Objective-C. The pure C++ compiles reasonably quickly, the pure Objective-C compiles so fast I barely have time to observe -- sometimes it's so fast I accidently hit build twice because I didn't see it happen. The Objective-C++, however, takes so long to compile I can feel my hair grow.

      of course, I'm not saying you should avoid objective-c++, but if the build times really bother you that much, and it *is* an objective-c++ issue, you might want to sandbox your c++ with pure C, and then let pure Objective-C call that. I've had to do that a little bit, not due to compile times but because a 3rd party C++ library I use has headers which Objective-C chokes against ( it has #defined "id" datatypes. ).

      --

      lorem ipsum, dolor sit amet
  64. Yeah by Synn · · Score: 1

    I think the "speed advantage" of source based distributions is small to non-existant. The advantage to them is the ability to exclude/include support for various compile time features(if you don't need TLS auth in a ftp deamon why compile it in?) and easier cross platform support.

    1. Re:Yeah by c_g_hills · · Score: 1

      You can actually do this with rpms also. For instance, I have recently created new dovecot rpms that you can rebuild with options such as --with mysql, --without ldap (`rpmbuild --rebuild --with mysql --without ldap dovecot*src*.rpm`)

  65. Re: compilation speed by Anonymous Coward · · Score: 0
    It shouldn't take a minute to compile small changes (the type you make 100x/day) on _any_ size project. Here are some suggestions to help reduce your compile time:

    1. This should go without saying, but I'm going to say it anyway: if you have a file with more than 1000 lines, you probably need to break it up into 2 or 3 files. Likewise, if you have a function with more than 100 lines, you probably need to rewrite it as 2-3 functions. Exceptions can be made for performance critical functions (and then only when you have profiling data to suggesting it is necessary and will make a noticeable difference).

    2. Fix your makefile. It sounds like you're compiling "the kitchen sink" on every minor change. If necessary, factor out the code that's forcing you to recompile your entire project. Files generated during compilation should be wrapped with a tight interface (lex/yacc come to mind here). Surely you know better than to modify the equivalent of 'types.h' 100x/day.

    3. "include guards" are your friend.
    /* foo.h */
    #ifndef _FOO_INCLUDED
    #define _FOO_INCLUDED
    ...
    #endif /* _FOO_INCLUDED */
    4. "external" include guards help too (especially if your compiler doesn't support any form of "#pragma once")
    /* bar.h */
    #ifndef _FOO_INCLUDED
    #include "foo.h"
    #endif
    Most people do #1 by default. Knowing how to do #2 can make a pretty big difference. The key is to reduce the number of dependencies. However, if those dependencies are unavoidable, then you need #3 and #4. Together they can result in 10-100x speedups in compile time for med-to-large projects (YMMV).
  66. Incredibuild by kingos · · Score: 5, Informative

    For those using Visual Studio on Windows, I highly recommend a tool called Incredibuild to do the same job. It is not free like distcc, but is very effective and integrates nicely with Visual Studio. It cut my build time for a project at work from 15 minutes to 1 minute 20 seconds. Nice!

    kingos

    1. Re:Incredibuild by MochaMan · · Score: 1

      Just don't compile with Incredibuild, then edit and compile changes with Visual Studio, or you're screwed. But yeah, some people at work are reporting their 45 minute build time is down to about 12 minutes, I believe we have 20 people using it. I'm not a fan of its interface or the problems it has with #pragma once, but those using it seem to be mostly happy.

  67. CPU is rarely the bottleneck by Xtifr · · Score: 2, Interesting

    The claim also contains the assumption that applications are CPU-bound. All the recompiling in the world won't make something go faster if it's waiting on a disk or a UART or a NIC. Many applications are fast enough anyway -- who cares if /bin/cat gets a 2% improvement of its CPU use? I bet I could add a 20 microsecond gratuitous delay in the main loop of cat, and not noticably affect its performance!

    That said, the kinds of things I would like to have extra-optimized for speed are generally big, huge, complicated things that take forever to compile. Like an Xserver. And that's definitely where distcc could come in handy.

  68. And by the way, GCC 3.4.1 by eddy · · Score: 4, Informative

    ... was just released.

    Only available on mirrors, currently.

    --
    Belief is the currency of delusion.
  69. Big Deal by MinorHeadWound · · Score: 0

    I did this 10 years ago using Perl on Sun workstations.

  70. Incremental compiling by Decaff · · Score: 1

    Am I missing something, but why would anyone be reguralrly doing such long compiles? I remember C++ development in the mid-80s when long compiles and links were common, but that was in the days of 20 MHz 386s. Even then, we soon moved on to the use of incremental compilers - only the relevant (and small) parts of even a large project would be compiled, and then linked back into the pre-compiled code. I can understand why the first compilation of a large project could take some time, but from then on, shouldn't compilation and linking be a minor matter?

    1. Re:Incremental compiling by jgordon7 · · Score: 1

      Well one example would be someone running Gentoo. Each programs compile times do not take very long, but if you try to compile everything that makes up the system. Well distcc can greatly reduce the time.

      Do not bash the Gentoo remark, any source based distro could use this. Or anyone running RedHat and for some reason needs to compile all the code for a certain compile time flag.

    2. Re:Incremental compiling by Decaff · · Score: 1

      Well distcc can greatly reduce the time.

      I see what you mean, but my point remain valid, I think: this is a one-off compile. After that.. what is the demand?

    3. Re:Incremental compiling by HuguesT · · Score: 1

      Gentoo is not a one-off compile. These guys are compiling stuff *all* *the* *time*. New releases, bug fixes, whatnot. I know a gentoo zealot and his machine is perpetually 100% busy compiling stuff. At least his CPU is getting some work done, that's for sure.

  71. How to add a Cygwin box to Linux Distcc cluster by truth_revealed · · Score: 1

    - Copy the Linux system header files to the Cygwin box.
    - Build a GCC Linux-target cross compiler hosted on Cygwin.
    - Run the distcc daemon on Cygwin making sure that it finds the Linux cross compiler binaries (gcc/g++) in the path first (use a script to launch the daemon).
    - Point the Linux box to the Cygwin box via DISTCC_HOSTS and go.

    Some notes:
    - using -g (debug) distcc builds can lead to bizarre behavior because the source file path is embedded in the .o file. Try to get all your boxes to use the same directory structure.
    - compiler versions must be IDENTICAL on all boxes if you intend to use C++. Don't trust your system's default g++ compiler - who knows what crazy patches it has - build one from scratch using the same GCC sources on ALL machines. C is more leniant - you can get away with vastly different versions of GCC if you only use C.

  72. Slowly, slower, slowest by suckfish · · Score: 1
    precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine.

    Actually precompiled binaries built by someone who knows what they're doing will almost always give a better performing system that those compiled with some random combination of compiler options that some 733t d0d@ mistakenly thinks work magic because a /. article said so.

    Most of the bottlenecks on my systems are disk-io related. Compiler options matter fuck all, but gcc -Os rocks! gcc -O99 sucks! :-)

  73. Also of Note. by temojen · · Score: 2, Informative

    Many programs that can use the SSE or MMX extensions (such as video codecs or Software OpenGL) will fail to compile with DistCC, reporting "Couldn't find a register of class BREG".

    If the failing package is one of many, you can emerge just the one package by changing make.conf FEATURES to not include distcc.

    FEATURES="ccache" emerge xine-libs
    emerge whateveryouwerebefore
    Note here I've used the ccache feature. It's really handy because it won't re-compile any parts that've already compiled sucessfully. When make quits on an error, emerge cleans out the sandbox so you can't just let make take care of the already compiled objects.
  74. Doesn't work well for me with Gentoo by lorcha · · Score: 1
    I have a small gentoo box (EPIA) and a large debian box (multiprocessor). I set up distcc on the debian machine to handle as much of the compiling as possible, but about 10% of the gentoo packages won't compile using distcc because gentoo's gcc version is patched to all hell, methinks.

    Kinda frustrating to run a huge emerge, only to return hours later to see that nothing ran because distcc puked.

    --
    "Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
  75. Binary packages? What a great idea! by Trejkaz · · Score: 1

    Cool, so could you find me a binary package for the application I'm developing which hasn't been compiled yet? That would save me a lot of time. :-)

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
  76. Sadly, you can't put saved time in the bank. by anti-NAT · · Score: 2, Informative

    While I've come across your argument a lot, regarding lots of little amounts of saved time, I struggle to see any actual value in these "micro" time savings.

    How do you collect up all these micro time savings, making up an "new" hour, in which you can usefully do something else ?

    The only application you've mentioned where I think these optimisations matter is DVD encoding. More broadly, useful time savings can be gained as these jobs tend to take a lot of time eg. I would consider saving 5 minutes on an hours video processing to be worth it. 5 seconds saving per hour wouldn't be.

    I don't see how reducing an SSH connection set up time by 0.25 of a second is going to make me dramatically more productive, even if I do it 1000 times a day. 1000 * 0.25 = 250 seconds, or just over four minutes a day saving. I spend more time in the toilet than that, maybe I should start taking my computer to the toilet with me ?

    My point is this - you need to do a cost benefit analysis, to determine whether the actual time saving has any useful value. In a lot of cases, on the typical, relatively high-performance machine, across the board CPU optimisations don't have any useful value.

    I think throwing away your TV set would be far more productive than compiling everything from source in most cases.

    --
    The Internet's nature is peer to peer - 20050301_cs_profs.pdf
    1. Re:Sadly, you can't put saved time in the bank. by boots@work · · Score: 1

      I sympathise with you a lot, and I think a lot of the Gentoo stuff harpooned at funroll-loops is pretty silly.

      However: small pauses are perceived as a computer that's clunky and hard to use; the difference between a 0.2s response to an action and a 1.0s lag is numerically small but psychologically enormous. It can make the system more fun, or less annoying, to use.

      Now is rebuilding every package from source a good way to achieve this? Probably not. I think all the effort that goes into Gentoo would be better directed towards fixing the applications so that they just use less cycles. Improve the algorithm, don't fuck with the compiler. Of course many of the people working on Gentoo ports don't have the skills or experience to fix the core of the applications, but it would be nice if they at least tried.

      To get back to the topic: when distcc reduces compile time, it stops me getting distracted while waiting for my program to build. The delay can cause either annoyance, or lost productivity (if I get distracted by slashdot). Again: numerically small, psychologically large.

    2. Re:Sadly, you can't put saved time in the bank. by evilviper · · Score: 1
      I don't see how reducing an SSH connection set up time by 0.25 of a second is going to make me dramatically more productive, even if I do it 1000 times a day.

      It's just a matter of the little things adding up. A second here and there quickly adds up... Not over an hour, but over a week or so, you've more than made up the extra time it took to compile with optimizations.

      More than setup time, lag is an issue. If you have to wait 1/10th of a second before what you type shows up on screen, you'll see yourself wasting a LOT of time... You wait after every word you type, you have to pause after arrowing-over to make sure it's on the right character, and then hit delete and type the right letter in there. Those little things make life more tedious, and add up to a lot of time (assuming you type a lot of stuff over SSH).

      But even more important than that may be file transfers. Sending a large file with SCP can take a very long time, and over about a dozen KB/s, you are no longer network-bound, but CPU-bound. Even less if using 3DES...

      And finally, the hardware you have to buy is an issue. 4 minutes a day might not seem significant to you, but maybe the fact that you have to buy a new $1000 computer every year might. You not only are wasting the time spent earning that salary, but also setup of the new hardware, costs to cool that new, hotter machine, and electric bills. Even if you accept a delay rather than buy new hardware, you're still using more electricity and putting out more heat because your computer is working harder.

      I think throwing away your TV set would be far more productive than compiling everything from source in most cases.

      The value of watching TV is completely irrelivant. We are talking about the time you are using your computer. What you do with the rest of your time is up to you.

      The only application you've mentioned where I think these optimisations matter is DVD encoding.

      I think Mozilla is the most significant. I have a lot of lag when using it. I open a couple tabs, I wait a couple seconds... I decide to download a file, I have to wait 5+ seconds or more before it finally pops up the dialog box. Since I visit a lot of websites every day, and go through this process every day, I'd be willing to bet I'm wasting about 30 minutes each day waiting for mozilla to catch-up to me...

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  77. "Technically" correct, "usefully" incorrect by anti-NAT · · Score: 1

    Technically, all software compiled with CPU optimisations will be faster, when compared with software without those optimisations.

    However, the better question to ask is whether the applications in question will be "usefully" faster. For example, if I compiled Firefox with CPU optimisations, which made pages load 0.25 of a second faster, is that going to be useful to me, in particular compared to the time it took to compile ? Probably not - the latency on the Internet is going to be far greater and vary enough such that I'll never be able to usefully benefit from the 0.25 second per page performance increase. Even if I did benefit per page, and say loaded 1000 pages a day, I'm saving 250 seconds per day, which is just over 4 minutes per day. As I mentioned in another post, I spend more time that that in the toilet per day. Does a 4 minute per day saving really matter ? To me, I don't think it does.

    --
    The Internet's nature is peer to peer - 20050301_cs_profs.pdf
  78. Hmmmm.... by nunofgs · · Score: 0

    benifits of using distcc

    ... Apparently one of them is not *spelling*

  79. Not entirely a waste by ThousandStars · · Score: 1

    Actually, I think posts like the grandparent's are useful because that way people who don't read Slashdot everyday or missed the other articles can read them and get up to speed on the discussion/topic. I hope that will lead to fewer redundant comments.

  80. Not convinced of the speedups by Mike+McTernan · · Score: 1

    The problem I have is that my compilations are almost always disk bound, and not CPU bound. This is because I do most of my work on a laptop which has a very slow 4200 rpm HDD....

    Since distcc still requires the local machine to pre-process all the files and open all the include files (of which there are a great many for my work), I don't really expect that distcc would give a huge performance increase; certainly the gains with ccache have been show to only be around 180 seconds over a normal compile run of 660 seconds...

    --
    -- Mike
  81. Been out of touch for a while... by ceeam · · Score: 1

    Anyone knows if precompiled headers ("production quality") are coming to GCC any time soon?

    1. Re:Been out of touch for a while... by akihabara · · Score: 1

      Nope.

  82. a better distributed comper system... by Capt.+Beyond · · Score: 1

    distcc is ok, until you want to add quite a few machines. Problem with distcc, is that it doesn't scale well. This is where Trolltech's teambuilder shines. Free for personal use with up to 3 machines, and available for large scale commercial compiler operations, in a variety of CPU's. Is very easy to setup and has a very cool gui monitoring system.

    --
    -- "Perceptions create reality. By changing your perceptions you change your reality."
  83. waste of time by cas2000 · · Score: 1

    > But this can be a false economy, especially with
    > programs that are used frequently: precompiled
    > binaries will never run as quickly as those
    > compiled with the right optimizations for your
    > own machine.

    actually, the obsession with recompiling so-called "optimised" binaries is a false economy. the benefits are minimal while the effort can be considerable (especially for newbies - who are generally the kind of people are impressed by silly ideas like this).

    distcc is a useful tool for those who actually need it but for the vast majority of programs used by the vast majority of people, the average 1-5% performance improvement that can be gained by optimising a compile for your exact CPU will never even come close to compensating for the amount of time spent on editing Makefiles and compiling the software. Like everything else, optimisation is subject to the law of diminishing returns.

    CPU intensive programs (e.g. 3d rendering and other number crunching apps) can benefit from optimised compilation and may, IFF you use them a lot, be worth recompiling for your system....but in general, it's not worth the bother.

    similarly, it may be worth while recompiling heavily used server software (e.g. apache, or postgres) on dedicated servers - but most such services are I/O bound, not CPU bound. Spending hours to shave off a few CPU cycles here and there is generally not worth it....you're better off spending time and money upgrading your disks or installing more RAM.

    1. Re:waste of time by cas2000 · · Score: 1

      i should add that the only program that really is worth recompiling for your own system is the kernel.

      distribution-supplied "stock" kernels are useful for installing a system with but as soon as the system is running, the best thing to do is to download the latest kernel source and compile a new kernel targetted for exactly your hardware (and save yourself some hassle by compiling drivers/modules for hardware you *might* have in the nearish future)

  84. Tiny C Compiler by Anonymous Coward · · Score: 0

    Someone should meantion tcc, the Tiny C Compiler. And its ultra fast to! .. At compiling that is, the runtime I dont know of =) It can also be invoked from within your own C code. And the new generated code can be dynamicly linked and executed also from within your C code. tcc can be used as an script executor much like perl. If you intressted in C as a programing language you have to try tcc.

    #! /usr/local/bin/tcc -s
    int main() {
    printf("Im a C Shell Script!\n");
    return 0;
    }

  85. Compliation Hell by ObsessiveMathsFreak · · Score: 1

    It's not that I don't care about optimisation when I choose an rpm over a .tar.gz source. It's just that compiling, at the best of times, is not as straightforward as rpm.

    Make, frequently fails, so much so that it's frequently faster to compile each file one by one.
    Not that rpm doesn't have its own problems. I'm always running across dependencies or bad headers.

    Overall, whenever possible, I choose yum over both. It's slow, frequently times out, and downloads whoap loads of headers it never needs, but it finds dependencies, auto installs, and sets up programs on the system tray.

    --
    May the Maths Be with you!
  86. Myth ? by Anonymous Coward · · Score: 0
    "precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine."

    surely this is a myth ?

  87. And those optimizations are... by Snaapy · · Score: 1

    But this can be a false economy, especially with programs that are used frequently: precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine.

    Here comes the pain...

    How can I tell which are the right optimizations? I assume precompiled binaries were compiled with gcc -O3. Beyond -O3 everything goes magic.

    Instead of spending hours and hours doing profiling and testing I'll just gladly accept that my Firefox renders slashdot.org 1.05% slower.

  88. distcc / OS X by LemonYellow · · Score: 1

    As a matter of interest, have you tried importing your project into Xcode? I presume that it's a right pain, otherwise perhaps you would have used the distributed compiling built in to the IDE?

    [ I've only dabbled with Xcode (I'm a Windows developer by trade :( ) so I don't know if it's of much use for GNU-style builds. ]

  89. Close, but still wrong... by sultanoslack · · Score: 2, Informative
    The article also says that other than distCC, the computers need not have anything in common; this is not strictly true. Different major versions of GCC can cause problems if you are trying to compile with optimization flags that are only on the newer version.

    Heh. No. GCC pretty regularly breaks binary compatibility for the C++ ABI. Breaks were at GCC 2.95 -> 2.96 (though 2.96 was just a RH/Mandrake thing), 2.x -> 3.0, 3.1 -> 3.2 and 3.3 -> 3.4.

    You can't mix C++ compiled with any of the compilers that are on opposite sides of those splits.

    Another thing is that some very large packages have trouble with distributed building of any sort (either multiple threads on the same machine, or over a network like with distCC). As far as I know, at least parts of [...] KDE and the kernel.

    Wrong again. Both KDE and the Linux kernel build fine with distributed compilation systems. In fact, KDE has been used with distcc and TeamBuilder for years (TB has been used at the last several KDE meetings) and now there's even IceCream (developed by KDE folks) in KDE's CVS which is sort of based on distcc, but has a central scheduler and does better automatic configuration. It also gets around the first issue above because it's able to build a basic runtime environment based on your system tools (compiler, glibc, etc.) and ship it over to the host machines to build in a chroot environment.

    The kernel also works just fine in a distributed build environment; I build it regularly with such.

  90. MOD DOWN: Moron who couldnt even read the blurb by Anonymous Coward · · Score: 0

    err.. mods, this is completely unrelated, not informative. i hope you can read

  91. icecream by TheRealNecator · · Score: 1

    Isn't icecream ment to be superior to distcc?

  92. Why not use Cook instead? by fhafner · · Score: 1

    The utility that comes installed by default with SUSE called 'cook' does the same thing. How is distcc any better than cook? Has anyone done any comparisons?

    --
    Veni Vidi Vici
    1. Re:Why not use Cook instead? by boots@work · · Score: 1

      distcc compared to Cook.

      The biggest point is probably that Cook requires you to do your builds through Cook, but distcc can fit in with any build system: Make, SCons, Cons, or probably even Cook.

  93. And further by Improv · · Score: 1

    Compiling your own software is something you don't really want to do on systems at work, especially high-end systems, because it becomes a managability nightmare. Using packaged binaries on modern distros, when possible, means that you know the software doesn't have issues being compiled with that computing environment (gcc and other libraries), may have additional tweaks that are platform-appropriate, and most importantly, is externally verifiable. Being able to do a md5sum on binaries running elsewhere to match, or to verify the entire system and find all the files that have changed from a stock configuration is very useful, and is crippled when you can't expect the same binary as anyone else on the planet.

    --
    For every problem, there is at least one solution that is simple, neat, and wrong.
  94. Security? by Ed+Avis · · Score: 2, Interesting

    Worryingly the article does not mention *at all* the obvious security questions. If you run a distcc service on a host then who is authorized to connect to it and compile programs? How do they authenticate? What about protection against man-in-the-middle attacks (you may not be paranoid enough to worry about people fiddling with the object code before it is sent back, but at least you ought to know if it's possible). I hope it's not another case of 'ignore security in the service, but it's okay, we'll just put it behind a firewall'.

    FWIW, distributed compliation programs like distcc are a good reason to check for buffer overruns and other memory trampling in the compiler. If you've ever managed to segfault gcc by feeding it a bad piece of code, there is a potential exploit via distcc if you can craft a C program that makes the compiler misbehave in the way you want.

    --
    -- Ed Avis ed@membled.com
    1. Re:Security? by boots@work · · Score: 1

      It's a bit bad that the article doesn't mention security, but security has been considered in distcc.

      If you don't trust your network, you can run distcc over ssh, just like cvs, svn, rsync, ... That gives you good protection against network atacks, and doesn't increase the exposure of the machine at all. Just set DISTCC_HOSTS="me@otherhost"

      Of course confidentiality and integrity protection takes cycles, so if you *do* trust your network, you don't need to use it.

      Using SSH is a far better approach than a handcrafted authentication system, which would probably be broken in various ways, if other protocols are any indication.

      gcc will never be secure against untrusted input, it's just far too complex. Even trying would be an enormous waste of time.

    2. Re:Security? by Ed+Avis · · Score: 1
      I agree, using ssh is a much better bet than some half-baked authentication built into distcc (cf CVS's pserver). If you are really paranoid like Sourceforge you'd want to limit user accounts so the distcc client is the only program they can run.
      gcc will never be secure against untrusted input, it's just far too complex. Even trying would be an enormous waste of time.
      But in this case as in so much else, a security hole is just a bug. A segmentation fault in the compiler needs to be fixed anyway, the fact that it may also lead to a distcc exploit is just an additional reason. A full audit of the gcc code to make sure the memory access is safe would be impossible, but if you do find known bugs you should fix them.
      --
      -- Ed Avis ed@membled.com
    3. Re:Security? by boots@work · · Score: 1

      Yes, you can limit the command if people are allowed to use the machine for compiling and nothing else.

      I agree if you find something that makes gcc crash then it should be fixed.

  95. Re:false savings - not always by bitrot42 · · Score: 1
    Monday, 9:00 pm:

    emerge sync
    emerge -u world

    Tuesday, 9:00 am:

    Updated, optimized apps! (Profit!!!)

    If the custom builds manage to save just a few seconds, it's seconds of MY time, not idle time. Big difference.

    Gentoo makes compiling your apps easy and fun!

    Besides, there's a warm fuzzy feeling to be gained from actually using the source code for all those open-source applications.

    --
    FIXME: Add a sig here
  96. Laughable by Anonymous Coward · · Score: 0

    Stuff like this always makes me laugh. You read about it, study it, read the manpages, install the package, then install the source package, recompile from source, and voila, you have a tool that will save you maybe one minute per month, and you've only spent a few hours on it to get it. Also any open source tool will be available with at least 5 independent alternatives, each with 5 different branches because developers went their different ways after disputes. So now you have to test and compare them all to see which one suits you the best.

    1. Re:Laughable by Anonymous Coward · · Score: 0

      Another inspired comment - there doesn't seem to be a happy medium with most posts. There are occasions when going for the binary is worth it, others when one should go for the source. It depends on the application; if I'm running something CPU intensive for twelve hours a day I want to be sure that it'll be making best use of its time, and on those occasions it's certainly worth building from source with sensible options.

      Of course, rebuilding one's e-mail client probably isn't going to help so much. Horses for courses.

      Comments like the one above (and probably this one by association) add nothing to discussion and just serve to munge people's opinions.

      I should probably not respond to trolls, eh?

  97. Another reason to buy a Mac by OrangeTide · · Score: 2, Interesting

    Xcode build system: Distributing Builds Among Multiple Computers

    Yes, Apple has come standard with distcc for quite some time.

    --
    “Common sense is not so common.” — Voltaire
    1. Re:Another reason to buy a Mac by boots@work · · Score: 0, Flamebait

      "Another reason to buy a Mac", when you get the same thing for free with Linux? Uh-huh.

    2. Re:Another reason to buy a Mac by OrangeTide · · Score: 1

      by "free" you mean you get the honor of installing it and RTFMing yourself? YAY!

      --
      “Common sense is not so common.” — Voltaire
  98. Why not use distcc and ccache both together by Corporate+Gadfly · · Score: 1
    While it is slightly different in concept, check out ccache [samba.org].
    Or better yet, use them both together. Local compiles will end up benefitting from ccache.
    --
    Corporate Gadfly
    Jonathan Archer: the most beaten up Enterprise captain in Star Trek history
  99. XUL etc... etc... by oliverthered · · Score: 1

    Well, if you fancy lerning XUL &co you can use mozilla for more-or-less anything you like, just look at all the "extensions out there. You couldn't do that so easly with Netscape 3.

    --
    thank God the internet isn't a human right.
  100. YOU are the bottleneck by Anonymous Coward · · Score: 0

    with your backward views.

  101. Re:false savings - not always by Anonymous Coward · · Score: 0

    What, 12 hours compile time (plus the wait between emerge sync and emerge -u world because you forgot to chain the commands (emerge sync && emerge -u world) ) ?

    12 hours to get "a few seconds saving"?

    Fine if you genuinely don't touch your computer between 9pm and 9am, but the rest of us enjoy hacking 24/7 :-)

  102. Spare a thought for the author by jedimark · · Score: 1

    Its amazing how many thoughtless fools knock the time and effort gone into writing opensource software like this. Most of you wouldn't have an operating system if it weren't for timesaving tricks like these. DistCC may not be the perfect solution yet, it certainly has saved me a crapload of time in devlopment. Not to mention my horde of gentoo boxen. Sure i wasted a lot of time setting it up, but at least I had fun.