installation issue, help please

253 views
Skip to first unread message

David Peng

unread,
Jun 20, 2023, 8:09:35 AM6/20/23
to ns-3-users
Hi, all,

I am a newbie on ns3 and strictly follow the installation guide in tutorial:

./ns3 clean
./ns3 configure --enable-sudo --enable-examples --enable-tests
./ns3 build

Everything seems good. Then if I install with

./ns3 install

it reports error:

% ./ns3 install

Install the project...

-- Install configuration: "default"

CMake Error at cmake_install.cmake:41 (file):

  file cannot create directory: /usr/local/lib/pkgconfig.  Maybe need

  administrative privileges.



make: *** [install] Error 1

Finished executing the following commands:

cd cmake-cache; /opt/homebrew/bin/cmake --build . -j 7 --target install ; cd ..


If I run sudo:

% sudo ./ns3 install

Password:

Traceback (most recent call last):

  File "./ns3", line 1629, in <module>

    main()

  File "./ns3", line 1402, in main

    refuse_run_as_root()

  File "./ns3", line 1395, in refuse_run_as_root

    raise Exception("Refusing to run as root. --enable-sudo will request your password when needed")

Exception: Refusing to run as root. --enable-sudo will request your password when needed


Please help.

Thanks,
David

raghavi tupakula

unread,
Jun 20, 2023, 8:24:46 AM6/20/23
to ns-3-...@googlegroups.com
Heyy hi,

Follow this,
There will be a installation pdf ,it may helps to 



--
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/4b534bd2-28c0-4ac0-be31-c1045d011bc1n%40googlegroups.com.

Tom Henderson

unread,
Jun 20, 2023, 12:47:51 PM6/20/23
to ns-3-...@googlegroups.com, David Peng
This is a surprising bug (surprising to me that we haven't noticed it
yet), but perhaps there are very few people who try to install to system
directories.

I opened a bug report to fix this:
https://gitlab.com/nsnam/ns-3-dev/-/issues/923

To work around this issue in the meantime, you can make a small change
to the 'ns3' script. Around line 1410, you will notice the following
command:

# Refuse to run with sudo
refuse_run_as_root()

If you comment out this statement, you should be able to run:

sudo ./ns3 install

and it will install to the configured location (which is /usr/local/ by
default, or can be changed at configure time with the --prefix option).

- Tom

David Peng

unread,
Jun 20, 2023, 9:32:55 PM6/20/23
to ns-3-users
Yes, that works.

Thanks,

David

Reply all
Reply to author
Forward
0 new messages