[Rd] C or Java code generation

Dirk Eddelbuettel edd at debian.org
Thu Aug 19 18:02:28 CEST 2010


On 19 August 2010 at 17:06, Vyacheslav Karamov wrote:
| Dirk Eddelbuettel пишет:
| > On 19 August 2010 at 13:02, Daniel Cegiełka wrote:
| > | Is there any posibility to use R without installing?
| > | 
| > | > I mean that I have my own application written in MS Visual C++ and I need
| > | > to use R script in this app. I can install R and use it via DCOM, but it's
| > | > not convenient for  the end users of my  program.
| > | >
| > | >
| > | Dirk Eddelbuettel love R/C++ combination. Rinside could be usefull for you.
| > | 
| > | http://dirk.eddelbuettel.com/code.html
| >
| > Thanks for the plug. We can definitely embed R inside C++ on operating
| > systems containing an x somewhere in their name. But note that the RInside
| > page (http://dirk.eddelbuettel.com/code/rinside.html) clearly states the
| > following:
| >
| >    Status                                                                                      
| >                                                                                                                  
| >    Version 0.2.3 should build and install on just about any Linux and OS X
| >    system, and even on Windows machines that have the Rtools compiled by
| >    Duncan Murdoch as detailed in the The Windows Toolset appendix to the R
| >    Installation manual. Do not report an error if you fail to build this with
| >    another compiler as this is not supported. (However, the examples which
| >    built and run under 0.2.1 currently build but segfault. This is probably
| >    fixable but we just haven't had the time or focus to do it. Linux and OS X
| >    work well enough for us.)
| >
| > so for someone hell-bent on using MS Visual Whatever this is not a solution.
| >
| > Dirk
| >
| >   
| I tried to compile it using MinGW:

No, what you describe in the next few hundred lines would _build the examples
if the package is already installed_ 

Also, building these examples (once you have the package is installed) does
"Work For Me (TM)" in the sense that the compiles and linking steps succeed
(WinXP, Rtools with gcc/g++ 4.2.x, R 2.11.0) yet it, as noted above, leads to
a seg.fault which Romain and I have found neither time nor motivation to fix.

You would be very welcome to help out -- our discussions around Rcpp and
RInside take place on the rcpp-devel list off R-Forge.


| 1) First I added R_HOME environment variable.
| 2) Then modified c:\Program 
| Files\R\R-2.11.1\library\RInside\examples\standard\Makefile.win by 
| surrounding "$(R_HOME)/bin/R" with the quotation marks.
| 3) And finally
| C:\Program Files\R\R-2.11.1\library\RInside\examples\standard>make -f 
| Makefile.win
| g++ -Ic:/PROGRA~1/R/R-211~1.1/include 
| -Ic:/PROGRA~1/R/R-211~1.1/library/Rcpp/include 
| -I"c:/PROGRA~1/R/R-211~1.1/library/RInside/include" -O2 -Wall -Wall  -s  
| rinside_callbacks0.cpp  -Lc:/PROGRA~1/R/R-211~1.1/bin -lR 
| -Lc:/PROGRA~1/R/R-211~1.1/bin -lRblas -Lc:/PROGRA~1/R/R-211~1.1/bin 
| -lRlapack "c:/PROGRA~1/R/R-211~1.1/library/RInside/lib/libRInside.a" 
| c:/PROGRA~1/R/R-211~1.1/library/Rcpp/lib/libRcpp.a  -o rinside_callbacks0
| c:/PROGRA~1/R/R-211~1.1/library/RInside/lib/libRInside.a(RInside.o):RInside.cpp:(.text+0x10b): 
| undefined reference to `__gxx_personality_sj0'

[ Hundreds of similar lines removed. ]


Thanks, Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



More information about the R-devel mailing list