[ndnSIM] Trying to re-compile ndnSIM class Forwarder

Spyridon (Spyros) Mastorakis mastorakis at cs.ucla.edu
Sun May 21 20:00:35 PDT 2017


Hi John,

first of all, I would suggest that you take a look at how an NDN code repository is built and installed on your system. I would also suggest that you take a look at how a compiler and linker work and how you should write wscripts.

For all the opens-source software projects that I have seen so far, there is the common convention that code under the src/ directory is supposed to be modified and compiled, while the compiled code and most probably the included header files are supposed to be under the build/ directory.

It is not clear to me what is wrong in your case. I have followed a similar approach a number of times and it worked fine.

How do you get the Forwarder instance of a simulated node in your simulation scenario?

Thanks,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA

> On May 21, 2017, at 3:43 PM, John Baugh <jpbaugh at umich.edu> wrote:
> 
> Still no progress since last night sadly.
> 
> If any of you have a suggestion or answers to any of my questions below please give your input.  I think I'm fairly close, but I'm missing something I believe.
> 
> Thanks
> 
> John
> 
> 
> On May 21, 2017 2:25 AM, "John Baugh" <jpbaugh at umich.edu <mailto:jpbaugh at umich.edu>> wrote:
> Greetings again friends,
> 
> After some good advice from Ashlesh, I was able to get a different error (seems to be a linker error now instead of a compiler error... progress is progress I suppose.)
> 
> So, related to this:
> 
> 1.)  There appear to be multiple waf copies in different directories.  Under what circumstances would you run, say, the waf inside the NFD directory as opposed to the one at the top level ns-3 directory?
> 
> 2.)  I ran the following from the ns-3 directory:
> * ./waf distclean
> * ./waf configure
> *./waf
> *sudo waf install
> 
> 
>     If you recall, I modified the forwarder.cpp file and the forwarder.hpp file in the src/ndnSIM/NFD/daemon/fw directory to contain a printMessage method.  I made sure it was public.
> 
>     After the ./waf commands aforementioned, I checked the ns-3/build/ns3/ndnSIM/NFD/daemon/fw directory, and the forwarder.hpp file does seem to be a copy of the one from the src/ndnSIM/NFD.... directory.  
> 
>     But I am now getting a linker error:
> 
>     "... scenarios/ndn-simple2.cpp:120: undefined reference to 'nfd::Forwarder::printMessage()
>          collect2: error: ld returned 1 exit status"
> 
> 
> Ideas?
> 
> Thanks,
> 
> John
> 
> On Fri, May 19, 2017 at 2:35 AM, John Baugh <jpbaugh at umich.edu <mailto:jpbaugh at umich.edu>> wrote:
> Greetings again friends,
> 
> I'm up working on this trying to get my scenario to work with a custom forwarder again at nearly 3 a.m. on my birthday.  I'm not sure if that's dedication or insanity.  ;)
> 
> I spent another 4-5 hours trying to figure out this specific problem tonight, but with no luck.  I have found the following:
> 
> 1.  forwarder.hpp lives in both ns-3/build/ns3/ndnSIM/NFD/daemon/fw as well as ns-3/src/ndnSIM/NFD/daemon/fw
>      The later also has a forwarder.cpp in it.
> 
> 2.  Which one of the copies (?) of forwarder.hpp mentioned above am I supposed to change / modify for my scenarios to use it instead of the default one?  Where is the corresponding forwarder.cpp file for the one in ns-3/build path (there is one in the ns-3/src path, but none to be found in ns-3/build path mentioned above)
> 
> 3.  Why is there a waf in so many different directories?  They seem to be specialized to the different components of ndnSIM, such as NFD, ndn-cxx, and specific scenarios -  Perhaps I'm using the wrong one(s)?
> 
> 4.  My scenarios are still saying that the Forwarder class doesn't have a printMessageForTest method, even though I have it declared in both the copies of forwarder.hpp, and have it defined in forwarder.cpp.  I tried recompiling using ./waf in various directories, and I cannot find a solution to this problem.
> 
> I appreciate your patience again.  This is a really irritating situation, and I'm fairly certain there's something simple I'm missing.  Any help would be greatly appreciated.
> 
> Thanks,
> 
> John
> 
> On Thu, May 18, 2017 at 2:47 AM, John Baugh <jpbaugh at umich.edu <mailto:jpbaugh at umich.edu>> wrote:
> Greetings ndnSIM friends,
> 
> 
> I've spent the last few days working on trying to modify the Forwarder class (which I did - I modified ns-3/src/ndnSIM/NFD/daemon/fw/forwarder.[hpp, cpp])
> 
> However, ./waf doesn't seem to work properly.  I even did a ./waf clean and ./waf build.  On one of the runs of ./waf I did notice it (apparently?) successfully re-build the forwarder.cpp file.
> 
> What I did was add a method (the prototype to .hpp and definition to .cpp) called printMessageForTest())
> 
> I would assume that after ndnSIM was rebuilt with ./waf that my scenario, which calls printMessageForTest on the forwarder would actually work, but it doesn't recognize it.
> 
> Any clue what's going on?
> 
> Alternatively, if anyone could give an appropriate procedure for ensuring all changes make it into the system when modifications of actual ndnSIM files are made, it would be appreciated.
> 
> Looking forward to hearing from you,
> 
> John
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170521/61ed87e2/attachment-0001.html>


More information about the ndnSIM mailing list