From georgi.boshnakov at manchester.ac.uk  Tue Feb 27 14:54:00 2018
From: georgi.boshnakov at manchester.ac.uk (Georgi Boshnakov)
Date: Tue, 27 Feb 2018 13:54:00 +0000
Subject: [Rd] Problem with R_registerRoutines
Message-ID: <438D2EC9EAFE5946B2D5864670EA468E018F650019@MBXP01.ds.man.ac.uk>

Sorry, resending with correct subject line.


I didn't find the development version of your package but the latest version archived on CRAN uses Rcpp, RcppArmadillo.
Since the latest versions of Rcpp and Armadillo support registration, it may be something related to RcppAttributes() or similar. I think that you don't need to do registration manually. 

I had a similar problem but when I realised the above, I discarded everything generated by Rcpp/RcppArmadillo, Installed their latest versions and compared my package to freshly generated packages by Rcpp.package.skeleton() and RcppArmadillo.package.skeleton().
(Since I had old-ish version of R and Rdevel, I updated them too. )

I believe that you also need to import something from Rcpp (but not from RcppArmadillo). Try the following line

importFrom(Rcpp, evalCpp)

in NAMESPACE (I believe that it is generated by both, Rcpp.package.skeleton() and RcppArmadillo.package.skeleton()).


The path issue on Windows is a separate one. I typically start a command window from a batch file which sets the paths and environment variables maybe more defensively,  and the above removed the "registration" warning. But using  devtools from a different session still gives it. 


Georgi Boshnakov


------------------------------

Message: 5
Date: Tue, 27 Feb 2018 07:21:18 +0000
From: <Jon.SKOIEN at ec.europa.eu>
To: <maechler at stat.math.ethz.ch>
Cc: <jeroenooms at gmail.com>, <r-devel at r-project.org>
Subject: Re: [Rd] Problem with R_registerRoutines
Message-ID:
	<548D52560D5BDE45AEC4EF876BF2A194012D3FF3 at S-DC-ESTB01-J.net1.cec.eu.int>
	
Content-Type: text/plain; charset="us-ascii"


Martin,

I did not use --as-cran on Linux, when I do, I also see the error there.
So most likely something is wrong and you're right that the package would not be accepted on CRAN, but I'm running out of ideas for how to solve this problem. I have tried to modify the initialization file in lots of different ways, so far nothing helps. 

Jon

________________________________________
From: Martin Maechler [maechler at stat.math.ethz.ch]
Sent: 23 February 2018 18:56
To: SKOIEN Jon (JRC-ISPRA)
Cc: jeroenooms at gmail.com; r-devel at r-project.org
Subject: Re: [Rd] Problem with R_registerRoutines

>>>>>   <Jon.SKOIEN at ec.europa.eu>
>>>>>     on Fri, 23 Feb 2018 15:43:43 +0000 writes:

    > Thanks a lot for your answer Jeroen!
    > I should have mentioned that I had actually only checked with the win-builder, as I did not have R-devel installed on my computer.
    > But based on your answer I installed R-devel locally on a Linux-server (Redhat), and the package could be checked without the NOTE. So you might be right that this is a windows issue. However, another package that I am maintaining does not get any notes from the check on the win-builder (including fortran-code), so there is still something I don't understand here.

    > Anyway, does this mean that the package might be accepted on CRAN without further changes?

at least not automatically, and not very probably in my gut feeling... but I may be wrong.

Did you use  R CMD check --as-cran  <your_pkg> on Linux ?

Martin

    > Thanks,
    > Jon


    > ________________________________________
    > From: Jeroen Ooms [jeroenooms at gmail.com]
    > Sent: 23 February 2018 13:36
    > To: SKOIEN Jon (JRC-ISPRA)
    > Cc: r-devel
    > Subject: Re: [Rd] Problem with R_registerRoutines

    > On Windows this warning may be a false positive if R cannot find
    > "objdump.exe" which is required for this check. I think this is
    > actually a bug in R because it should be looking for "objdump.exe"
    > inside BINPREF (where gcc is) rather than on the PATH.

    > Can you check if you get the same warning if you upload the package to
    > https://win-builder.r-project.org ?






    > On Fri, Feb 23, 2018 at 10:28 AM,  <Jon.SKOIEN at ec.europa.eu> wrote:
    >> Dear list,
    >>
    >> I am trying to update a package to pass the CRAN-checks.
    >> But I am struggling with the following note:
    >>
    >> File 'psgp/libs/i386/psgp.dll':
    >> Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols'
    >> File 'psgp/libs/x64/psgp.dll':
    >> Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols'
    >>
    >> It is good practice to register native routines and to disable symbol
    >> search.
    >>
    >>
    >> I did already run:
    >> tools::package_native_routine_registration_skeleton(".")
    >> This gave me some code, including a function R_init_psgp, which includes calls to the functions above, and also the names of the C++ functions to be called from R.
    >> I first saved this code in registerDynamicSymbol.c and added .registration = TRUE to useDynLib in the NAMESPACE file.
    >> I still get the error above. As I saw that the file has different names in other packages, I have also tried to save it psgp_init.c, and in init.cpp, still with the same error message.
    >>
    >> I have read the relevant part of the R extensions manual, but could not find anything that could help me with this problem.
    >> I have had a look at the similar files in other packages (including one of my own, which works), and the initialization seems fine to me.
    >> There is surely something I have overlooked, is anyone able to give me a hint to where I might look? The code is in C++, not sure if that could have anything to do with the problem?
    >>
    >> Thanks,
    >> Jon
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >> ______________________________________________
    >> R-devel at r-project.org mailing list
    >> https://stat.ethz.ch/mailman/listinfo/r-devel

    > ______________________________________________
    > R-devel at r-project.org mailing list
    > https://stat.ethz.ch/mailman/listinfo/r-devel




------------------------------

Subject: Digest Footer

_______________________________________________
R-devel at r-project.org mailing list  DIGESTED https://stat.ethz.ch/mailman/listinfo/r-devel


------------------------------

End of R-devel Digest, Vol 180, Issue 24
****************************************


[Rd] Problem with R_registerRoutines
Georgi Boshnakov