Getting error while building ns-3.41

162 views
Skip to first unread message

Bharat Agarwal

unread,
Jul 9, 2024, 5:36:54 AM (13 days ago) Jul 9
to ns-3-users

Screenshot from 2024-07-09 11-33-54.png

satya singh

unread,
Jul 9, 2024, 5:55:16 AM (13 days ago) Jul 9
to ns-3-users
try with sudo as it is showing permission error, it might work.

Bharat Agarwal

unread,
Jul 9, 2024, 5:57:30 AM (13 days ago) Jul 9
to ns-3-users
Exception: Refusing to run as root. --enable-sudo will request your password when needed
Traceback (most recent call last):
  File "./build.py", line 147, in <module>
    sys.exit(main(sys.argv))
  File "./build.py", line 138, in main
    build_ns3(config, build_examples, build_tests, args, build_options)
  File "./build.py", line 57, in build_ns3
    run_command(cmd) # ns3 configure ...
  File "/home/testbed/tarballs/ns-allinone-3.41/util.py", line 25, in run_command
    raise CommandError("Command %r exited with code %i" % (argv, retval))
util.CommandError: Command ['/usr/bin/python3', 'ns3', 'configure'] exited with code 1



When running with Sudo

satya singh

unread,
Jul 9, 2024, 6:13:25 AM (13 days ago) Jul 9
to ns-3-users
I think cmake cache has been created with root permissions anyhow , i don't think it requires .
you can change the ownership
sudo chown -R $(whoami) /home/testbed/tarballs/ns-allinone-3.41/ns-3.41/cmake-cache
then again build

Gabriel Ferreira

unread,
Jul 9, 2024, 6:51:36 AM (13 days ago) Jul 9
to ns-3-users
Like Satya said. Wrong permissions. Stop using sudo when you don't absolutely need it.

Bharat Agarwal

unread,
Jul 9, 2024, 7:22:16 AM (13 days ago) Jul 9
to ns-3-users
testbed@testbed-ThinkPad-P15-Gen-2i:~/tarballs/ns-allinone-3.41$ sudo chown -R $(whoami): /home/testbed/tarballs/ns-allinone-3.41/ns-3.41/cmake-cache
chown: cannot access '/home/testbed/tarballs/ns-allinone-3.41/ns-3.41/cmake-cache': No such file or directory
Message has been deleted

satya singh

unread,
Jul 9, 2024, 10:03:27 AM (13 days ago) Jul 9
to ns-3-users
So the path is not correct ,i thought you are working  with home as working dir., Simply  you  go to ns-3.41 , and then run :   sudo chown -R $(whoami) cmake-cache

satya singh

unread,
Jul 9, 2024, 10:05:05 AM (13 days ago) Jul 9
to ns-3-users
 also please check whether this cmake-cache dir exist or not?

Devanshu Anand

unread,
Jul 9, 2024, 10:56:35 PM (12 days ago) Jul 9
to ns-3-...@googlegroups.com
Try sudo su -...you should enter root and then try to build!

Séanadh Ríomhphoist/

Email Disclaimer

Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus sin amháin é. Is féidir tuilleadh a léamh anseo. 

This e-mail and any files transmitted with it are confidential and are intended solely for use by the addressee. Read more here. 

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/4da4406f-b6e4-4472-8861-2e0fa05561d7n%40googlegroups.com.


--
Thanks & Regards,
Devanshu Anand

Doctoral Researcher,
Dublin City University | School of Electronic Engineering
Glasnevin, Dublin 9
Ireland


Séanadh Ríomhphoist/

Email Disclaimer

Tá an ríomhphost seo agus aon chomhad a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus sin amháin é. Is féidir tuilleadh a léamh anseo. 

This e-mail and any files transmitted with it are confidential and are intended solely for use by the addressee. Read more here. 

Message has been deleted

Bharat Agarwal

unread,
Jul 10, 2024, 4:02:03 AM (12 days ago) Jul 10
to ns-3-users
There is no cmake cache directory

Gabriel Ferreira

unread,
Jul 10, 2024, 6:36:29 AM (12 days ago) Jul 10
to ns-3-users
Again, DO NOT USE SUDO. NEVER RUN ANYTHING AS ROOT, UNLESS YOU ARE INSIDE A CONTAINER OR KNOW WHAT YOU ARE DOING.

I made the ns3 script to refuse to run as sudo exactly to prevent this kind of issue. STOP RUNNING AS ROOT.

Your figure shows what? That bake, netanim, ns-3.41 directories are owned by root instead of your "testbed" users.
You need to take ownerships back, and for that you will need sudo…
sudo chown -R testbed:testbed ./

Doesn't work? Delete this ns-allinone directory and untar it again without using sudo.
Capture.PNG

Bharat Agarwal

unread,
Jul 11, 2024, 11:23:29 AM (11 days ago) Jul 11
to ns-3-users
root@testbed-ThinkPad-P15-Gen-2i:/home/testbed/tarballs/ns-allinone-3.41# ./build.py
# Build NetAnim
Entering directory `netanim-3.109'
 =>  qmake -v
QMake version 3.1
Using Qt version 5.12.8 in /usr/lib/x86_64-linux-gnu
qmake found
 =>  qmake NetAnim.pro
 =>  make
make: Nothing to be done for 'first'.
Leaving directory `netanim-3.109'
# Build NS-3
Entering directory `./ns-3.41'
 =>  /usr/bin/python3 ns3 configure

Traceback (most recent call last):
  File "ns3", line 1914, in <module>
    main()
  File "ns3", line 1685, in main
    refuse_run_as_root()
  File "ns3", line 1676, in refuse_run_as_root
    raise Exception(

Exception: Refusing to run as root. --enable-sudo will request your password when needed
Traceback (most recent call last):
  File "./build.py", line 147, in <module>
    sys.exit(main(sys.argv))
  File "./build.py", line 138, in main
    build_ns3(config, build_examples, build_tests, args, build_options)
  File "./build.py", line 57, in build_ns3
    run_command(cmd) # ns3 configure ...
  File "/home/testbed/tarballs/ns-allinone-3.41/util.py", line 25, in run_command
    raise CommandError("Command %r exited with code %i" % (argv, retval))
util.CommandError: Command ['/usr/bin/python3', 'ns3', 'configure'] exited with code 1
root@testbed-ThinkPad-P15-Gen-2i:/home/testbed/tarballs/ns-allinone-3.41#

Even with root I am getting error

Gabriel Ferreira

unread,
Jul 11, 2024, 11:25:44 AM (11 days ago) Jul 11
to ns-3-users

Yes, you are getting an error because you don't know what you are doing and insists on running as root.
STOP RUNNING AS ROOT, and take ownership of your files as instructed.

Bharat Agarwal

unread,
Jul 11, 2024, 2:13:10 PM (11 days ago) Jul 11
to ns-3-...@googlegroups.com
I know what I am a doing and thanks for your reply and please be kind when you reply no one is forcing you to reply. 

I have already solved the problem.



Best Regards,

Dr.Bharat Agarwal 
Ph.D., B.Eng 
Dublin City University | School of Electronic Engineering
Glasnevin, Dublin 9 
Republic of Ireland 



Gabriel Ferreira

unread,
Jul 11, 2024, 2:27:39 PM (11 days ago) Jul 11
to ns-3-users
You clearly don't know... And it is fine, nobody needs to know everything.
However two people gave you the right answer.
The error message in the ns3 script told you to stop using sudo.
Guess who wrote it? I did.
And then I told you to stop using sudo.
And you insisted.

Asking for help and refusing it when you get it is very weird.
Start paying more attention to what people said when you ask.
And lesson learned, from today onwards, you won't get a single response from me if you have any problems. :)

Bharat Agarwal

unread,
Jul 11, 2024, 2:30:37 PM (11 days ago) Jul 11
to ns-3-...@googlegroups.com
Get some work brother !!! 
Seems like you are very empty !!! 

Thanks for choosing not replying to my questions I am very grateful to u !!! 


Best Regards,

Dr.Bharat Agarwal 
Ph.D., B.Eng 
Dublin City University | School of Electronic Engineering
Glasnevin, Dublin 9 
Republic of Ireland 


Tommaso Pecorella

unread,
Jul 12, 2024, 9:23:35 AM (10 days ago) Jul 12
to ns-3-users

@Bharat.

Gabriel was trying to help, and you refused to follow his advices - without explaining why you are stubbornly not following them.

You're lucky that I did learn to count to 10 (twice) before taking actions.
I expect a public apology for the reply you gave to Gabriel.

Also, remember that the posts you make are public, and you never know what your direct supervisor would do if he/she would read this thread.

Amir ashtari gargari

unread,
Jul 12, 2024, 9:59:12 AM (10 days ago) Jul 12
to ns-3-users
Totally agree @Tommaso

Tom Henderson

unread,
Jul 12, 2024, 10:34:15 AM (10 days ago) Jul 12
to ns-3-...@googlegroups.com
As a list moderator, I would like to close this thread.  We have
guidelines for posting on ns-3-users; please read through them
especially if you are new to this list.

https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting

Reply all
Reply to author
Forward
0 new messages