<div><div class="gmail_quote"><div dir="auto">Hi John</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>I, for example, modified some files in ns-3/src/ndnSIM/NFD/daemon/fw that I had created, primarily adding a new member function (method) to a class in that folder.  </div><div><br></div><div>1.)  Configure and build ns-3</div><div>

2.)  Then, in your scenario directory:</div><div>

<pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:13.6px;margin-top:0px;margin-bottom:16px;word-wrap:normal;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:13.6px;padding:0px;margin:0px;background:transparent;border-radius:3px;word-break:normal;white-space:pre-wrap;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">./waf configure
./waf --run scenario</code></pre>

</div></div></blockquote><div dir="auto">This is insufficient in general. You also need `./waf distclean` before `./waf configure` in scenario.</div><div dir="auto">It is not strictly necessary when you are just adding a function or changing a function body in a .cpp of ns-3. It matters when you are modifying an existing function in a .hpp of ns-3, e.g. changing a default argument value, changing the body of an inline function.</div><div dir="auto">The reason is: Waf meta build system only tracks changes of the current project (i.e. scenario), but does not track changes of a system library (ns-3). Inline functions are compiled into .o objects in scenario/build. Even if they are changed in ns-3, Waf would not detect the changes and rebuild .o objects. That would eventually lead to linker errors.</div><div dir="auto"><br></div><div dir="auto">The above paragraph equally applies to building NFD, ndn-tools, etc after changing ndn-cxx, when not in ndnSIM context.</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>These commands were of course, copied from the README file.  But I had assumed I just needed "./waf configure" instead of "./waf configure -d optimized" in the ns-3 folder, and that assumption cost me quite a bit of time.</div></div></blockquote><div dir="auto">`./waf configure` causes ns-3 to build in debug mode that installs a separate set of .so libraries, alongside with the optimized .so libraries built from old ns-3 code. Scenario could continue to pick up the optimized version.</div><div dir="auto">If you need to debug (gdb, etc) ns-3 through the scenario (although it’s better to debug ns-3 by putting unit tests into ns-3 itself), you can install debug libraries but you have to delete the optimized libraries (look for them in /usr/local/lib).</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Yours, Junxiao</div></div></div>