Displaying 20 results from an estimated 28 matches for "rf_initialize_r".
2007 Apr 03
2
R callbacks
Hi,
I'm trying to understand (mostly from the R-exts manual) how to use
the callbacks declared in Rinterface.h. As a first attempt, I'm trying
to redefine ptr_R_WriteConsole in a very trivial manner. Here's my
code:
---------------
$ cat altr.c
int Rf_initialize_R(int ac, char **av);
#define R_INTERFACE_PTRS 1
#include <Rinterface.h>
extern int R_running_as_main_program;
static void my_R_WriteConsole(char *buf, int len)
{
printf("R<< %s", buf);
}
int main(int ac, char **av)
{
R_running_as_main_program = 1;
ptr_R_WriteCon...
2010 Jan 04
1
bin/exec/R coredumps (PR#14177)
...ad successfully
Reading ld.so.1
Reading libR.so
Reading libRblas.so
Reading libc.so.1
Reading libm.so.2
Reading libreadline.so.5
Reading libpcre.so.0.0.0
program terminated by signal SEGV (no mapping at the fault address)
0xfffffd7fff21fb50: strlen+0x0030: pcmpeqb (%rsi),%xmm0
Current function is Rf_initialize_R (optimized)
331 if(strlen(cmdlines) + strlen(*av) + 2 <= 10000) {
dbx<1> where
[1] strlen(0x0, 0x0, 0xffff, 0x0, 0xffff, 0x3), at 0xfffffd7fff21fb50
=>[2] Rf_initialize_R(ac = ???, av = ???) (optimized), at 0xfffffd7...
2015 Aug 25
0
Child thread libR.so
...he
future, I changed my init fuction to:
---------- SNIP ----------------
void init_r() {
SEXP aperm_function;
/* this is our version of Rf_initEmbeddedR where we disable stack
checking */
const char *init_argv[] = {"MyFront", "--vanilla", "--slave"};
Rf_initialize_R(sizeof (init_argv) / sizeof (init_argv[0]),
(char**) init_argv);
/* Disable stack limit checking since it is incompatible being
loaded on a child thread
*/
R_CStackLimit = (uintptr_t)-1;
R_Interactive = TRUE; /* Rf_initialize_R set this based on isatty */
setup_Rmainloop();...
2017 Feb 09
3
changes in src/unix/system.c break builds on FreeBSD
...lude
-I/usr/local/include -DLIBICONV_PLUG -I/usr/local/include -isystem
/usr/local/include -DHAVE_CONFIG_H -fopenmp -fpic -O2 -pipe
-DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc49
-isystem /usr/local/include -fno-strict-aliasing -c system.c -o system.o
system.c: In function 'Rf_initialize_R':
system.c:213:13: error: 'RLIM_SAVED_CUR' undeclared (first use in this
function)
if (lim == RLIM_SAVED_CUR || lim == RLIM_SAVED_MAX)
^
system.c:213:13: note: each undeclared identifier is reported only once
for each function it appears in
system.c:213:38: error: 'RL...
2009 May 19
2
About " Error: C stack usage is too close to the limit"
Hi everyone!
I meet one problem when embedding R in C code, when I run the the R code in one child thread ,
it always print error info:
Error: C stack usage is too close to the limit
I also try to set R_CStackLimit = (uintptr_t)-1 to disable the C stack check as the R-exts doc say,
but it still does not work, the error info still exist.
Besides it is interesting that if i
2012 Feb 01
3
Crash in R using embedded.
...#39;t shown me the source of the problem.
Thanks!
Here is the code I'm using to initialize:
putenv("R_HOME=/apps/R/install/lib64/R");
const char *R_argv[]= {"RInterfaceTest", "--gui=none", "--no-save",
"--no-readline", "--silent"};
Rf_initialize_R(sizeof(R_argv)/sizeof(R_argv[0]), const_cast<char
**>(R_argv));
setup_Rmainloop();
ParseStatus status;
SEXP cmdSexp, cmdexpr = R_NilValue;
int error;
string rcommand = "f<-file(paste(tempdir(), \"/Routput.txt\", sep = \"\"),
open=\"wt+\")\nsink(f)\n&quo...
2013 Nov 21
2
Running R embedded in an mpiexec spawned process - Fatal error: you must specify '--save', '--no-save' or '--vanilla'
...RestoreAction = StartupRestoreAction.NoRestore,
NoRenviron = false
};
rEngine.Initialize(rStartParams); // calls the R API R_SetParams, then setup_Rmainloop
I gather that the following is hit in src/R-3.0.2/src/unix/system.c, in the function Rf_initialize_R:
if (!R_Interactive && Rp->SaveAction != SA_SAVE &&
Rp->SaveAction != SA_NOSAVE)
R_Suicide(_("you must specify '--save', '--no-save' or '--vanilla'"));
I don't understand why it would complain if spawned by mpiexec and fine otherwi...
2010 Jul 21
1
Plot window does not update in embedded code
...; input;
for (unsigned int i = 0; i < input.length(); ++i) {
buf[i] = input[i];
buf[i+1] = '\n';
buf[i+2] = '\0';
if ((int)i >= buflen-3) break;
}
return input.length();
}
extern "C" {
#define R_INTERFACE_PTRS
#include <Rinterface.h>
int Rf_initialize_R(int ac, char **av); /* in ../unix/system.c */
extern int R_running_as_main_program; /* in ../unix/system.c */
}
int main(int ac, char **av)
{
R_running_as_main_program = 1;
Rf_initialize_R(ac, av);
ptr_R_WriteConsoleEx = &R_WriteConsoleEx;
ptr_R_WriteConsole = &R_WriteConsole;...
2015 Aug 20
2
Child thread libR.so
...o disable the C
> stack check as the R-exts doc say,
> but it still does not work, the error info still exist.
>
That is the way to do it (and other project use it successfully) - the
fact that it doesn't work means that you probably do it at the wrong
place (you must set it *after* Rf_initialize_R).
Cheers,
Simon
---------------------------------------- SNIP
------------------------------------------------------------------------------
my code is as follows
---------------------------------------- SNIP
------------------------------------------------------------------------------
void ini...
2013 Nov 10
1
Embedded R Fails When Run on LSF Queue System
...error occurs:
Fatal error: you must specify '--save', '--no-save' or '--vanilla'
This is confusing becasue I believe I have set this by changing the startup parameters so that the no-save option is in use. I initialize R with the following collection of function calls:
1-Rf_initialize_R
2-R_SetParams
3-setup_Rmainloop
At step 2 I pass in a structure that specifies the no-save option (as well as interactive=true, verbose=false), so I would expect it to be okay, but I still receive this error. Again, not at the terminal but only when run as a separate process.
I gathered from this...
2007 Jul 11
1
make error R-5.1 on sun solaris
...S
Options enabled: shared BLAS, R profiling, Java
Recommended packages: yes
Make ends after the gcc..
make
.
.
.
gcc -I. -I../../src/include -I../../src/include -I/usr/openwin/include
-I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c system.c -o system.o
system.c: In function `Rf_initialize_R':
system.c:144: parse error before `char'
system.c:216: `localedir' undeclared (first use in this function)
system.c:216: (Each undeclared identifier is reported only once
system.c:216: for each function it appears in.)
*** Error code 1
make: Fatal error: Command failed for target `syst...
2009 Jan 08
1
Callbacks seems to get GCed.
...*info;
setenv("R_HOME","/usr/lib/R",0);
structRstart rp;
Rstart Rp = &rp;
R_setStartTime();
R_DefParams(Rp);
Rp->R_Quiet = TRUE;
Rp->RestoreAction = SA_RESTORE;
Rp->SaveAction = SA_NOSAVE;
R_SetParams(Rp);
R_Interactive = TRUE;
Rf_initialize_R(argc, argv);
setup_Rmainloop();
R_ReplDLLinit();
info = R_getEmbeddingDllInfo();
R_registerRoutines(info, cMethods, callMethods, NULL, NULL);
}
int main (int argc, char** argv)
{
int i;
initR();
r_exec("x <- function (f) { .Call(\"set_callback1\",f); }"...
2007 Jul 04
2
problem with findFun call from embedded R
...sing the same console based, interactive, "*** caught segfault
***" logic to execute. I was able to confirm that R_Interactive was set
to TRUE in my PL/R session.
It seems that Rf_initEmbeddedR() sets R_Interactive to TRUE and depends
on the output of isatty() to change it to FALSE in Rf_initialize_R() if
there is no tty. Unfortunately, the most common methods for starting
Postgres leave the tty attached (stdout and stderr are directed to the
log file). I ended up explicitly writing "R_Interactive = FALSE" just
after running Rf_initEmbeddedR() -- is this a safe and reasonable thin...
2005 Jul 24
1
Buglet in src/appl/splines.c (PR#8030)
...initely lost in loss record 18 of 36
==5085== at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==5085== by 0x8060C28: Putenv (Renviron.c:123)
==5085== by 0x8060DF2: process_Renviron (Renviron.c:181)
==5085== by 0x8060F31: process_system_Renviron (Renviron.c:203)
==5085== by 0x816068B: Rf_initialize_R (system.c:160)
==5085== by 0x805DA1A: main (Rmain.c:30)
==5085==
==5085== LEAK SUMMARY:
==5085== definitely lost: 436 bytes in 20 blocks.
==5085== possibly lost: 0 bytes in 0 blocks.
==5085== still reachable: 12983993 bytes in 6602 blocks.
==5085== suppressed: 0 bytes in 0 blo...
2009 Sep 03
1
Running an expression 1MN times using embedded R
...nviron = 0;
Rp->R_Interactive = (Rboolean)1;
R_SetParams(Rp);
R_SignalHandlers=0;
if (!getenv("R_HOME")) {
fprintf(stderr, "R_HOME is not set. Please set all required
environment variables before running this program.\n");
return(-1);
}
int stat= Rf_initialize_R(argc,(char **) argv);
if (stat<0) {
fprintf(stderr,"Failed to initialize embedded R!:%d\n",stat);
return(-2);
}
R_Outputfile = NULL;
R_Consolefile = NULL;
R_Interactive = (Rboolean)1;
// ptr_R_ShowMessage = Re_ShowMessage;
// ptr_R_WriteConsoleEx =Re_Writ...
2017 Feb 09
0
changes in src/unix/system.c break builds on FreeBSD
...clude -DLIBICONV_PLUG -I/usr/local/include -isystem
> /usr/local/include -DHAVE_CONFIG_H -fopenmp -fpic -O2 -pipe
> -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc49
> -isystem /usr/local/include -fno-strict-aliasing -c system.c -o system.o
> system.c: In function 'Rf_initialize_R':
> system.c:213:13: error: 'RLIM_SAVED_CUR' undeclared (first use in this
> function)
> if (lim == RLIM_SAVED_CUR || lim == RLIM_SAVED_MAX)
> ^
> system.c:213:13: note: each undeclared identifier is reported only once
> for each function it appears in
&...
2007 Jul 06
1
How to disable R's C stack checking
Hi all,
I'm developing an application on Mac OS X Darwin which embeds R.
However, the application always crashes due to the C stack checking.
I know that R_CStackLimit can be set to -1 to disable the stack
checking, but I don't know where to put the code "R_CStackLimit=-1".
Please give some instructions.
Thank you very much!
Here is my compiler infomation:
$g++ -v
Using
2008 Mar 07
1
Build options for R
Hello Everyone,
I had posted the message below to the r-help listserv...
>Recently I was given a Java servlet based web calculator that will
>call R (libR.so to be exact) but I am having trouble trying to disable R
>from requiring --save, --no-save or --vanilla... Is there any way to
>build R on linux and disable R from asking --save, --no-save or
--vanilla??
I received this
2015 Aug 24
0
Child thread libR.so
...check as the R-exts doc say,
>> but it still does not work, the error info still exist.
>>
>
> That is the way to do it (and other project use it successfully) - the
> fact that it doesn't work means that you probably do it at the wrong
> place (you must set it *after* Rf_initialize_R).
>
> Cheers,
> Simon
> ---------------------------------------- SNIP
> ------------------------------------------------------------------------------
>
> my code is as follows
>
> ---------------------------------------- SNIP
> ----------------------------------------...
2024 Oct 13
1
Embedding R in other applications as a scripting language
Bryce,
embedding R varies from easy to very complex depending on what you want to do with it. If all you want is to evaluate R commands and get the result values then it is easy: you just initialize R with Rf_initialize_R() and use R_tryEval() to evaluate what you need (making sure you stay on the main thread). However, if you want to run the full event loop or even use the GUI elements then it gets more complicated - you can have a look at https://github.com/s-u/rJava/blob/master/jri/src/Rinit.c which is short eno...