search for: dllinfo

Displaying 20 results from an estimated 38 matches for "dllinfo".

Did you mean: allinfo
2007 Mar 19
3
Rinternals.h and undefined symbols
Hi, I'm trying to register my native routines using R_registerRoutines (...). I can compile the code, but the loader cannot resolve the symbol: undefined symbol: _Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6 _ $ nm bgx.Rcheck/bgx/libs/bgx.so | grep R_registerRoutines U _Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6 _ Why does it have this funny name? If I look at libR.so, I get an ordinary symbol name: $ nm ~/l...
2007 May 01
1
Embedding R and registering routines
Hello, The use of .Call and the like all depend on loading shared libraries and registering routines from it. Also, .Primitive and .Internal depend on routines being registered in the R binary. And applications that embed R can override routines declared in Rinterfac.h, but is there a way for an application embedding R to register other routines defined in the application without loading a
2013 Mar 09
5
question on why Rigroup package moved to Archive on CRAN
Hi, Who should I ask about my package Rigroup_0.83 being moved to Archive status on CRAN and no longer available via install.package? I have no problems with the move if this was simply because of low demand. However, if there was a build issue with the newest releases that caused problems, I would be happy to address it. I'll just ask my students to install it from my own locally hosted
2014 Jan 22
1
Linking to native routines in other packages
...nsuccessfully been trying to make a C routine called 'sampler' available to be called from other packages' C code. Following http://cran.r-project.org/doc/manuals/R-exts.html#Linking-to-native-routines-in-other-packages I have included #include <R_ext/Rdynload.h> R_init_stochvol(DllInfo *dll) { R_RegisterCCallable("stochvol", "sampler", (DL_FUNC) sampler); } in some file within stochvol's 'src' directory, and DL_FUNC stochvol_sampler = R_GetCCallable("stochvol", "sampler"); in some file within the 'src' directoy of th...
2017 Feb 09
2
R CMD check error
...NAMESPACE file imports expm, and the init.c file is #include "R.h" #include "R_ext/Rdynload.h" /* Interface to expm package. */ typedef enum {Ward_2, Ward_1, Ward_buggy_octave} precond_type; void (*expm)(double *x, int n, double *z, precond_type precond_kind); void R_init_hmm(DllInfo *dll) { expm = (void (*)) R_GetCCallable("expm", "expm"); } I don't expect that this is the problem since I stole the above almost verbatim from the msm package. Terry T. On 02/09/2017 11:23 AM, Martyn Plummer wrote: > On Thu, 2017-02-09 at 09:52 -0600, Therneau...
2007 Jun 01
1
Calling C routine in anther package in C code (R_RegisterCCallable)
...a dummy library containing src/dummy.cpp and R/zzz.R: ====== src/dummy.cpp ==== #include <R.h> #include <Rinternals.h> #include <R_ext/Rdynload.h> extern "C" { void dummy(int *a, int *b) { printf("dummy\n"); } } void R_init_dummy(DllInfo *dll) { R_RegisterCCallable("dummy", "dummy", (DL_FUNC)dummy); } ====== R/zzz.R ========= .First.lib <- function(lib, pkg) { library.dynam("dummy", pkg, lib) } ====================== I can compile this using R 2.5.0 under Linux. But I go...
2003 May 16
1
Reloading a shared library with dyn.load
...h> #include <stdio.h> void HelloFromC(char **result) { *result = (char *) R_alloc(20,sizeof(char)); sprintf(*result,"Hello from C!"); } static const R_CMethodDef CEntries[] = { {"HelloFromC",(DL_FUNC) &HelloFromC,1}, {NULL,NULL,0} }; void R_init_HelloFromC(DllInfo *info) { R_registerRoutines(info,CEntries,NULL,NULL,NULL); } ---------------------------------------------------------------- c:\james\HelloFromC> Rcmd SHLIB HelloFromC making HelloFromC.d from HelloFromC.c gcc -IC:/JAMES/rw1070/src/include -Wall -O2 -c HelloFromC.c -o HelloFromC.o ar...
2003 Dec 09
1
R Interface handholding
...init.c: #include "areone.h" #include <R_ext/Rdynload.h> #include <Rinternals.h> R_NativePrimitiveArgType myincr_t[1] = {INTSXP}; static const R_CMethodDef cMethods[] = { {"myincr", (DL_FUNC) &myincr, 1, myincr_t} }; void R_init_myincr(DllInfo* dll) { R_registerRoutines(dll, cMethods, NULL, NULL, NULL); } R is happy to install this for me, but after doing a library(myincr), the function doesn't seem to be available, so I presume I'm missing something. Does R normally call, at library load, R_init_$MODULENAME() ? My other quest...
2011 Aug 02
0
[Rd] example package for devel newcomers
...s inside php code. Stack size could be a concern. Has any of you there ever needed to allocate a new stack for a package? Is it better to wait for complaints (if anyone ever would like to try this package...)? 2. can R_registerRoutines be called more than once within the same library (the same DllInfo data) so that it can reconfigure itself on the fly? 3. Is it safe (I guess it is) to "re-export" a function pointer retrieved with R_GetCCallable? 4. when loading a second library (in this case libphp5.so) is it better to put it in the package library directory and load it using the &...
2016 May 02
2
Is it possible to increase MAX_NUM_DLLS in future R releases?
Hi, I?m working on a Shiny app for statistical analysis. I ran into this "maximal number of DLLs reached" issue recently because my app requires importing many other packages. I?ve posted my question on stackoverflow (http://stackoverflow.com/questions/36974206/r-maximal-number-of-dlls-reached <http://stackoverflow.com/questions/36974206/r-maximal-number-of-dlls-reached>). I?m
2009 Jan 08
1
Callbacks seems to get GCed.
...); R_tryEval(e, R_GlobalEnv, &errorOccurred); UNPROTECT_PTR(e); if (errorOccurred) { return; } } } } void initR() { char *argv[] = {"REmbeddedPascal", "--gui=none", "--silent", "--no-save"}; int argc = 4; DllInfo *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;...
2001 May 13
1
Dynamic C Symbols and Embedding Suggestion
...k (in the Windows case). You'll note the remarkable resemblance to AddDLL. :-) My test code calls this to set up its function list just after R_ReplDllinit() just before entering the do1-loop--- though perhaps this should be integrated into some part of the setup procedure for embedding apps. DllInfo* R_RegisterEmbeddedExecutable(HINSTANCE handle,char* path) { char* dpath,*name,DLLname[PATH_MAX], *p; DeleteDLL(path); if(CountDLL == MAX_NUM_DLLS) { strcpy(DLLerror,"unable to register embedded executable. too many libraries"); return 0; } dpath = malloc(strlen(path)+1);...
2016 May 04
2
Is it possible to increase MAX_NUM_DLLS in future R releases?
.... The OP says he imports many packages, and I doubt that more than a few are required at any one time. Good practice is to load namespaces as required, using requireNamespace. > The real solution of course would be a code improvement that > starts with a relatively small number of "DLLinfo" structures > (say 32), and then allocates more batches (of size say 32) if > needed. The problem of course is that such code will rarely be exercised, and people have made errors on the boundaries (here multiples of 32) many times in the past. (Note too that DLLs can be removed as w...
2011 Jul 31
3
example package for devel newcomers
Hi, I'd like to know whether there is a package (or more, of course) regarded as a good example that could be used also as an instructional tool for newcomers to R extensions development. Thanks. -- Alexandre -- Alexandre Santos Aguiar, MD, SCT -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198
2004 Aug 18
3
R as shared library
Hello folks, I'm embarking on a project to embed R into the Apache web server, and I'd like your help. Currently, I'm looking for a way for R code to call back into a shared library from which the R shared library was loaded. Essentially, apache starts and loads mod_R.so which runs an initialization routine which calls Rf_initEmbeddedR() and the following code: /* override to
2009 Sep 03
1
Running an expression 1MN times using embedded R
...Interactive = (Rboolean)1; // ptr_R_ShowMessage = Re_ShowMessage; // ptr_R_WriteConsoleEx =Re_WriteConsoleEx; // ptr_R_WriteConsole = NULL; // ptr_R_ReadConsole = NULL; return(0); } int main(int argc, char **argv){ if (embedR(argc,argv)) exit(1); setup_Rmainloop(); DllInfo *info = R_getEmbeddingDllInfo(); R_registerRoutines(info, NULL, callMethods, NULL, NULL); SEXP runner1,runner2; PROTECT(runner1=rexpress("expression({ for(x in 1:5) { .Call('rh_status','x') }})")); if (runner1 == R_NilValue){ UNPROTECT(1); exit...
2005 Dec 09
2
segfault following a detach
...more instructive as I do not see much going on in do_detach? suggestions? The library I am working with is in C and uses Nag, it uses the registration facilities, although I have the problem when I do not use the registration facilities. Specifically, I have defined the method: void R_init_DSA(DllInfo *info). However, as I said if I comment this out it appears to behave identically. Also, I have run the whole test case using valgrind to see if I could track down the problem there (I assume I am trashing some of R's memory) however, the only messages I get from valgrind are below - all re...
2016 May 04
0
Is it possible to increase MAX_NUM_DLLS in future R releases?
...ages | namespaces loaded in your R session. OTOH, some packages nowadays have a host of dependencies, so I agree that this at least may happen accidentally more frequently than in the past. The real solution of course would be a code improvement that starts with a relatively small number of "DLLinfo" structures (say 32), and then allocates more batches (of size say 32) if needed. Patches to the R sources (development trunk in subversion at https://svn.r-project.org/R/trunk/ ) are very welcome! Martin Maechler ETH Zurich & R Core Team
2016 Dec 22
0
Is it possible to increase MAX_NUM_DLLS in future R releases?
...DLLs) 3) We open up the possibility of more dynamic ordering of the LoadedDLL structure. Essentially we can very cheaply move the most recently "used" DLL to the front of the list. The cons, I think, are small in this situation. We already dynamically allocate strings and arrays in the DllInfo strucutre so those are already not memory-local. Additionally, R is frequently operating on large datasets so cache thrashing is almost a given. The negligible time increase in traversing the list, I believe, will be offset by the more dynamic sorting that we are able to give that list. I have w...
2017 Feb 10
0
R CMD check error (interfacing to C API of other pkg)
...> #include "R.h" > #include "R_ext/Rdynload.h" > /* Interface to expm package. */ > typedef enum {Ward_2, Ward_1, Ward_buggy_octave} precond_type; > void (*expm)(double *x, int n, double *z, precond_type precond_kind); > void R_init_hmm(DllInfo *dll) > { > expm = (void (*)) R_GetCCallable("expm", "expm"); > } > I don't expect that this is the problem since I stole the > above almost verbatim from the msm package. > Terry T. Hmm. Yes, I can see that the CRAN package...