Compilation error in ns-3 dev

178 views
Skip to first unread message

Mahesh

unread,
May 29, 2018, 7:35:09 AM5/29/18
to ns-3-users
Hi,

When I run my programs, I am getting the following compilation error:

Waf: Entering directory `/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/build'
Waf: Leaving directory `
/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/build'
Build commands will be stored in build/compile_commands.json
Traceback (most recent call last):
  File "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Scripting.py", line 110, in waf_entry_point
    run_commands()
  File "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Scripting.py", line 171, in run_commands
    ctx=run_command(cmd_name)
  File "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Scripting.py", line 162, in run_command
    ctx.execute()
  File "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Scripting.py", line 383, in execute
    return execute_method(self)
  File "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Build.py", line 107, in execute
    self.execute_build()
  File "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Build.py", line 121, in execute_build
    self.post_build()
  File "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Build.py", line 276, in post_build
    m(self)
  File "waf-tools/clang_compilation_database.py", line 45, in write_compilation_database
    root = json.load(database_file)
  File "/usr/lib/python2.7/json/__init__.py", line 291, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Unterminated string starting at: line 7200 column 13 (char 1105899)

Everything was working fine until I updated my Ubuntu through Software Updater. What is causing this issue? Is the hidden directory ".waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d" in ns-3-dev supposed to exist? Please help me resolve this issue.

Thanks,
Mahesh

Mahesh

unread,
May 29, 2018, 12:06:36 PM5/29/18
to ns-3-users
Hello all,

I got the source of the error. In the "compile_commands.json" file, I am getting the following lines which lead to the error in the above message:

{
   
"directory": "/home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/build",
   
"command": "/usr/bin/g++ -O0 -ggdb -g3 -Wall -Werror -std=c++11 -Wno-error=deprecated-declarations -fstrict-aliasing -Wstrict-aliasing -fPIC -pthread -I. -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_IF_TUN_H=1 ../src/wifi/model/aparf-wifi-manager.cc -c -o /home/mahesh/ns3-dev/ns-3-allinone/ns-3-dev/build/src/wifi/model/aparf-wifi-manager.cc.1.o",
   
"file": "../src/wifi/model/ap

The build is terminating abruptly. What could be the reason? Please help.

Thanks,
Mahesh

Mahesh

unread,
May 29, 2018, 12:36:08 PM5/29/18
to ns-3-users
PROBLEM SOLVED: Deleting "compile_commands.json" file and recompiling the program did the trick. The issue occurred due to an Ubuntu update related to Python/JSON disrupting the ns-3 compilation in between for whatever reason.

S

unread,
Dec 28, 2018, 4:40:52 PM12/28/18
to ns-3-users
i have this problem too

do i delete file of compile_commands.json in build folder?
after  what do i do ?

please help me
Reply all
Reply to author
Forward
0 new messages