[ndnSIM] Call engine.h in ndnSIM

Alex Afanasyev alexander.afanasyev at ucla.edu
Thu Nov 14 08:07:03 PST 2013


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