Displaying 20 results from an estimated 21 matches for "r_getccal".
2017 Dec 29
3
winbuilder warning message wrt function pointers
...are a blocks like this, one for each of the 9 called C routines.
void bdsmatrix_prod4(int nrow,??? int nblock,?? int *bsize,
??????????????????? double *bmat, double *rmat,
??????????????????? int nfrail,?? double *y) {
??? static void (*fun)() = NULL;
??? if (fun==NULL)
??? fun = (void (*)) R_GetCCallable("bdsmatrix", "bdsmatrix_prod4");
??? fun(nrow, nblock, bsize, bmat, rmat, nfrail, y);
??? }
..
The winbuilder run is flagging all of these with
bdsmatrix_stub.h:22:6: warning: ISO C forbids assignment between function pointer and
'void *' [-Wpedantic]
? fun =...
2011 Feb 11
1
Writting my own package - 64 bit problem with R_GetCCallable
...problem seems to come when I attempt to access a function
registered by the Matrix package. During compilation (on 64 bit only)
I get the ominous:
--------------
slim_stolen_from_matrix.c: In function ?R_as_cholmod_sparse?:
slim_stolen_from_matrix.c:36: warning: implicit declaration of
function ?R_GetCCallable?
slim_stolen_from_matrix.c:36: warning: cast to pointer from integer of
different size
--------------
The function in question is an identical copy of Matrix's
M_as_cholmod_sparse, reproduced below
--------------
CHM_SP
R_as_cholmod_sparse(CHM_SP ans, SEXP x, Rboolean check_Udiag, Rboole...
2017 Dec 29
1
winbuilder warning message wrt function pointers
And remove the cast on the return value of R_GETCCallable. And check
that your function is found before using it.
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
void bdsmatrix_prod4(int nrow, int nblock, int *bsize,
double *bmat, double *rmat,
int nfrail, double *...
2017 Dec 29
0
winbuilder warning message wrt function pointers
...nes don't have void * as the return type (two are
> int *), and Rdynload has
>
> typedef void * (*DL_FUNC)();
>
> Will this untruth mess anything up?
>
> Terry T.
>
> On 12/29/2017 10:52 AM, William Dunlap wrote:
>
> And remove the cast on the return value of R_GETCCallable. And check
> that your function is found before using it.
>
> #include <R.h>
> #include <Rinternals.h>
> #include <R_ext/Rdynload.h>
>
> void bdsmatrix_prod4(int nrow, int nblock, int *bsize,
> double *bmat, double *rmat,
>...
2017 Dec 29
0
winbuilder warning message wrt function pointers
...ach of the 9 called
> C routines.
>
> void bdsmatrix_prod4(int nrow, int nblock, int *bsize,
> double *bmat, double *rmat,
> int nfrail, double *y) {
> static void (*fun)() = NULL;
> if (fun==NULL)
> fun = (void (*)) R_GetCCallable("bdsmatrix", "bdsmatrix_prod4");
> fun(nrow, nblock, bsize, bmat, rmat, nfrail, y);
> }
>
> ..
>
> The winbuilder run is flagging all of these with
>
> bdsmatrix_stub.h:22:6: warning: ISO C forbids assignment between function
> pointer and...
2014 Jan 22
1
Linking to native routines in other packages
...-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 the package depending on stochvol.
When installing that package, I however get:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
function 'sampler' not provided by package 'stochvol...
2017 Feb 09
2
R CMD check error
...nit.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, Terry M., Ph.D. wrote:
>> Martin,...
2017 Jan 13
1
calling native routines in another package (Sec 5.4.2 of Writing R Extensions)
...a complaint about that section of
Writing R Extensions. It says (even in R-devel) "A CRAN example of
the use of this mechanism is package lme4, which links to Matrix." but
that does not appear to be true anymore. I cannot see any inclusion
of headers from Matrix in lme4 nor any call to R_GetCCallable. I did
find the file inst/include/Matrix_stubs.c in the Matrix package
somewhat helpful (although mystifying at first).
So this can be considered a documentation bug report (if I am
correct). Do I need to do an official bugzilla one?
Just a further check. lme4 (1.1-12) does not have Matri...
2013 Nov 16
2
Linking to native routines in other packages
...hen we are not compiling Rcpp, for
example the "type2name" function is defined in Rcpp's headers as an
inline function that grabs the registered function from Rcpp.
inline const char* type2name(SEXP x){
typedef const char* (*Fun)(SEXP) ;
static Fun fun = GET_(Fun) R_GetCCallable( "Rcpp", "type2name") ;
return fun(x) ;
}
This works great.
Now for the question. The documentation says:
"It must also specify ?Imports? or ?Depends? of those packages, for they
have to be loaded prior to this one (so the path to their compiled cod...
2017 Feb 10
0
R CMD check error (interfacing to C API of other pkg)
...;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 msm does do this, indeed.
It is interesting if/why that...
2007 Jul 03
0
Forthcoming change in the API of the Matrix package
Martin and I will soon release a new version of the Matrix package
with a modified API. This will affect the authors of any packages
that use calls to the C function R_GetCCallable to directly access C
functions in the DLL or shared object object in the libs directory of
the Matrix package. (If you didn't understand that last sentence,
relax - it means that you can ignore this message.)
We strongly suspect that I am the only such author (this mechanism is
used in t...
2008 Oct 07
1
LinkingTo on Windows
Dear List,
R packages may specify a "LinkingTo" attribute to specify dependencies to
the source code (mainly the header files) of other packages.
Unfortunately, it is not possible to also have a reference to the generated
library (.dll on Windows) of the other package. So including a header file
from another package to call an (exported) function will just not help.
I've tried
2023 Mar 15
0
R 4.2.3 is released
...44afdce50b303bfc3b82b3979516e074 R-4/R-4.2.3.tar.gz
This is the relevant part of the NEWS file
CHANGES IN R 4.2.3:
C-LEVEL FACILITIES:
* The definition of DL_FUNC in R_ext/Rdynload.h has been changed to
be fully C-compliant. This means that functions loaded _via_ for
example R_GetCCallable need to be cast to an appropriate type if
they have any arguments.
* .Machine has a new element sizeof.time_t to identify old systems
with a 32-bit type and hence a limited range of date-times (and
limited support for dates millions of years from present).
PACKAGE INS...
2023 Mar 15
0
R 4.2.3 is released
...44afdce50b303bfc3b82b3979516e074 R-4/R-4.2.3.tar.gz
This is the relevant part of the NEWS file
CHANGES IN R 4.2.3:
C-LEVEL FACILITIES:
* The definition of DL_FUNC in R_ext/Rdynload.h has been changed to
be fully C-compliant. This means that functions loaded _via_ for
example R_GetCCallable need to be cast to an appropriate type if
they have any arguments.
* .Machine has a new element sizeof.time_t to identify old systems
with a 32-bit type and hence a limited range of date-times (and
limited support for dates millions of years from present).
PACKAGE INS...
2023 Mar 15
0
R 4.2.3 is released
...44afdce50b303bfc3b82b3979516e074 R-4/R-4.2.3.tar.gz
This is the relevant part of the NEWS file
CHANGES IN R 4.2.3:
C-LEVEL FACILITIES:
* The definition of DL_FUNC in R_ext/Rdynload.h has been changed to
be fully C-compliant. This means that functions loaded _via_ for
example R_GetCCallable need to be cast to an appropriate type if
they have any arguments.
* .Machine has a new element sizeof.time_t to identify old systems
with a 32-bit type and hence a limited range of date-times (and
limited support for dates millions of years from present).
PACKAGE INS...
2011 Aug 02
0
[Rd] example package for devel newcomers
...mplaints
(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 'char
*path' member of DllInfo? Using a second library has implications:
a) a given R setup can be limited to the user space without root access;...
2017 Feb 09
2
R CMD check error
Martin,
I am aware of --vanilla; I use it myself for some testing. In this case R_LIBS_USER was
set externally (part of my login) and does not involve any of the R scripts. That means
it is inherited by any subprocess. For example:
tmt1495% R --vanilla --no-environ
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
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
2010 Feb 11
2
LinkingTo and C++
Hello,
I've been trying to make LinkingTo work when the package linked to has
c++ code.
I've put dumb packages to illustrate this emails here ;
http://addictedtor.free.fr/misc/linkingto
Package A defines this C++ class:
class A {
public:
A() ;
~A() ;
SEXP hello() ;
} ;
Package B has this function :
SEXP say_hello(){
A a ;
return a.hello() ;
}
headers of package A are copied
2006 Oct 03
1
R-2.4.0 is released
...embedded R is initialized it is
assumed to point to a valid session temporary directory: see
`Writing R Extensions'.
o There is a new interface allowing one package to make C routines
available to C code in other packages. The interface consists
of the routines R_RegisterCCallable and R_GetCCallable. These
functions are declared in <R_ext/Rdynload.h>. This interface
is experimental and subject to change.
In addition, a package can arrange to make use of header
files in another (already installed) package via the
'LinkingTo' field in the DESCRIPTION file: see 'Writ...