Ali.Nemat
Ali.Nemat

Reputation: 49

Error installing NS-3 on Ubuntu

I'm trying to install NS-3 on Ubuntu. I have already updated and installed all the required packages, but when I want to do build.py this error occurs:

cc1plus: all warnings being treated as errors
Waf: Leaving directory `/home/ali/Desktop/ns-allinone-3.21/ns-3.21/build'
Build failed
-> task in 'ns3-wave' failed (exit status 1): 
{task 140530495514448: cxx wifi-80211p-helper.cc -> wifi-80211p-
helper.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-
error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-
fPIC', '-pthread', '-I.', '-I..', '-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_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', 
'../src/wave/helper/wifi-80211p-helper.cc', '-c', '-o', 
'src/wave/helper/wifi-80211p-helper.cc.1.o']
Traceback (most recent call last):
File "./build.py", line 170, in <module>
sys.exit(main(sys.argv))
File "./build.py", line 161, in main
build_ns3(config, build_examples, build_tests, args, build_options)
File "./build.py", line 81, in build_ns3
run_command([sys.executable, "waf", "build"] + build_options)
File "/home/ali/Desktop/ns-allinone-3.21/util.py", line 24, in run_command
raise CommandError("Command %r exited with code %i" % (argv, retval))
util.CommandError: Command ['/usr/bin/python', 'waf', 'build'] exited with 
code 1

What should I do? Please help me, it`s vital for me.

Upvotes: 1

Views: 3589

Answers (3)

VIJAY KUMAR
VIJAY KUMAR

Reputation: 11

The solution from the below link was very much helpful for me.

Link to Solution

Execute the below commands one by one.

  1. First
sudo apt install python3-dev qt5-default libsqlite3-dev 
  libdpdk-dev \libgsl-dev libssh-gcrypt-dev libgtk-3-dev 
  libboost-all-dev \python3-pygraphviz libxml2-dev python3- 
  pip
  1. sudo pip3 install pygccxml==2.1.0

  2. wget https://www.nsnam.org/release/ns-allinone-3.33.tar.bz2

  3. tar xvf ns-allinone-3.33.tar.bz2

  4. cd ns-allinone-3.33/

  5. ./build.py

  6. cd ns-3.33/

  7. ./waf configure --enable-examples

  8. ./waf

Upvotes: 1

wayo
wayo

Reputation: 29

Build the system in the directory of 'ns-allinone-3.21'. Not in 'ns-3.21'. Deeplearnning/ns-allinone-3.2$ ./build Use the manual. https://www.nsnam.org/doxygen/

Upvotes: 0

Konstantinos
Konstantinos

Reputation: 556

What system are you building? Try with the latest ns-3.27 release and make sure your system is compliant with the requirements (eg. gcc/g++ version)

Upvotes: 0

Related Questions