MLUG: Re: [MLUG] Multithreaded compile using apt?
Re: [MLUG] Multithreaded compile using apt?
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Jack Smith wrote:
I have a quick question here and Google wasn't very helpful. I want to
be able to use both CPU cores when I compile a Debian source package
using apt. I can get things to compile just fine, but gcc only spawns
one thread. How would I go about getting it to spawn more threads? I
already tried to export MAKEOPTS="-j3" in the terminal to get gcc to
spawn three threads, but apparently apt spoon-feeds gcc instructions.

--Jack

I was under the impression that "-j3" is an option that is given to make, not to gcc. It causes make to spawn three gcc's (or other compilation services) at a time.


I use it all the time when compiling the FreeBSD kernel, but my impression is that the Makefile has to be quite carefully written for it to work properly. It would not surprise me if the Makefile's for many source packages were not "-j??" friendly.

My personal experience with multithreading is that you always gain efficiency by doing the threading as at high a level as possible. So, for example, you could have a multithreaded gcc. But a multithreaded make would be more efficient. And running three totally separate compilations (i.e. building three separate packages) simultaneously is the very best way.

Stephen


_______________________________________________ members mailing list EMAIL:PROTECTED http://mlug.missouri.edu/mailman/listinfo/members