Bug 1586

Summary: Building documentation fails if make runs in parallel
Product: ns-3 Reporter: Timo Lindhorst <tlnd>
Component: build systemAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, pdbarnes, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: PC   
OS: Linux   
Attachments: Don't run make in parallel when building documentation

Description Timo Lindhorst 2013-02-14 09:55:19 UTC
If Make runs in parallel, building the documentation fails. This happen e.g. if one has set MAKEFLAGS="-j 8" by default.


To reproduce run:

$ MAKEFLAGS="-j 8" ./waf docs

which results in 

--------------------
....
[waf] Building sphinx docs for doc/models
dia -t eps source-temp/figures/testbed.dia -e source-temp/figures/testbed.eps
dia -t eps source-temp/figures/emulated-channel.dia -e source-temp/figures/emulated-channel.eps
make: *** No rule to make target `source-temp/figures/packet.dia', needed by `source-temp/figures/packet.eps'.
dia -t eps source-temp/figures/node.dia -e source-temp/figures/node.eps
make: *** No rule to make target `source-temp/figures/buffer.dia', needed by `source-temp/figures/buffer.eps'.
make: *** No rule to make target `source-temp/figures/sockets-overview.dia', needed by `source-temp/figures/sockets-overview.eps'.
dia -t eps source-temp/figures/antenna-coordinate-system.dia -e source-temp/figures/antenna-coordinate-system.eps
make: *** No rule to make target `source-temp/figures/internet-node-send.dia', needed by `source-temp/figures/internet-node-send.eps'.
...
Sphinx build of doc/models returned an error.
--------------------

Since make runs in parallel, copying files to source-temp/figures/ runs concurrently to converting those files. Thus, some conversions succeed, others fail, depending on whether the actual file already has been copied or not. The overall build fails eventually.
Comment 1 Timo Lindhorst 2013-02-14 10:10:19 UTC
Created attachment 1512 [details]
Don't run make in parallel when building documentation

This patch forces make not to run in parallel when building documentation. This fixes the present bug. The optimal solution would probably allow parallel runs without concurrency problems, however, as documentation is not build that often, this might be a sufficient solution.
Comment 2 Peter Barnes 2013-02-15 16:06:48 UTC
Need same patch in all documentation Makefiles:
doc/manual/Makefile
doc/models/Makefile
doc/tutorial/Makefile
doc/tutorial-pt-br/Makefile

(In reply to comment #1)
> Created attachment 1512 [details]
> Don't run make in parallel when building documentation
Comment 3 Tom Henderson 2013-02-19 00:06:55 UTC
changeset 0f783cfd9041