[R-pkg-devel] registering native routines
Thomas Petzoldt
thomas.petzoldt at tu-dresden.de
Tue Apr 10 14:17:53 CEST 2018
Hi,
I assume you followed "Writing R Extension" and the examples given in
package deSolve (and maybe some other packages).
Am I right that this fixed the i386 notes, but not for x64?
Here I conclude that you tested it on Windows. This is relevant, because
I remember a recent discussion (maybe on this mailing list), that the
"register native routines" check can sometimes produce false positives
on Windows.
Would it be possible for you, to check your package on a recent Linux
system?
Thomas Petzoldt
Am 10.04.2018 um 13:19 schrieb Rampal S. Etienne:
> Dear all,
>
> I am using Fortran code with the deSolve package in my package called
> "DDD". When checking my package I get the message:
>
> checking compiled code ... NOTE
> File 'DDD/libs/x64/DDD.dll':
> Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols'
>
> It is good practice to register native routines and to disable symbol search.
>
>
> Although it is "just" a note, I would like to solve this, but after
> quite some googling, I cannot find a solution.
>
> I have tried
>
> tools::package_native_routine_registration_skeleton('.')
> but this produces nothing, or only an empty file when I specify the
> argument con. I put the following R-init_DDD.c in the src folder and
> useDynLib("DDD",.registration = TRUE) in the namespace file. #include
> <R.h> #include <Rinternals.h> #include <stdlib.h> // for NULL #include
> <R_ext/Rdynload.h> /* .Fortran calls */ extern void
> F77_NAME(fill1d)(double *vec, int *DIMP, double *parms, int *II); extern
> void F77_NAME(initmod)(void (*steadyparms)(int *, double *)); extern
> void F77_NAME(runmod)(int *neq, double *t, double *Conc, double *dConc,
> double *yout, int *ip); static const R_FortranMethodDef FortranEntries[]
> = { {"fill1d", (DL_FUNC) &F77_NAME(fill1d), 4}, {"initmod", (DL_FUNC)
> &F77_NAME(initmod), 1}, {"runmod", (DL_FUNC) &F77_NAME(runmod), 6},
> {NULL, NULL, 0} }; void R_init_DDD(DllInfo *dll) {
> R_registerRoutines(dll, NULL, NULL, FortranEntries, NULL);
> R_useDynamicSymbols(dll, FALSE); }
>
> Note that I only get the message for x64, but I don't get it for i386,
> which I did before. So somehow, this is only an issue on 64-bit? How do
> I fix this?
>
> Regards,
>
> Rampal
More information about the R-package-devel
mailing list