Ever since I learned about -j I’ve used -j8 blithely. The other day I was compiling an atlas installation and the make failed. Eventually I tracked it down to things being made out of order – and it worked fine once I went back to singlethreaded make. This makes me nervous. What sort of conditions do I need to watch for when writing my own make files to avoid doing something unexpected with make -j?
Share
I think make -j will respect the dependencies you specify in your Makefile; i.e. if you specify that objA depends on objB and objC, then make won’t start working on objA until objB and objC are complete.
Most likely your Makefile isn’t specifying the necessary order of operations strictly enough, and it’s just luck that it happens to work for you in the single-threaded case.