Reputation: 1798
3 and hope this question is not too stupid... I'm recently using ns-3 and try to compile the codes. I found that I don't need to explicitly specify compilation, instead, using
./waf --run someCode.cc
will first compile and code and then execute it. My question is, I'm trying to compile/run the code in a deeper folder. To be precise, I want to execute one example code located in
<ns-3.22>/src/lte/example/lena-simple-epc.cc
but when I enter
./waf --run src/lte/example/lena-simple-epc
I just got the following message:
Waf: Entering directory `..../ns-allinone-3.22/ns-3.22/build'
program 'src/lte/examples/lena-simple-epc' not found; available programs are: [...]
But, if I copy the file src/lte/examples/lena-simple-epc.cc
under the folder scratch
and execute ./waf --run scratch/lena-simple-epc
, then it works perfectly. Is this expected or did I miss any step? (Forgot to export some environment variables or something?)
Upvotes: 0
Views: 2957
Reputation: 788
You don't need to specify all the path!
Just run:
./waf --run lena-simple-epc
If you are not secure on how to start a script just look at the wscript file in the examples folder and look for these rows.
obj = bld.create_ns3_program('lena-simple-epc',
['lte'])
obj.source = 'lena-simple-epc.cc'
With lena-simple-epc you can start the script.
Upvotes: 2