c - Why might a (makefile) build work serially but not in parallel, and would pattern matching cause such an issue? -


essentially, have large project ordinarily takes incredible amount of time build. reason, better use -j option , divide bunch of jobs, speeding process. seems when do this, build crash @ seemingly random times. if keep trying, build work. not experienced makefiles (i have worked them before, none large this), @ loss why fails.

the thing can think of why happen makefile made out of pattern based rules. (if not using terminology correctly, mean rule looks this...)


$(outdir)/%.o: $(exampledir)/%.c

...

...


so result in problems -j option? on right track or wrong (if cause these types of problems)?

thank in advanced reading this

to clear, make not multithreaded. it's single-threaded, invokes multiple programs simultaneously parallel job support.

the short answer is, no, there's nothing pattern rules problematic parallel builds.

if build works serially fails when run in parallel, , particularly if works if keep running on , over, reason makefiles wrong: there dependencies between 1 or more of targets haven't encoded in makefile, make doesn't know them, @andrew says.

the way fix @ file failed compile, , see why failed (what file missing caused compile failure), make sure file listed prerequisite of target need it. wash, rinse, , repeat.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -