I can not activate sudo in NS-3.29

1,331 views
Skip to first unread message

Henrique Domingues Garcia

unread,
Sep 27, 2018, 12:23:19 PM9/27/18
to ns-3-users
Hi.
I'm trying to install NS 3.29 on a virtual machine with Ubuntu 18.04 to do a simulation with tap-bridge module, but I can not build the simulator with --enable-sudo.

I configure waf:

./waf configure --build-profile = debug --enable-examples --enable-tests --enable-sudo


The response:

Setting top to                           : /home/henrique/ns3/ns-allinone-3.29/ns-3.29
Setting out to                           : /home/henrique/ns3/ns-allinone-3.29/ns-3.29/build
Checking for 'gcc' (C compiler)          : /usr/bin/gcc
Checking for cc version                  : 7.3.0
Checking for 'g++' (C++ compiler)        : /usr/bin/g++
Checking for compilation flag -Wl,--soname=foo support : ok
Checking for compilation flag -std=c++11 support       : ok
Checking for program 'python'                          : /usr/bin/python
Checking for python version >= 2.3                     : 2.7.15
python
-config                                          : /usr/bin/python-config
Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes
Testing pyembed configuration                                      : yes
Asking python-config for pyext '--cflags --libs --ldflags' flags   : yes
Testing pyext configuration                                        : yes
Checking for compilation flag -fvisibility=hidden support          : ok
Checking for compilation flag -Wno-array-bounds support            : ok
Checking for pybindgen location                                    : ../pybindgen-0.17.0.post58+ngcf00cc0 (guessed)
Checking for python module 'pybindgen'                             : 0.17.0.post58+gcf00cc0
Checking for pybindgen version                                     : 0.17.0.post58+gcf00cc0
Checking for code snippet                                          : yes
Checking for types uint64_t and unsigned long equivalence          : no
Checking for code snippet                                          : no
Checking for types uint64_t and unsigned long long equivalence     : yes
Checking for the apidefs that can be used for Python bindings      : gcc-LP64
Checking for internal GCC cxxabi                                   : complete
Checking for python module 'pygccxml'                              : 1.9.1
Checking for pygccxml version                                      : 1.9.1
Checking for program 'castxml'                                     : /usr/bin/castxml
Checking for castxml version                                       : 0.1
Checking boost includes                                            : headers not found, please provide a --boost-includes argument (see help)
Checking boost includes                                            : headers not found, please provide a --boost-includes argument (see help)
Checking for click location                                        : not found
Checking for program 'pkg-config'                                  : /usr/bin/pkg-config
Checking for 'gtk+-3.0'                                            : not found
Checking for 'libxml-2.0'                                          : yes
checking
for uint128_t                                             : not found
checking
for __uint128_t                                           : yes
Checking high precision implementation                             : 128-bit integer (default)
Checking for header stdint.h                                       : yes
Checking for header inttypes.h                                     : yes
Checking for header sys/inttypes.h                                 : not found
Checking for header sys/types.h                                    : yes
Checking for header sys/stat.h                                     : yes
Checking for header dirent.h                                       : yes
Checking for header stdlib.h                                       : yes
Checking for header signal.h                                       : yes
Checking for header pthread.h                                      : yes
Checking for header stdint.h                                       : yes
Checking for header inttypes.h                                     : yes
Checking for header sys/inttypes.h                                 : not found
Checking for library rt                                            : yes
Checking for header sys/ioctl.h                                    : yes
Checking for header net/if.h                                       : yes
Checking for header net/ethernet.h                                 : yes
Checking for header linux/if_tun.h                                 : yes
Checking for header netpacket/packet.h                             : yes
Checking for NSC location                                          : not found
Checking for 'sqlite3'                                             : yes
Checking for header linux/if_tun.h                                 : yes
Checking for python module 'gi'                                    : 3.26.1
Checking for python module 'gi.repository.GObject'                 : ok
Checking for python module 'cairo'                                 : ok
Checking for python module 'pygraphviz'                            : 1.4rc1
Checking for python module 'gi.repository.Gtk'                     : ok
Checking for python module 'gi.repository.Gdk'                     : ok
Checking for python module 'gi.repository.Pango'                   : ok
Checking for python module 'gi.repository.GooCanvas'               : ok
Checking for program 'sudo'                                        : /usr/bin/sudo
Checking for program 'valgrind'                                    : /usr/bin/valgrind
Checking for 'gsl'                                                 : yes
python
-config                                                      : not found
Checking for compilation flag -fstrict-aliasing support            : ok
Checking for compilation flag -fstrict-aliasing support            : ok
Checking for compilation flag -Wstrict-aliasing support            : ok
Checking for compilation flag -Wstrict-aliasing support            : ok
Checking for program 'doxygen'                                     : /usr/bin/doxygen
---- Summary of optional NS-3 features:
Build profile                 : debug
Build directory               :
BRITE
Integration             : not enabled (BRITE not enabled (see option --with-brite))
DES
Metrics event collection  : not enabled (defaults to disabled)
Emulation FdNetDevice         : enabled
Examples                      : enabled
File descriptor NetDevice     : enabled
GNU
Scientific Library (GSL)  : enabled
Gcrypt library                : not enabled (libgcrypt not found: you can use libgcrypt-config to find its location.)
GtkConfigStore                : not enabled (library 'gtk+-3.0 >= 3.0' not found)
MPI
Support                   : not enabled (option --enable-mpi not selected)
NS
-3 Click Integration        : not enabled (nsclick not enabled (see option --with-nsclick))
NS
-3 OpenFlow Integration     : not enabled (Required boost libraries not found)
Network Simulation Cradle     : not enabled (NSC not found (see option --with-nsc))
PlanetLab FdNetDevice         : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
PyViz visualizer              : enabled
Python API Scanning Support   : enabled
Python Bindings               : enabled
Real Time Simulator           : enabled
SQlite stats data output      : enabled
Tap Bridge                    : enabled
Tap FdNetDevice               : enabled
Tests                         : enabled
Threading Primitives          : enabled
Use sudo to set suid bit      : enabled
XmlIo                         : enabled
'configure' finished successfully (5.434s)


But when I try to build:

henrique@henrique-virtual-ubuntu:~/ns3/ns-allinone-3.29/ns-3.29$ ./waf build
Waf: Entering directory `/home/henrique/ns3/ns-allinone-3.29/ns-3.29/build'
Traceback (most recent call last):
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Scripting.py", line 118, in waf_entry_point
    run_commands()
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Scripting.py", line 178, in run_commands
    ctx=run_command(cmd_name)
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Scripting.py", line 169, in run_command
    ctx.execute()
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Scripting.py", line 366, in execute
    return execute_method(self)
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Build.py", line 93, in execute
    self.execute_build()
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Build.py", line 96, in execute_build
    self.recurse([self.run_dir])
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/wscript", line 872, in build
    bld.recurse('src')
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/src/wscript", line 327, in build
    bld.recurse(list(all_modules))
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/Context.py", line 126, in recurse
    user_function(self)
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/src/fd-net-device/wscript", line 134, in build
    creator = bld.create_suid_program('tap-device-creator')
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/wscript", line 710, in create_suid_program
    program.create_task("SuidBuild")
  File "/home/henrique/ns3/ns-allinone-3.29/ns-3.29/.waf-2.0.9-897e824215d3dab2b64982d8af27db90/waflib/TaskGen.py", line 138, in create_task
    task=Task.classes[name](env=self.env.derive(),generator=self)
KeyError: 'SuidBuild'

if I try to clean with "./waf clean" a exactly the same error appears.

So I remove the ".lock-waf_linux2_build" file, configure waf without the sudo option (./waf configure --build-profile=debug --enable-examples --enable-tests) and the waf compiles correctly. 

How to I correct this error?


Manuel Requena

unread,
Sep 28, 2018, 4:58:05 AM9/28/18
to ns-3-...@googlegroups.com
Hi,

It seems build system doesn't work when sudo is enabled.

In the mean time, please, could you apply the attached patch?

Best regards,
Manuel


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
patch-wscript.patch

Henrique Domingues Garcia

unread,
Sep 28, 2018, 8:43:43 AM9/28/18
to ns-3-users
Thank you! 

Now it works.

best,
Henrique

Song Tan

unread,
Oct 4, 2018, 11:59:24 AM10/4/18
to ns-3-users
How can I apply this patch? Could you share more details? I encounter the same error.


Thanks

Tom Henderson

unread,
Oct 4, 2018, 12:47:43 PM10/4/18
to ns-3-...@googlegroups.com, Song Tan
On 10/04/2018 08:59 AM, Song Tan wrote:
> How can I apply this patch? Could you share more details? I encounter
> the same error.

1) change into your ns-3 directory.

2) download the patch file into this directory. Let's call it
'enable-sudo.patch'

3) Try to test its compatibility with the following command:

$ patch -p1 -i enable-sudo.patch --dry-run

It should report:
checking file wscript

This indicates that the patch would have applied cleanly (if it
indicates a problem, you will need to resolve the problem).

4) Apply it for real by removing the '--dry-run' argument:

$ patch -p1 -i enable-sudo.patch

It should report:
patching file wscript

Henrique Domingues Garcia

unread,
Oct 4, 2018, 3:29:03 PM10/4/18
to ns-3-users
I know this is not the most correct way, but if the error is of type "KeyError: 'SuidBuild'" (in NS-3.29 only), just edit the wscript file in "ns-allinone-3.29/ns-3.29" folder, line 710, 

of:
program.create_task ("SuidBuild")

for:
program.create_task ("SuidBuild_task")



Best regards,
Henrique
Reply all
Reply to author
Forward
0 new messages