Hi I have a question about Bug 1770

26 views
Skip to first unread message

鄒明緯

unread,
Jan 7, 2015, 3:35:01 AM1/7/15
to ns-3-...@googlegroups.com
Hi I am a beginner about linux and NS3. I used 32-bit linux system for NS3 simulator and there was a bug 1770 when i was compiling mesh.cc.
I can't understand the explanation on release about bug 1770. Why can I lower the optimization
level to -O1 in this case and used as a workaround ? Is there any way to lower the optimization level in NS3?

I think I need modified method step by step.  I also tried the method as follows in https://groups.google.com/forum/#!topic/ns-3-users/W1bfmks4tNg

 edit the 'wscript' file as follows, perform 
a './waf clean', then another './waf build': 

@@ -46,7 +46,7 @@ 
  cflags.profiles = { 
          # profile name: [optimization_level, warnings_level, debug_level] 
          'debug':     [0, 2, 3], 
-        'optimized': [3, 2, 1], 
+        'optimized': [1, 2, 1], 
          'release':   [3, 2, 0], 
          } 
  cflags.default_profile = 'debug' 


I think I have done something wrong as I was trying this method. The order I modified is first edit the ''wscript'' file and second (in /ns-3.19) I perform './waf clean' then perform './waf build' 
And it still can not compile 'mesh.cc'. The error is still there. I need some help~~~~~

Thanks for helping
Regards,
Danny Tsou 

Tommaso Pecorella

unread,
Jan 7, 2015, 11:52:36 AM1/7/15
to ns-3-...@googlegroups.com
Hi,

try "waf distclean", then "waf configure" (plus the options you need) and re-build.

Hope this helps,

T.

Tommaso Pecorella

unread,
Jan 7, 2015, 11:53:06 AM1/7/15
to ns-3-...@googlegroups.com
Oh, forgot...

upgrade to 3.21 !

Cheers,

T.

pdbarnes

unread,
Jan 7, 2015, 12:31:10 PM1/7/15
to ns-3-...@googlegroups.com
IIRC an issue in mesh has been fixed since ns-3.19, so updating to ns-3.21 is a great idea, as Tommaso suggests.

Another thing to consider (for completeness on this list): instead of modifying the optimization level, you could just configure debug. This should cost about a factor two in execution speed, which for many modest models could be acceptable. By configuring debug you turn off compiler optimizations completely and sidestep the issues in Bug 1770.

I'll take a look at the Bug 1770 notes and see if we can't make them clearer.

Thanks,
Peter

Tom Henderson

unread,
Jan 7, 2015, 12:39:22 PM1/7/15
to ns-3-...@googlegroups.com
On 01/07/2015 12:35 AM, 鄒明緯 wrote:
> Hi I am a beginner about linux and NS3. I used 32-bit linux system for
> NS3 simulator and there was a bug 1770 when i was compiling mesh.cc.
> I can't understand the explanation on release about bug 1770. Why can I
> lower the optimization
>
> level to -O1 in this case and used as a workaround ? Is there any way tolower the optimization level in NS3?


I will try to look at this more closely today on a gcc-4.8.2 system.
There may be more going on than the segmentation fault identified in bug
1770. In the meantime, here are some options:

- ns-3 supports 'debug' and 'optimized' build profiles. I have only
seen these problems on optimized builds. By default, ns-3 builds in
'debug' mode. Can you try to configure the project in debug mode and
see if you still get a compilation error? If no error, I suggest to use
the debug mode

- if you are not using mesh module, you can remove it from your build.
The brute force way to do so is to simply remove the directory
'src/mesh' altogether. The way to do it by configuration is to use the
'enable-modules' feature described here, taking care to select only the
modules that you want:

http://www.nsnam.org/docs/manual/html/enable-modules.html

- if it is the optimization problem described in bug 1770, then editing
the line in the wscript as I described in the bug report fixed it for
me; specifically, in the line that says

'optimized': [3, 2, 1],

you must change the first '3' into a '1'. Then you need to reconfigure
the project and rebuild it.

If these things do not work, please copy/paste the error that your
compiler is generating into any follow up post that you write.

- Tom

Tom Henderson

unread,
Jan 7, 2015, 6:38:36 PM1/7/15
to ns-3-...@googlegroups.com
On 01/07/2015 12:35 AM, 鄒明緯 wrote:
> Hi I am a beginner about linux and NS3. I used 32-bit linux system for
> NS3 simulator and there was a bug 1770 when i was compiling mesh.cc.
> I can't understand the explanation on release about bug 1770. Why can I
> lower the optimization
>
> level to -O1 in this case and used as a workaround ? Is there any way tolower the optimization level in NS3?


Hi, here is some more information, from testing on a Fedora 20 machine
today, 32-bit (gcc-4.8.3).

In debug mode, everything compiles, and I get no test failures.

In optimized mode, I tested both ns-3-dev and ns-3.19.

In ns-3.19, everything compiles in optimized mode, but there are two
test failures: devices-mesh-dot11s-regression src/mesh/examples/mesh

In ns-3-dev, everything compiles in optimized mode, but there are three
test failures:

List of FAILed tests: ipv4-global-routing
List of CRASHed tests: devices-mesh-dot11s-regression
src/mesh/examples/mesh

I think we can consider that bug 1770 covers the above (I'll look into
also why the ipv4-global-routing is failing, or else enter a separate
bug if warranted).

However, above, you are saying that there is a compilation issue, which
would be something else. If so, can you tell us the compilation error?

- Tom

鄒明緯

unread,
Jan 8, 2015, 3:08:23 AM1/8/15
to ns-3-...@googlegroups.com
Thanks everyone, I changed the g++ compiler version to 4.6 and it was successful to compile. I have tried the method above you had mentioned but it still couldn't work
I already updated to ns-3.21 and  changed the first '3' into a '1' then rebuild it as you mentioned.

'optimized': [3, 2, 1], 

Beside, I tried  "waf distclean", then "waf configure" (plus the options you need) then re-build but it didn't worked as well.
I also tried ''/waf -d debug level configure'' to change to debug mode but  it didn't worked as well.
I installed g++ 4.6 and chchanged the g++ compiler version by ''CXX=g++-4.6 ./waf configure" and it can successfully compile.
I think it works successfully and thanks for your help
Love you guys~~~~~

Thanks for helping
Regards,
Danny Tsou 





鄒明緯於 2015年1月7日星期三UTC+8下午4時35分01秒寫道:
Reply all
Reply to author
Forward
0 new messages