Problem with compiling RInside examples under Windows

坚强是说给别人听的谎言 提交于 2019-11-27 15:12:25

I have a similar setup at work, so I gave this a shot. I'm able to build the examples after I specify R_LIBS_SITE. Note that it must be a Windows path, not a Cygwin path!

export R_LIBS_SITE=c:/R/site-library

You seem to have two distinct problems here:

  1. Your $PATH is probably off, or as Josh had hinted, your $R_HOME assignment is wrong. If make is indeed the binary from Rtools, and the paths you assign are correct, then the builds succeed. That is the general rule for building R packages on Windows: Follow the manual very diligently and it will work.

  2. RInside is broken on Windows, sorry. It will build, and you will get segfaults. Romain and I clearly state so in the documentation.

As Romain and I work almost exclusively on OS X and Linux, respectively, we would appreciate debugging help. It should be doable, but it probably requires some serious willingness to learn about R internals as something in the memory subsystem goes belly-up. Which it clearly does not on OSs with an X in their name.

Updated on 08 Dec 2011: RInside 0.2.5, on CRAN as of today, restores the Windows functionality--using the fix James notes in the other comment.

James Bates

I spent a little time today looking at the bug with the windows version of RInside. I believe that I have discovered the bug which is as follows:

In RInside::initialize(……) the structRStart structure is populated however this now requires extra fields to be populated in the case of windows as shown in Rf_initEmbeddedR() from R\src\gnuwin32\embedded.c.

Rp->rhome = RHome;
Rp->home = getRUser();
Rp->CharacterMode = LinkDLL;
Rp->ReadConsole = myReadConsole;
Rp->WriteConsole = myWriteConsole;
Rp->CallBack = myCallBack;
Rp->ShowMessage = askok;
Rp->YesNoCancel = askyesnocancel;
Rp->Busy = myBusy;

Equivalent assignments will be necessary in RInside.cpp in order to provide valid callbacks.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!