I was learning R and came through this package called RInside which provides c++ classes to call an embedded R interpreter. I am able to run some examples given after configuring as per this blogpost and using provided makefile in Omnet++ eclipse IDE. How can we integrate this with say veins (veins already have auto generated makefiles in top directory and src directory)? Rinside needs GCC toolchain which i think is default in OMNeT++.
From what I've learned so far, these are the options:
Has anyone tried to use it with omnet++/veins based project so far? does anyone know if it is worth trying? Any other suggestions are welcome.
I'm using Ubuntu 16.04 LTS 64 bit.
Do you really want to use R inside of OMNeT++, or are you looking to do result/data analysis?
Could you provide a bit of information about what you're trying to do/why you're trying to use R inside OMNeT++ instead of doing a post-processing step after your simulations are completed? Generally speaking, I'd recommend doing your post-processing separate from your simulations, generating relevant data in the results using the statistics collection libs in OMNeT++, and process these with R. You can find some examples that are used with Plexe, a VEINS-based simulator for CACC applications, in this repository. I personally prefer to use python for the post-processing, but if you're already familiar with R, then I'd recommend having a look at that.
If you really want to do this, I'd recommend the second approach in your question, i.e., simply dynamically linking to the RInside libraries as system libraries and specify them as a dependency. This is basically the easiest way to get things to work.
However, if for some reason you want to link against the library explicitly, you should be aware that VEINS' build process relies on the configure script included in the distribution. The way it works differently from normal C++ programs is that OMNeT++ simulations should be built using the OMNeT++-provided opp_makemake
tool: this is exactly what VEINS' configure script does. If you want to include additional library paths into the build process, the easiest way is to create a makefile using ./configure --include PATH/TO/RINSIDE/HEADERS
. Refer to the script source code for more details