[Rcpp-devel] RCOM
John Buonagurio
jbuonagurio at exponent.com
Tue Jun 18 19:45:42 CEST 2013
On 18 June 2013 at 11:08, David Silkworth wrote:
> In reply to initial issue by Umesh Chitre regarding roll of RCOM.
>
> I use RCOM to connect my R gui to Excel on Windows for development
> purposes (I know this makes Dirk laugh). Trying to compile C++ using
> other than gcc would not work, so there would be no point in attempting
> to code in MSVC++ for instance and expect Rcpp to work. If you wanted to
> bring R into a C++ environment, you would explore Rinside, still
> compiling only with gcc. But as Darren suggests if you are comfortable
> with C++ language and R interface the way to go is to build Rcpp
> functions that R acts on with high performance. Then I suppose yes you
> could call on R to communicate with a separate MSVC++ program using
> RCOM, but the two separate processes can only exchange data.
>
You can use Rcpp with MSVC but in a very limited way by exporting
symbols to a .def file, and you have to use regular C types via extern
"C" calls. If you just need to pass integral types and simple arrays and
require Rembedded for performance reasons, this may work for you.
I found this SVN repo a while back which calls into starts Rembedded via
RInside indirectly from a MSVC compiled DLL, and includes some simple
Rcpp functions - I think just Rcpp::List::create(...):
http://apsrunet.apsim.info/svn/apsim/trunk/Model/RLink/
Hopefully someday MSVC will be supported for building R...
>
> Also, as I understand it RCOM is still limited to 32-bits on Windows.
> So, even if you accomplished the inter process communication suggested,
> presently you are limited to 32-bit Windows and 32-bit R, and I am
> unsure of R-3.0 interface. There is an RCOM .net in works, but I am not
> sure of schedule.
>
I would personally stay away from RCOM and anything else which requires
statconnDCOM due to restrictive licensing and closed source. I think it
even displays a splash screen advertisement each time you call its
"init" function.
As Dirk mentioned, if you can send your R objects over TCP without a
significant performance penalty, Rserve is the way to go. Also see the
"RServeCLI" and "RServeCLI2" projects for .NET interop.
If you are using .NET and need to directly call into R.dll - still using
Cdecl calls (via P/Invoke) and R SEXPs, no C++ classes - I think that
R.NET is still the best way to go, but I am not sure how active
development is: http://rdotnet.codeplex.com/
Best,
John
More information about the Rcpp-devel
mailing list