problem with running scripts out of scratch folder

1,602 views
Skip to first unread message

nasrin

unread,
Oct 24, 2017, 11:23:06 AM10/24/17
to ns-3-users
hi all
when i try to run a script in ns3 , the process  faces error that expresses just the scripts in scratch folder are availble to run and others not found.therefore i just can run the scripts that are in scratch folder.  i didnt have this problem before adding a module (nanosim module) and after adding it , the mentioned problem is happening .
Any help will be appreciated.
regards.

Konstantinos

unread,
Oct 24, 2017, 4:56:13 PM10/24/17
to ns-3-users
Hi,

Please describe the problem a bit more clearly. It is not understood what the issue is.
Even in the past, only scripts in scratch would be run (and examples, test unless configured so).
Furtherm when adding a new module to ns-3, you should follow the guidelines defined in the manual https://www.nsnam.org/docs/manual/html/new-modules.html
especially when you get source code from unsupported module (check that the wscript files are according to the release you use).
After adding a new module, you need to re-configure your ns-3 (step 8 in the manual).

Regards
K

nasrin

unread,
Oct 25, 2017, 12:05:47 PM10/25/17
to ns-3-users

hi konstantinos. thanks for replying.

 

actually nanosim is a pre-prepared module and i followed its author orders to add it.

before adding this module i was able to run my scripts in any directory like examples/tururials  or  src folder etc...by determining their addresses in terminal.

but now i just can run scripts that are in scratch folder , not even in a subfolder of scratch .

for example now i cant run the hello-simulator script . because its not in scratch folder. here is the error :

 

nasrin@ubuntu:~/ns-allinone-3.19/ns-3.19$ ./waf --run hello-simulator

Waf: Entering directory `/home/nasrin/ns-allinone-3.19/ns-3.19/build'

wscript:60: Warning: (in nanonetworks) Requested to build modular python bindings, but apidefs dir not found => skipped the bindings.

  wutils.VNUM = None

program 'hello-simulator' not found; available programs are: ['myfirst', 'scratch/myfirst', 'subdir', 'scratch/subdir/subdir', 'scratch-simulator', 'scratch/scratch-simulator', 'examples', 'scratch/examples/examples', 'test-runner', 'utils/test-runner', 'bench-simulator', 'utils/bench-simulator', 'bench-packets', 'utils/bench-packets', 'print-introspected-doxygen', 'utils/print-introspected-doxygen', 'emu-sock-creator', 'src/emu/emu-sock-creator', 'tap-device-creator', 'src/fd-net-device/tap-device-creator', 'raw-sock-creator', 'src/fd-net-device/raw-sock-creator', 'tap-creator', 'src/tap-bridge/tap-creator']

Konstantinos

unread,
Oct 26, 2017, 8:49:35 AM10/26/17
to ns-3-users
First of all, you work on ns-3.19 which is 8 releases old.
We recently released ns-3.27!! I do not know if nanosim has a limitation on which release it supports.

The error you get is clear that in order to build nanosim, python bindings are required, which have certain requirements to be installed (https://www.nsnam.org/wiki/Python_bindings).

How did you configure ns-3? Have you enabled test and examples? 

Regards
K

nasrin

unread,
Oct 26, 2017, 12:03:40 PM10/26/17
to ns-3-users
yup ns3.19 is too old but i have to use it, because it supports nanosim and newer versions dont !
and yes i enabaled examples and tests ...i  installed dependencies (from nanam) at first ,and after that :
./waf configure --enable examples --enable-tests 
./waf
and those finished successfully.
in the next step in order to adding nanosim i tried to run those comments again but the./waf part made an error
:AttributeError: 'BuildContext' object has no attribute 'add_subdirs'
 so i just ran :
./waf configure 
./waf
it finished successfully too.
and now i have that problem i mentioned before... cant run scripts out of scratch folder ...and python bindindg warning.
after those steps i thought i installd anything including python binding..did i?  did i configure ns3 in a right way?and do i still need to install python binding ?
im new with ns3 :)
thanks again, best regards.

Konstantinos

unread,
Oct 27, 2017, 5:25:58 AM10/27/17
to ns-3-users
Comments inline.


On Thursday, 26 October 2017 17:03:40 UTC+1, nasrin wrote:
yup ns3.19 is too old but i have to use it, because it supports nanosim and newer versions dont !
and yes i enabaled examples and tests ...i  installed dependencies (from nanam) at first ,and after that :
./waf configure --enable examples --enable-tests 
./waf
and those finished successfully.
in the next step in order to adding nanosim i tried to run those comments again but the./waf part made an error
:AttributeError: 'BuildContext' object has no attribute 'add_subdirs'

That means the system is not configured correctly. Probably there is an issue with the WSCRIPT file of the module you inserted. 
That's why I recommended to follow the manual. Simply create the WSCRIPT file with the correct format from the automatic ns-3 tool (create-new-module.py) and populate it with the information from the one for nanosim
 
 so i just ran :
./waf configure 
./waf
it finished successfully too.
and now i have that problem i mentioned before... cant run scripts out of scratch folder ...and python bindindg warning.

In the default configure examples and tests are NOT enabled, hence you can not run anything else apart from the scratch.
Same applies for the python bindings. 
 
after those steps i thought i installd anything including python binding..did i?  did i configure ns3 in a right way?and do i still need to install python binding ?
im new with ns3 :)

Since nanosim is NOT a supported module by the ns-3 team, you should contact the developer/maintainer to get help on how to integrate it.
All we can say, is use the latest ns-3 release and follow the manual to integrate code.
 
thanks again, best regards.

nasrin

unread,
Oct 28, 2017, 3:47:35 AM10/28/17
to ns-3-users
thanks for your tips dear konstantinos. :)
i will work on nanosims wscript.
regards.

jeje omar

unread,
Nov 9, 2017, 7:46:52 AM11/9/17
to ns-3-users
dear,
hi
i am facing the same problem if you solve it please respond..
Reply all
Reply to author
Forward
0 new messages