[ndnSIM] Call engine.h in ndnSIM

Alex Afanasyev alexander.afanasyev at ucla.edu
Thu Nov 14 12:14:18 PST 2013


Hi Amin,

Python scripts (wscript) are very sensitive to indentation. You should correct the things you have typed to match indentation of the existing code.

---
Alex

On Nov 14, 2013, at 12:12 PM, Amin Karami <amin at ac.upc.edu> wrote:

> Hi Alex,
> Thank you for your guidance. I ran your suggested commands but i faced with errors:
> 
> Traceback (most recent call last):
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Scripting.py", line 97, in waf_entry_point
> run_commands()
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Scripting.py", line 149, in run_commands
> parse_options()
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Scripting.py", line 127, in parse_options
> Context.create_context('options').execute()
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Options.py", line 134, in execute
> super(OptionsContext,self).execute()
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Context.py", line 87, in execute
> self.recurse([os.path.dirname(g_module.root_path)])
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Context.py", line 128, in recurse
> user_function(self)
> File "/home/bluebit/Documents/ndnSIM/ns-3/wscript", line 209, in options
> opt.recurse('src')
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Context.py", line 128, in recurse
> user_function(self)
> File "/home/bluebit/Documents/ndnSIM/ns-3/src/wscript", line 47, in options
> opt.recurse(module, mandatory=False)
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Context.py", line 122, in recurse
> wscript_module=load_module(node.abspath())
> File "/home/bluebit/Documents/ndnSIM/ns-3/.waf-1.7.11-2f760793a9090bf35f69082a250595d9/waflib/Context.py", line 281, in load_module
> exec(compile(code,path,'exec'),module.__dict__)
> File "/home/bluebit/Documents/ndnSIM/ns-3/src/ndnSIM/wscript", line 42
> conf.env['ENABLE_NDNSIM']=False;
> ^
> IndentationError: unindent does not match any outer indentation level
> 
> 
> 
> On 11/14/2013 05:07 ب.ظ, Alex Afanasyev wrote:
>> Hi Amin,
>> 
>> The problem is that you need to specify that your program needs to be compiled with MATLAB dependency (with proper CXXFLAGS and LINKFLAGS).  I'm not quite confident how to do it with scratch/ folder, but if you have created a separate scenario repository or configured your scenario in src/ndnSIM/examples/wscript (and put it under src/ndnSIM/examples), then you may do the following:
>> 
>> 1. Edit src/ndnSIM/wscript
>> 
>> somewhere (in the beginning) of `def configure(conf):`
>> 
>> conf.env['INCLUDES_MATLAB'] = '<path-to-matlab-folder-where-engine.h-exists>'
>> conf.env['LIB_MATLAB'] = ['<matlab-library>']
>> conf.env['LIBPATH_MATLAB'] = '<path-to-matlab-library>'
>> 
>> 
>> I'm not sure, but according some Internet posts, the second line should be something like:
>> 
>> conf.env['LIB_MATLAB'] = ['eng', 'mat', 'mx']
>> 
>> and third should be location of libeng.dylib/libeng.so, libmat.dylb/libmat.so, libmx.dylib/libmx.so libraries within MATLAB
>> 
>> 
>> 2. Edit src/ndnSIM/examples/wscript
>> 
>> Edit/create definition for your program to look like this
>> 
>>     obj = bld.create_ns3_program('your-app', all_modules)
>>     obj.source = 'your-app.cc'
>>     obj.use += ['MATLAB']
>> 
>> ---
>> Alex
>> 
>> 
>> On Nov 13, 2013, at 3:47 PM, Amin Karami <amin at ac.upc.edu> wrote:
>> 
>>> Hi,
>>> I want to call MATLAB engine into the my scenario in ndnSIM by #include "engine.h"
>>> But, i received this error:
>>> ../scratch/simple.cc:5:20: fatal error: engine.h: No such file or directory
>>> compilation terminated.
>>> 
>>> Also, i included the complete route of the engine.h, but i faced with the same error as follows. Again, i copied the engine.h next to the simple.cc file. but i faced with the same error.
>>> 
>>> How is it possible to call this engine?
>>> 
>>> 
>>> Best Regards,
>>> Amin





More information about the ndnSIM mailing list