Performance drop after Ubutnu upgrade - g++ -O3 parameter missing

29 views
Skip to first unread message

Daniel Brettschneider

unread,
Jul 1, 2016, 4:10:15 AM7/1/16
to ns-3-users
Hi,

I recently upgrade Ubuntu from 14.04 to 16.04. Since then, ns-3.22 had a significant drop in performance. After a lot of searching I noticed some missing g++ parameters compared to the old installation:

Old installation:
- Ubuntu 14.04
- gcc and g++ 4.8
- configured as optimized
-> runner ['/usr/bin/g++', '-O3', '-g', '-Wall', '-Werror', '-march=native', '-fstrict-overflow', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fopenmp', '-fPIC', '-pthread', ...

New installation:
- Ubuntu 16.04
- gcc and g++ 5.3
- copied the workspace, same configuration
-> runner ['/usr/bin/g++', '-march=native', '-fstrict-overflow', '-fPIC', '-pthread', ...

For now I'm using CXXFLAGS="-O3".

Is there something I'm overlooking during installation of ns-3, like any missing dependencies? In my understanding "./waf configure -d optimized" should activate -O3 etc.

Thanks for your help
Daniel

Daniel Brettschneider

unread,
Jul 1, 2016, 7:59:44 AM7/1/16
to ns-3-users
I just stumbled over the "error".

When using CXXFLAGS during configuration, the build-profile is not used any more. The flags are overwritten.
For example:
CXXFLAGS="-Wno-error" ./waf configure -d optimized
In this case only "-Wno-error" is set and the others (-O3 etc) are missing.
Same for "-d debug".

The solution is to use CXXFLAGS_EXTRA.
A lot of websites do not mention that.

Matt Anonyme

unread,
Jul 1, 2016, 10:41:49 AM7/1/16
to ns-3-users
This is sthg I noticed too,  IIRC, placing the CXXFLAGS after $ ./waf such as $ ./waf CXXFLAGS="" had the desired result.
Reply all
Reply to author
Forward
0 new messages