Bugzilla – Bug 705
netanim code does not build on win32
Last modified: 2009-11-05 05:35:41 UTC
Created attachment 618 [details] disable netanim if the includes are missing netanim code does not build on win32 (mingw) due to the missing includes (sys/socket.h for one).
This looks good to me. I'll CC Dr. Riley to make sure he sees this one. Thanks Gustavo.
Wouldn't it be better to just #ifdef out the socket output feature of NetAnim if the socket includes can't be found? George
(In reply to comment #2) > Wouldn't it be better to just #ifdef out the socket output feature of > NetAnim if the socket includes can't be found? > George > Possibly. I do not know enough of the net-anim code to know for sure, I was just trying to make mingw compile again. So you are telling me that net-anim is still useful without the socket code and should still be compiled?
Created attachment 619 [details] start of patch To bootstrap the second approach, here's a patch that disables the socket includes if they are not found. But now someone more knowledgeable than me about netanim should figure out how to disable the rest of the code that uses sockets, and code to put as fallback.
(In reply to comment #4) > Created an attachment (id=619) [details] > start of patch > > To bootstrap the second approach, here's a patch that disables the socket > includes if they are not found. But now someone more knowledgeable than me > about netanim should figure out how to disable the rest of the code that uses > sockets, and code to put as fallback. > I posted this reply earlier today but for some reason appears to not have gone through. The short answer is that yes, the Animator is quite useful without the sockets. The sockets interface simply allows an animation to connect to a "running" simulation and display the state as the simulation progresses. Without sockets, the animation interface can write to a file (which I suspect is the most popular approach anyway). After the simulation completes the animator reads the file and animates after the fact. George
Created attachment 644 [details] full patch Ok, all I've done is used Gustavo's patch and added in the ifdefs around AnimationInterface::SetServerPort and also in test-dumbbell where this function is potentially called. I also moved the #include "ns3/net-anim-config.h" in animation-interface.cc to animation-interface.h, because I needed to ifdef out the where SetServerPort is defined.
(In reply to comment #6) > Created an attachment (id=644) [details] > full patch > > Ok, all I've done is used Gustavo's patch and added in the ifdefs around > AnimationInterface::SetServerPort and also in test-dumbbell where this function > is potentially called. I also moved the #include "ns3/net-anim-config.h" in > animation-interface.cc to animation-interface.h, because I needed to ifdef out > the where SetServerPort is defined. > Also, using my patch will require that the "start of patch" that Gustavo posted be applied first (so I shouldn't have crossed it out).
Created attachment 645 [details] Patch to make mingw building works Hi all, Here is a patch for this bug, I verified it works under linux and mingwin. Please take a look at it and if it is good, I will apply it to ns-3-dev. Basically it contains the changes done by Gustavo, I removed the includes socket.h and in.h in point-to-point-dubbell-helper.cc (not used) and added an include fcntl.h conditional to MINGW platform in order to support the file operations. Josh you can if you want combine our patches and produce a final patch if you need to add anything else. The #if I put it inside AnimationInterface::SetServerPort sothat I don't need to put another one in test-dumbbell and it will return false under Mingw. Best regards Faker Moatamri
Hi all, Here is a patch for this bug, I verified it works under linux and mingwin. Please take a look at it and if it is good, I will apply it to ns-3-dev. Basically it contains the changes done by Gustavo, I removed the includes socket.h and in.h in point-to-point-dubbell-helper.cc (not used) and added an include fcntl.h conditional to MINGW platform in order to support the file operations. Josh you can if you want combine our patches and produce a final patch if you need to add anything else. The #if I put it inside AnimationInterface::SetServerPort sothat I don't need to put another one in test-dumbbell and it will return false under Mingw. Best regards Faker Moatamri
Sorry for duplicate posts and sorry Josh, I didn't know that you were working on it, can you please take a look at my patch and tell me if there are some changes that needs to be done? Thanks
(In reply to comment #10) > Sorry for duplicate posts and sorry Josh, I didn't know that you were working > on it, can you please take a look at my patch and tell me if there are some > changes that needs to be done? > Thanks > No problem. I think your patch is better, and I am happy with the changes. No objections from me.
changeset 5477 ff7b28fe6a5c