public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Enable parallel build gcc on Linux
@ 2000-06-08  0:38 H . J . Lu
  2000-06-08  6:21 ` Marc Espie
  0 siblings, 1 reply; 3+ messages in thread
From: H . J . Lu @ 2000-06-08  0:38 UTC (permalink / raw)
  To: gcc

I have a shell script to enable parallel build on Linux:

--
numprocs=$(/usr/bin/getconf _NPROCESSORS_ONLN)
cat <<EOF > makefile
MAKE=make -j `expr ${numprocs} + ${numprocs}`
include Makefile
CFLAGS:=\$(CFLAGS) -pipe
CXXFLAGS:=\$(CXXFLAGS) -pipe
EOF
---

You should run it in your build directory. It exposed out many parallel
build bugs in the gcc source tree, especially on SMP machines with
enough RAM. In my case, they are quad-Xeon with 4GB RAM and dual-Xeon
with 512MB RAM.


-- 
H.J. Lu (hjl@gnu.org)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Enable parallel build gcc on Linux
  2000-06-08  0:38 Enable parallel build gcc on Linux H . J . Lu
@ 2000-06-08  6:21 ` Marc Espie
  2000-06-08  7:05   ` H . J . Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Espie @ 2000-06-08  6:21 UTC (permalink / raw)
  To: hjl; +Cc: gcc

I've had a fun idea to expose parallel builds errors. 
I'll have a patch for pmake to do it soon, but I assume the idea
is easily applicable to gnu-make as well:

just reverse all dependencies at parsing stage. If Makefile says:
a: b c d

you read:
a: d c b

If the Makefile is correctly specified, it won't change a thing. If it
depends on sequential behavior, hum, oh.... it will be fun.

I could also make it do `random' things, but I don't think it's a good idea
and will gain anything.  As far as recursive makes go, they will normally 
inherit the parent make flags unless the invocation is completely wacky, 
but this could be more systematically asserted, through an env variable
nobody is likely to stumble upon (MAKE_BE_NASTY, anyone ?)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Enable parallel build gcc on Linux
  2000-06-08  6:21 ` Marc Espie
@ 2000-06-08  7:05   ` H . J . Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H . J . Lu @ 2000-06-08  7:05 UTC (permalink / raw)
  To: Marc Espie; +Cc: gcc

On Thu, Jun 08, 2000 at 03:20:45PM +0200, Marc Espie wrote:
> I've had a fun idea to expose parallel builds errors. 
> I'll have a patch for pmake to do it soon, but I assume the idea
> is easily applicable to gnu-make as well:
> 
> just reverse all dependencies at parsing stage. If Makefile says:
> a: b c d
> 
> you read:
> a: d c b
> 
> If the Makefile is correctly specified, it won't change a thing. If it
> depends on sequential behavior, hum, oh.... it will be fun.
> 

That is not a bad idea. My quad-Xeon does a pretty good job on it even
without any changes to gnu make. I will see what 8way will do :-).


H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-06-08  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-08  0:38 Enable parallel build gcc on Linux H . J . Lu
2000-06-08  6:21 ` Marc Espie
2000-06-08  7:05   ` H . J . Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).