Issues compiling PhySim-WiFi in/with NS-3-24.1

263 views
Skip to first unread message

Viktor Nikolaidis

unread,
Oct 30, 2015, 11:58:29 AM10/30/15
to ns-3-users
Hi all,

I have some problems compiling the PhySim model from here [https://dsn.tm.kit.edu/english/ns3-physim.php] using the NS-3-13 as they distributed it with or even importing it to the latest stable release of NS3.

The following messages have appeared after having tried to import physim-wifi in the source folder of NS3 simply by copying-pasting. I have already build ns-3.24.1 once with examples and tests and now I want to include this extra physim-wifi extra module.

What is going wiong?

Traceback (most recent call last):
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Scripting.py", line 108, in waf_entry_point
    run_commands()
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Scripting.py", line 169, in run_commands
    ctx=run_command(cmd_name)
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Scripting.py", line 160, in run_command
    ctx.execute()
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Scripting.py", line 370, in execute
    return execute_method(self)
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Build.py", line 104, in execute
    self.execute_build()
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Build.py", line 107, in execute_build
    self.recurse([self.run_dir])
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/wscript", line 775, in build
    bld.recurse('src')
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/src/wscript", line 327, in build
    bld.recurse(list(all_modules))
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/.waf-1.8.12-f00e5b53f6bbeab1384a38c9cc5d51f7/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/home/userfolder/Documents/NS3/ns_allinone_3_24_1/ns-3.24.1/src/physim-wifi/wscript", line 76, in build
    bld.add_subdirs('examples')
AttributeError: 'BuildContext' object has no attribute 'add_subdirs'


Or in the other case I get the following output and the compilation procedure stops...

Build failed
 -> task failed (exit status 1): 
{task 140012159078608: cxx animation-interface.cc -> animation-interface.cc.1.o}
['/usr/bin/g++', '-Wall', '-DNO_INT_SIZE_CHECK', '-fPIC', '-pthread', '-pthread', '-Ibuild/src/netanim', '-Isrc/netanim', '-Ibuild', '-I.', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DPYTHONDIR="/usr/local/lib/python2.7/dist-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/dist-packages"', '-DHAVE_PYTHON_H=1', '-DENABLE_GSL', '../src/netanim/model/animation-interface.cc', '-c', '-o', 'src/netanim/model/animation-interface.cc.1.o']

Konstantinos

unread,
Oct 30, 2015, 12:09:24 PM10/30/15
to ns-3-users
Hi Viktor,

Try to re-create the wscript file for the new module as there are certain changes in WAF since ns-3.13
The easiest method is to use the create-module.py found in the /src as explained in the manual https://www.nsnam.org/docs/manual/html/new-modules.html

Then add the files and update the wscript source/headers and any other information needed.
Finally, clean and re-configure and re-build.

Regards,
K.

Konstantinos

unread,
Oct 30, 2015, 12:11:35 PM10/30/15
to ns-3-users
Just to add, you might have difficulties running it as it is (i.e. in ns-3.13) with newer compilers since they are becoming stricter.
This might help you build ns-3.13 (https://www.nsnam.org/wiki/HOWTO_build_old_versions_of_ns-3_on_newer_compilers) but the proper way is to port forward to ns-3.24.1 as you try.

Viktor Nikolaidis

unread,
Nov 4, 2015, 6:02:50 PM11/4/15
to ns-3-users
Hi Konstantinos,

Many many thanks for your extremely fast reply. I followed your advice, which coincidentally was my conclusion at the end as well to import the module from the NS-3.13 release to the current stable version of NS (3.24.1). However, it is harder than one can imagine. I had absolutely no idea with what am I messing with. Just to note that regarding the information using different flags for the compiler I had stumbled across the link you also provided me with but it did not seem to make much difference during compilation in my case (at least with my untrained eye). Therefore I continue with the new errors trying to import the “physim-wifi” module to ns-3.24.1. After creating the directory structure with “./create-module.py” I started again the procedure with ./waf configure in order to move to ./waf at some point. 


First error was the following:

  File "/home/viktor/Documents/ns-allinone-3.24.1/ns-3.24.1/src/physim-wifi/wscript", line 4, in configure

    have_itpp = conf.pkg_check_modules('IT++', 'itpp', mandatory=True)

 

This problem I think it is easily solved using help from here (which I followed) [http://permalink.gmane.org/gmane.network.simulator.ns3.user/30118] and making the following changes to the waf script for physim-wifi

 

Instead of

def configure(conf):

    have_itpp = conf.pkg_check_modules('IT++', 'itpp', mandatory=True)

    conf.env['ENABLE_ITPP'] = have_itpp

    conf.report_optional_feature("IT++", "IT++ library",

                                 conf.env['ENABLE_ITPP'],

                                 "IT++ not found")

 

I replaced it with

def configure(conf):

    # have_itpp = conf.pkg_check_modules('IT++', 'itpp', mandatory=True)

    # conf.env['ENABLE_ITPP'] = have_itpp

    conf.env['ENABLE_ITPP'] = conf.check(mandatory=True, lib='itpp', define_name='IT++', uselib_store='IT++')

    conf.report_optional_feature("IT++", "IT++ library",

                                 conf.env['ENABLE_ITPP'],

                                 "IT++ not found")

 

It seems to work for a moment, but when moving to ./waf then the following error comes up in the surface.

 

  File "/home/viktor/Documents/ns-allinone-3.24.1/ns-3.24.1/src/physim-wifi/wscript", line 53, in build

    headers = bld.new_task_gen(features=['ns3header'])

 

which I think that with careful inspection is also easily solved by replacing the previous line with the following in the wscript.

 

headers = bld(features='ns3header')

 

Then there is another message regarding the “Examples”

 

File "/home/viktor/Documents/ns-allinone-3.24.1/ns-3.24.1/src/physim-wifi/wscript", line 77, in build

    bld.add_subdirs('examples')

 

which again I think is solved by replacing the above line with the following:

 

bld.recurse('examples')

 

Then I got the following error which was solved using your advice as well.

 

<command-line>:0:3: error: missing whitespace after the macro name [-Werror]

cc1plus: all warnings being treated as errors

 

Waf: Leaving directory `/home/viktor/Documents/ns-allinone-3.24.1/ns-3.24.1/build'

Build failed

 -> task in 'ns3-wave-test' failed (exit status 1):

                {task 140322515698768: cxx ocb-test-suite.cc -> ocb-test-suite.cc.3.o}

['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-DNO_INT_SIZE_CHECK', '-I../src/wave', '-fPIC', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DIT++=1', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '-DNS_TEST_SOURCEDIR="src/wave/test"', '../src/wave/test/ocb-test-suite.cc', '-c', '-o', '/home/viktor/Documents/ns-allinone-3.24.1/ns-3.24.1/build/src/wave/test/ocb-test-suite.cc.3.o']

 

<command-line>:0:3: error: missing whitespace after the macro name [-Werror]

cc1plus: all warnings being treated as errors

 

and now finally I have stuck here:

 

../src/physim-wifi/test/physim-wifi-transmitter-receiver-test.cc:33:33: fatal error: ns3/random-variable.h: No such file or directory

 #include "ns3/random-variable.h"

 

Which was solved using your online advice ;-) from here [https://groups.google.com/forum/#!topic/ns-3-users/VdAt1U7qqbc]. I admit this error appeared a coupled of times!!!

 

But now I am stuck in the following error message:

 

In file included from ../src/physim-wifi/examples/physim-wifi-example.cc:4:0:

./ns3/physim-wifi-helper.h:157:30: error: invalid abstract return type for function ‘static ns3::PhySimWifiPhyHelper ns3::PhySimWifiPhyHelper::Default()’

   static PhySimWifiPhyHelper Default (void);

                              ^

./ns3/physim-wifi-helper.h:143:7: note:   because the following virtual functions are pure within ‘ns3::PhySimWifiPhyHelper’:

 class PhySimWifiPhyHelper : public WifiPhyHelper,

       ^

In file included from ./ns3/physim-wifi-helper.h:28:0,

                 from ../src/physim-wifi/examples/physim-wifi-example.cc:4:

./ns3/wifi-helper.h:65:24: note:                virtual ns3::Ptr<ns3::WifiPhy> ns3::WifiPhyHelper::Create(ns3::Ptr<ns3::Node>, ns3::Ptr<ns3::NetDevice>) const

   virtual Ptr<WifiPhy> Create (Ptr<Node> node, Ptr<NetDevice> device) const = 0;

 

 

What changes do I have to make in the PhySim module regarding the new version of Random-Variable-Stream Header that is used by the newer NS3 versions? Have you faced anything similar before?


Please, your help and any hint & tip will prove invaluable. Thanks in advance!!!


Best Regards,


Viktor


P.S. My long message did not intent to bore or overkill YOU with details, but I posted it as mere guide to others that may face similar problems like me. Therefore I have all the steps and helpful sources gathered and posted here.

 

Reply all
Reply to author
Forward
0 new messages