You are not logged in.

#1 2008-01-28 02:00:02

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Why do MAKEFLAGS > j1 fail?

I'm curious why parallel builds fail. There are a couple of programs that I know of (gpac, sword) that fail to build when MAKEFLAGS passes a value for -j greater than 1. They're easy to track when it happens (always failing with ld* and never complaining), but I simply want to know why.

Offline

#2 2008-01-28 02:58:23

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Why do MAKEFLAGS > j1 fail?

I imagine that the deps in the Makefile aren't quite set correctly, so it tries to link before everything's properly built, but that's just a guess.

Offline

#3 2008-01-28 21:56:45

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: Why do MAKEFLAGS > j1 fail?

you have to remember, some code are not friendly with more than one job server due to inherent design. and of course, you have to understand what a job server is, besides just being a parallel make.

In a normal, serial invocation GNU make will invoke a command script, then wait for it to complete before proceeding with the next command. In a parallel invocation, we usually need to wait on one of two different events: either a job we already invoked completes, or a new token is made available on the jobserver pipe.

http://make.paulandlesley.org/jobserver.html

Other apps will tell you honestly that they need -j1 to compile. Some don't, but after one failure you would know already.

Last edited by schivmeister (2008-01-28 21:58:13)


I need real, proper pen and paper for this.

Offline

#4 2008-01-29 13:29:36

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Why do MAKEFLAGS > j1 fail?

Thanks schivmeister, that was a excellent explanation; Much better than any I found when searching.

Offline

Board footer

Powered by FluxBB