usnistgov / NetSimulyzer

A flexible 3D visualizer for displaying, debugging, presenting, and understanding ns-3 scenarios.
Other
35 stars 8 forks source link

NS-3 Build Failed #58

Open denture1 opened 6 months ago

denture1 commented 6 months ago

Hi,

After I installed Netsimulyzer for ns-3 3.35, I get the following error first.cc example. How do I resolve it?

root@user:~/ns-3-dev$ ./waf --run scratch/mobility-buildings-example -v
Waf: Entering directory `/home/user/ns-3-dev/build'
[2899/2966] Compiling scratch/wifi-bianchi-netsimulyzer.cc
01:37:31 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++17', '-std=c++17', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-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', '-DHAVE_SEMAPHORE_H=1', '-DHAVE_IF_TUN_H=1', '-DHAS_NETSIMULYZER=1', '-DNS3_ENABLE_EXAMPLES', '../scratch/wifi-bianchi-netsimulyzer.cc', '-c', '-o/home/user/ns-3-dev/build/scratch/wifi-bianchi-netsimulyzer.cc.8.o']
[2904/2966] Linking build/scratch/first
01:37:31 runner ['/usr/bin/g++', '-pthread', 'scratch/first.cc.10.o', '-o/home/user/ns-3-dev/build/scratch/first', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--no-as-needed', '-Llib', '-lns3.35-aodv-debug', '-lns3.35-test-debug', '-lns3.35-dsr-debug', '-lns3.35-mesh-debug', '-lns3.35-netanim-debug', '-lns3.35-wave-debug', '-lns3.35-wifi-debug', '-lns3.35-lr-wpan-debug', '-lns3.35-lte-debug', '-lns3.35-spectrum-debug', '-lns3.35-antenna-debug', '-lns3.35-applications-debug', '-lns3.35-csma-layout-debug', '-lns3.35-dsdv-debug', '-lns3.35-flow-monitor-debug', '-lns3.35-internet-apps-debug', '-lns3.35-wimax-debug', '-lns3.35-point-to-point-layout-debug', '-lns3.35-nix-vector-routing-debug', '-lns3.35-olsr-debug', '-lns3.35-sixlowpan-debug', '-lns3.35-tap-bridge-debug', '-lns3.35-internet-debug', '-lns3.35-bridge-debug', '-lns3.35-traffic-control-debug', '-lns3.35-netsimulyzer-debug', '-lns3.35-buildings-debug', '-lns3.35-propagation-debug', '-lns3.35-uan-debug', '-lns3.35-mobility-debug', '-lns3.35-energy-debug', '-lns3.35-config-store-debug', '-lns3.35-csma-debug', '-lns3.35-fd-net-device-debug', '-lns3.35-virtual-net-device-debug', '-lns3.35-point-to-point-debug', '-lns3.35-topology-read-debug', '-lns3.35-network-debug', '-lns3.35-stats-debug', '-lns3.35-core-debug', '-lrt']
[2905/2966] Linking build/scratch/subdir/subdir
01:37:32 runner ['/usr/bin/g++', '-pthread', 'scratch/subdir/scratch-simulator-subdir.cc.11.o', '-o/home/user/ns-3-dev/build/scratch/subdir/subdir', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--no-as-needed', '-Llib', '-lns3.35-aodv-debug', '-lns3.35-test-debug', '-lns3.35-dsr-debug', '-lns3.35-mesh-debug', '-lns3.35-netanim-debug', '-lns3.35-wave-debug', '-lns3.35-wifi-debug', '-lns3.35-lr-wpan-debug', '-lns3.35-lte-debug', '-lns3.35-spectrum-debug', '-lns3.35-antenna-debug', '-lns3.35-applications-debug', '-lns3.35-csma-layout-debug', '-lns3.35-dsdv-debug', '-lns3.35-flow-monitor-debug', '-lns3.35-internet-apps-debug', '-lns3.35-wimax-debug', '-lns3.35-point-to-point-layout-debug', '-lns3.35-nix-vector-routing-debug', '-lns3.35-olsr-debug', '-lns3.35-sixlowpan-debug', '-lns3.35-tap-bridge-debug', '-lns3.35-internet-debug', '-lns3.35-bridge-debug', '-lns3.35-traffic-control-debug', '-lns3.35-netsimulyzer-debug', '-lns3.35-buildings-debug', '-lns3.35-propagation-debug', '-lns3.35-uan-debug', '-lns3.35-mobility-debug', '-lns3.35-energy-debug', '-lns3.35-config-store-debug', '-lns3.35-csma-debug', '-lns3.35-fd-net-device-debug', '-lns3.35-virtual-net-device-debug', '-lns3.35-point-to-point-debug', '-lns3.35-topology-read-debug', '-lns3.35-network-debug', '-lns3.35-stats-debug', '-lns3.35-core-debug', '-lrt']
[2906/2966] Compiling scratch/fourth.cc
01:37:33 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++17', '-std=c++17', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-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', '-DHAVE_SEMAPHORE_H=1', '-DHAVE_IF_TUN_H=1', '-DHAS_NETSIMULYZER=1', '-DNS3_ENABLE_EXAMPLES', '../scratch/fourth.cc', '-c', '-o/home/user/ns-3-dev/build/scratch/fourth.cc.12.o']
[2907/2966] Compiling scratch/mobility-buildings-example.cc
01:37:34 runner ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++17', '-std=c++17', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-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', '-DHAVE_SEMAPHORE_H=1', '-DHAVE_IF_TUN_H=1', '-DHAS_NETSIMULYZER=1', '-DNS3_ENABLE_EXAMPLES', '../scratch/mobility-buildings-example.cc', '-c', '-o/home/user/ns-3-dev/build/scratch/mobility-buildings-example.cc.13.o']
In file included from ../scratch/wifi-bianchi-netsimulyzer.cc:39:
./ns3/packet-socket-client.h:108:3: error: ‘TracedCallback’ does not name a type
  108 |   TracedCallback<Ptr<const Packet>, const Address &> m_txTrace;
      |   ^~~~~~~~~~~~~~
In file included from ../scratch/wifi-bianchi-netsimulyzer.cc:41:
./ns3/packet-socket-server.h:87:3: error: ‘TracedCallback’ does not name a type
   87 |   TracedCallback<Ptr<const Packet>, const Address &> m_rxTrace;
      |   ^~~~~~~~~~~~~~
../scratch/wifi-bianchi-netsimulyzer.cc: In function ‘int main(int, char**)’:
../scratch/wifi-bianchi-netsimulyzer.cc:1617:28: error: ‘WIFI_STANDARD_80211n’ was not declared in this scope; did you mean ‘WIFI_STANDARD_H’?
 1617 |             wifiStandard = WIFI_STANDARD_80211n;
      |                            ^~~~~~~~~~~~~~~~~~~~
      |                            WIFI_STANDARD_H
../scratch/wifi-bianchi-netsimulyzer.cc:1621:28: error: ‘WIFI_STANDARD_80211n’ was not declared in this scope; did you mean ‘WIFI_STANDARD_H’?
 1621 |             wifiStandard = WIFI_STANDARD_80211n;
      |                            ^~~~~~~~~~~~~~~~~~~~
      |                            WIFI_STANDARD_H
../scratch/wifi-bianchi-netsimulyzer.cc:1638:28: error: ‘WIFI_STANDARD_80211ax’ was not declared in this scope; did you mean ‘WIFI_STANDARD_H’?
 1638 |             wifiStandard = WIFI_STANDARD_80211ax;
      |                            ^~~~~~~~~~~~~~~~~~~~~
      |                            WIFI_STANDARD_H
../scratch/wifi-bianchi-netsimulyzer.cc:1642:28: error: ‘WIFI_STANDARD_80211ax’ was not declared in this scope; did you mean ‘WIFI_STANDARD_H’?
 1642 |             wifiStandard = WIFI_STANDARD_80211ax;
      |                            ^~~~~~~~~~~~~~~~~~~~~
      |                            WIFI_STANDARD_H
../scratch/wifi-bianchi-netsimulyzer.cc:1646:28: error: ‘WIFI_STANDARD_80211ax’ was not declared in this scope; did you mean ‘WIFI_STANDARD_H’?
 1646 |             wifiStandard = WIFI_STANDARD_80211ax;
      |                            ^~~~~~~~~~~~~~~~~~~~~
      |                            WIFI_STANDARD_H

Waf: Leaving directory `/home/user/ns-3-dev/build'
Build failed
 -> task in 'wifi-bianchi-netsimulyzer' failed with exit status 1: 
    {task 124113743157328: cxx wifi-bianchi-netsimulyzer.cc -> wifi-bianchi-netsimulyzer.cc.8.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++17', '-std=c++17', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-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', '-DHAVE_SEMAPHORE_H=1', '-DHAVE_IF_TUN_H=1', '-DHAS_NETSIMULYZER=1', '-DNS3_ENABLE_EXAMPLES', '../scratch/wifi-bianchi-netsimulyzer.cc', '-c', '-o/home/user/ns-3-dev/build/scratch/wifi-bianchi-netsimulyzer.cc.8.o']

The following 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)
DPDK NetDevice                : not enabled (libdpdk not found, $RTE_SDK and/or $RTE_TARGET environment variable not set or incorrect)
Emulation FdNetDevice         : enabled
Examples                      : enabled
File descriptor NetDevice     : enabled
GNU Scientific Library (GSL)  : not enabled (GSL not found)
Gcrypt library                : not enabled (libgcrypt not found: you can use libgcrypt-config to find its location.)
GtkConfigStore                : not enabled (library 'gtk+-3 >= 3.22' 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 (OpenFlow not enabled (see option --with-openflow))
Netmap emulation FdNetDevice  : not enabled (needs net/netmap_user.h)
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              : not enabled (Python Bindings are needed but not enabled)
Python Bindings               : not enabled (PyBindGen missing)
Real Time Simulator           : enabled
SQLite stats support          : not enabled (library 'sqlite3' and/or semaphore.h not found)
Tap Bridge                    : enabled
Tap FdNetDevice               : enabled
Tests                         : enabled
Threading Primitives          : enabled
Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
XmlIo                         : not enabled (library 'libxml-2.0 >= 2.7' not found)
wing ns-3 features are supported and (not supported):

Any help is appreciated! Thanks!

bpe2 commented 6 months ago

Hey, the example that's failing there (the WiFI Bianchi one) fails because ns-3 has since changed the WiFi API.

You should be able to remove that example from the wscript file in the examples/ directory and it should build.

These lines are at the bottom of the examples/wscript file, remove them & reconfigure to take out the example that's failing to compile:

    obj = bld.create_ns3_program('wifi-bianchi-netsimulyzer',
                                 ['netsimulyzer', 'core', 'mobility', 'network', 'wifi'])
    obj.source = 'wifi-bianchi-netsimulyzer.cc'

Newer versions of the NetSimulyzer module (Version 1.0.8+) have this example removed from waf builds by default as well. You should be able to upgrade to the latest version of the module and have this solved too

bpe2 commented 6 months ago

Edit: you'll need to remove the obj.source = 'wifi-bianchi-netsimulyzer.cc as well, here's the full snip-it again:

    obj = bld.create_ns3_program('wifi-bianchi-netsimulyzer',
                                 ['netsimulyzer', 'core', 'mobility', 'network', 'wifi'])
    obj.source = 'wifi-bianchi-netsimulyzer.cc'