[R-pkg-devel] registering native routines

Henric Winell nilsson.henric at gmail.com
Wed Apr 11 11:56:38 CEST 2018

Den 2018-04-10 kl. 23:30, skrev Rampal Etienne:

> Dear Thomas,
> Yes, I followed all those suggestions but it did not fix the x64 notes. 
> Indeed I am using Windows. I am going to try this on a Linux system.

On a 64-bit system you need to have 64-bit versions of the necessary 
tools on the path, but the Rtools installer defaults to 32-bit versions. 
  The issue was brought up on the R-devel list about a year ago:


Henric Winell

> Cheers, Rampal
> On 10-Apr-18 14:17, Thomas Petzoldt wrote:
>> 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
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

More information about the R-package-devel mailing list