Skip to content

[R-pkg-devel] registering native routines

4 messages · Avraham Adler, Charles Geyer, Bob Rudis

#
I just noticed that R package foo in the github repo
https://github.com/cjgeyer/foo no longer passes R CMD check --as-cran.  The
problem seems to be that it does not register native routines and thus the
C routines cannot be found.  It does pass R CMD check (without --as-cran).
The version of the package that does register native routines (package
fooRegister) in the same repo passes with or without --as-cran.  So did I
miss the announcement?  Is registration of native routines now mandatory
for CRAN?

Just asking because I am currently teaching about R packages in PhD level
statistical confusing and don't want to provide erroneous info.

These packages are toy packages to introduce the class to R packages.  I
don't actually want to put them on CRAN.
#
https://stat.ethz.ch/pipermail/r-devel/2017-February/073755.html
On Sat, Feb 16, 2019 at 3:22 PM Charles Geyer <charlie at stat.umn.edu> wrote:
#
Sorry.  I am a moron.  It was an illusion.  I was checking R package
foo with the Makevars for R package fooRegister via the
R_MAKEVARS_USER mechanism and got confused.  In fact R package foo,
when checked with --as-cran only gives warnings not errors about
registering native routines.

So AFAICS, CRAN warns against not using registration of native
routines but that is not yet an ERROR.  So that is what I am going to
tell the students.

All of my CRAN packages properly register native routines, and I teach
this to my advisees and students.  But my github packages I use as
teaching examples don't (except for the aforementioned fooRegister)
and I was suddenly worried about them.
On Sat, Feb 16, 2019 at 9:41 PM Avraham Adler <avraham.adler at gmail.com> wrote:

  
    
1 day later
#
I believe you've got _some_ time. As of the changes in 3.4.0 the verbiage is:

   R CMD check --as-cran now NOTEs if the package does not register 
   its native routines or does not declare its intentions on (native) 
   symbol search. (This will become a WARNING in due course.)

And I think it's still a NOTE vs a full-on WARNING (I register all mine but can test this later).

Rcpp makes this super simple and the tools::package_native_routine_registration_skeleton() is also pretty painless as does Kevin Ushey's souretools::register_routines() (https://github.com/kevinushey/sourcetools/blob/master/R/register.R).

-boB