Difference between revisions of "HOWTO build old versions of ns-3 on newer compilers"

From Nsnam
Jump to: navigation, search
(HOWTO on old versions)
 
(update)
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
  
ns-3 builds with the following flags by default:  "-Wall -Werror".  This causes build warnings to trigger an error and stop the build.
+
ns-3 builds with the following flags by default:  "-Wall -Werror".  This causes build warnings to trigger an error and stop the build. This causes problems when trying to build older versions of ns-3 on newer systems with newer compilers, since over time, gcc gets more strict. 
  
This causes problems when trying to build older versions of ns-3 on newer systems with newer compilers, since over time, gcc gets more strict. 
+
To disable warnings from breaking your build, do the following:
 
+
To disable errors from breaking your build, do the following:
+
  
 
   CXXFLAGS="-Wall" ./waf configure
 
   CXXFLAGS="-Wall" ./waf configure
Line 28: Line 26:
 
[http://code.google.com/p/waf/wiki/EnvironmentVariables This page] describes other tricks to configure how waf builds things.  Pass these flags at 'waf configure' time.
 
[http://code.google.com/p/waf/wiki/EnvironmentVariables This page] describes other tricks to configure how waf builds things.  Pass these flags at 'waf configure' time.
  
== specific tips ==
+
== Specific tips ==
  
 
If there is a specific tip for getting past one of these types of issues, please enter it below:
 
If there is a specific tip for getting past one of these types of issues, please enter it below:

Revision as of 21:28, 15 June 2012

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

ns-3 builds with the following flags by default: "-Wall -Werror". This causes build warnings to trigger an error and stop the build. This causes problems when trying to build older versions of ns-3 on newer systems with newer compilers, since over time, gcc gets more strict.

To disable warnings from breaking your build, do the following:

 CXXFLAGS="-Wall" ./waf configure
 ./waf -vv

Now you will observe that all files are built with -Wall and not -Werror; e.g.

 14:16:16 runner system command -> ['/bin/g++', '-Wall', '-fPIC', '-DPIC', '-Idebug', '-I..', '-DNS3_ASSERT_ENABLE', 
 '-DNS3_LOG_ENABLE', '-DNETWORK_SIMULATION_CRADLE', '-DNS3_MODULE_COMPILATION', '../src/common/spectrum-model.cc', 
 '-c', '-o', 'debug/src/common/spectrum-model_1.o']

You may run into other issues (such as missing header files) in trying to build on newer platforms. e.g.

 14:16:16 runner system command -> ['/bin/g++', '-Wall', '-fPIC', '-DPIC', '-Idebug', '-I..', '-DNS3_ASSERT_ENABLE', 
 '-DNS3_LOG_ENABLE', '-DNETWORK_SIMULATION_CRADLE', '-DNS3_MODULE_COMPILATION', '../src/common/spectrum-model.cc', '-c', 
 '-o', 'debug/src/common/spectrum-model_1.o']
 In file included from ../src/common/spectrum-model.cc:22:0:
 debug/ns3/spectrum-model.h:91:3: error: ‘size_t’ does not name a type

This particular error is due to a change in C++ STL; the STL headers no longer incorporate c-style headers, so one must include <cstddef> explicitly.

This page describes other tricks to configure how waf builds things. Pass these flags at 'waf configure' time.

Specific tips

If there is a specific tip for getting past one of these types of issues, please enter it below: