Hello,
Thank you for your response.
Before I explain - I'm trying to execute this on NS3 3.41.
Here's what I tried to do. I executed the following commands:
./ns3 clean
./ns3 configure --enable-examples --enable-tests --enable-python-bindings
./ns3 build
./test.py (When I execute this, it actually fails a couple of tests, but those tests aren't within the scope of what I want to execute in NS3 for now, so I usually ignore it)
./ns3 shell
And then, what I tried to do was write the following Python simulation program (this is saved in examples/lorawan/simple-network-simulator.py):
try:
from ns import ns
except ModuleNotFoundError:
raise SystemExit(
"Error: ns3 Python module not found;"
" Python bindings may not be enabled"
" or your PYTHONPATH might not be properly configured"
)
lora_helper = ns.LoraHelper()
ns.Simulator.Stop(ns.Seconds(10))
ns.Simulator.Start()
ns.Simulator.Destroy()
When I try to execute this in the command line using:
$ ./ns3 run examples/lorawan/simple-network-simulator.py
It gives me the following error:
[0/2] Re-checking globbed directories...
ninja: no work to do.
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { _ZN3ns3L16g_TimeStaticInitE, $.cling-module-140.__inits.0, __orc_init_func.cling-module-140, __cxx_global_var_initcling_module_140_, _GLOBAL__sub_I_cling_module_140 }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { __orc_init_func.cling-module-140 }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { $.cling-module-170.__inits.0, __cxx_global_var_initcling_module_170_, _ZN3ns3L27UE_MEASUREMENT_REPORT_DELAYE, __orc_init_func.cling-module-170, _ZGVN3ns3L27UE_MEASUREMENT_REPORT_DELAYE, _ZN3ns34TimeD1Ev, _ZGVZN3ns34Time14PeekResolutionEvE10resolution, _ZZN3ns34Time14PeekResolutionEvE10resolution }) }
[runStaticInitializersOnce]: Failed to materialize symbols: { (main, { __orc_init_func.cling-module-170 }) }
Traceback (most recent call last):
File "/home/user/Downloads/ns-3-dev-for-lorawan/ns-3-dev/examples/lorawan/simple-network-simulator.py", line 10, in <module>
lora_helper = ns.LoraHelper()
AttributeError: <namespace cppyy.gbl.ns3 at 0x5c1893c17560> has no attribute 'LoraHelper'. Full details:
type object 'ns3' has no attribute 'LoraHelper'
'ns3::LoraHelper' is not a known C++ class
'LoraHelper' is not a known C++ template
'LoraHelper' is not a known C++ enum
Command 'python3 examples/lorawan/simple-network-simulator.py' returned non-zero exit status 1.
I'm not sure if I've configured something wrong, or if I have to configure anything extra to make this work.
Do let me know of the same. I'll try to port the wscript files using the guides you've given. Thanks again!