[R-pkg-devel] registering native routines

Rampal S. Etienne rampaletienne at gmail.com
Tue Apr 10 13:19:06 CEST 2018


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

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list