Open nzentzis opened 8 years ago
Thanks for listing this issue. Here is what's going on (as well as I understand it).
When a file x.grace is compiled with --target c
, three files are produced: x.gct (containing the inter-module linkage tables), x.gcn (containing the statically-linkable object code), and x.gso (containing the dynamically-linkable object code). I've not been able to figure out how to teach make about this parallel build behaviour. The documentation that I have read suggests that one can use fake pattern rules to describe parallel build behaviour, but using gnu Make on the Mac, I could not get this to work.
If I add in all of the dependencies, then make starts building x.grace twice in two parallel threads, once because x.gcn is needed on one target, and a second time because x.gct is needed by a second target. This, of course, is disasterous, and results in file corruption.
If you can figure out how to tell make about the build behaviour, then we can probably add the missing dependencies without too much problem. Right now the Makefile contains dependencies on the .gct files only (IIRC), because building the .gct file will force the building of the .gso and .gcn files along the way.
From a clean copy of the repository, attempting to build the compiler using
make -j N
for any N>1 fails with the error:For comparison, when I force the build process to run synchronously using
make -j 1
, it compiles and tests fine. It seems like there's a missing dependency between build targets, but I'm not sure what exactly it is.