[Rcpp-devel] Error: .onLoad failed in loadNamespace()

Romain Francois romain at r-enthusiasts.com
Tue May 31 21:11:08 CEST 2011


I'm using the same versions and I don't get the problem.

getClass is in methods, and Rcpp does have

import(methods)

in its NAMESPACE file.

Maybe this means that the client package also needs it. not sure.

Le 31/05/11 19:55, Laurent Gatto a écrit :
> Dear Romain,
>
> On 31 May 2011 13:34, Romain Francois<romain at r-enthusiasts.com>  wrote:
>> Works fine for me. Laurent, can you try with the current svn version of
>> Rcpp.
>>
>> svn checkout svn://svn.r-forge.r-project.org/svnroot/rcpp
>> cd rcpp/pkg
>> R CMD INSTALL Rcpp
>> Rscript -e "require(Rcpp); Rcpp.package.skeleton(module=TRUE)"
>> R CMD check anRpackage
>
> Warning still there, although possibly with a hint:
>
> * checking whether the name space can be loaded with stated
> dependencies ... WARNING
> Error: .onLoad failed in loadNamespace() for ‘anRpackage’, details:
>    call: value[[3L]](cond)
>    error: failed to load module yada from package anRpackage
> could not find function "getClass"
> Execution halted
>
> A namespace must be able to be loaded with just the base namespace
> loaded: otherwise if the namespace gets loaded by a saved object, the
> session will be unable to start.
>
> Probably some imports need to be declared in the NAMESPACE file.
>
> I also updated R-devel; session information is:
>
> R version 2.14.0 Under development (unstable) (2011-05-30 r56024)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
>   [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C
>   [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8
>   [5] LC_MONETARY=en_GB.utf8    LC_MESSAGES=en_GB.utf8
>   [7] LC_PAPER=C                LC_NAME=C
>   [9] LC_ADDRESS=C              LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] methods   stats     graphics  grDevices utils     datasets  base
>
> other attached packages:
> [1] Rcpp_0.9.4.2
>
>
> Note that I observed this warning while working on a 'real' package.
> In the hope to track its origin down and provide a reproducible
> example, I realised that the warning also came up with the standard
> Rcpp.package.skeleton output, which ended up in this thread. However,
> to my surprise (and embarrassment), I do not have the warning in the
> original package any more (whether with Rcpp 0.9.4.2 or 0.9.4.1). I
> tried to revert some of the changes I did (moving Rcpp from Depends to
> Imports for instance, removing the import(Rcpp) statement in the
> NAMESPACE file,...) but without any success.
>
> Not sure I am of any help here...
>
> Best wishes,
>
> Laurent
>
>
>> Romain
>>
>> Le 30/05/11 21:58, Romain Francois a écrit :
>>>
>>> Le 28/05/11 04:04, Dirk Eddelbuettel a écrit :
>>>>
>>>> Hi Laurent,
>>>>
>>>> On 27 May 2011 at 17:17, Laurent Gatto wrote:
>>>> | Dear all,
>>>> |
>>>> | A basic packages with Rcpp modules produces the warning described
>>>> | below, that I would ideally, with your help, get rid of.
>>>> |
>>>> | Rscript -e "require(Rcpp); Rcpp.package.skeleton(module=FALSE)"
>>>> | R CMD check anRpackage
>>>> |
>>>> | produces obvious warnings related to badly formatted documentation and
>>>> | license. However
>>>> |
>>>> | Rscript -e "require(Rcpp); Rcpp.package.skeleton(module=TRUE)"
>>>> | R CMD check anRpackage
>>>> |
>>>> | produces this additional warning that puzzles me:
>>>> |
>>>> | [ ...checker output... ]
>>>> | * checking whether the name space can be loaded with stated
>>>> | dependencies ... WARNING
>>>> | Error: .onLoad failed in loadNamespace() for ‘anRpackage’, details:
>>>> | call: value[[3L]](cond)
>>>> | error: failed to load module yada from package anRpackage
>>>> | Execution halted
>>>> |
>>>> | A namespace must be able to be loaded with just the base namespace
>>>> | loaded: otherwise if the namespace gets loaded by a saved object, the
>>>> | session will be unable to start.
>>>> |
>>>> | Probably some imports need to be declared in the NAMESPACE file.
>>>> | [ ...checker output...]
>>>> |
>>>> | I suspect this may be related to the yada module not being exposed and
>>>> | thus not available when the package is loaded. Any further explanation
>>>> | or hints would however be warmly appreciated.
>>>>
>>>> I think you are pretty close. As I recall, this 'warning' has been a
>>>> bit of a
>>>> wart that won't quite go away. I just checked again what we do in the
>>>> unit
>>>> tests in file runit.Module.client.package.R: we build a package (ie
>>>> create a
>>>> tar.gz) and then install from it. That also triggers the warning, but
>>>> passes
>>>> it.
>>>>
>>>> Romain may have more details about how this is related to module
>>>> initialization and startup.
>>>>
>>>> Dirk
>>>
>>> I'll have a go at installing a fresher R-devel and see what the next
>>> move is. My guess is that R checks are tighter now.
>>>
>>>> |
>>>> | sessionInfo() is appended below.
>>>> |
>>>> | Thank you very much in advance.
>>>> |
>>>> | Best wishes,
>>>> |
>>>> | Laurent
>>>> |
>>>> |
>>>> |>  sessionInfo()
>>>> | R version 2.14.0 Under development (unstable) (2011-05-04 r55760)
>>>> | Platform: x86_64-unknown-linux-gnu (64-bit)
>>>> |
>>>> | locale:
>>>> | [1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
>>>> | [3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
>>>> | [5] LC_MONETARY=C LC_MESSAGES=en_GB.utf8
>>>> | [7] LC_PAPER=en_GB.utf8 LC_NAME=C
>>>> | [9] LC_ADDRESS=C LC_TELEPHONE=C
>>>> | [11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
>>>> |
>>>> | attached base packages:
>>>> | [1] stats graphics grDevices utils datasets methods base
>>>> |
>>>> | other attached packages:
>>>> | [1] Rcpp_0.9.4.1
>>>
>>>
>>
>>
>> --
>> Romain Francois
>> Professional R Enthusiast
>> +33(0) 6 28 91 30 30
>> http://romainfrancois.blog.free.fr
>> http://romain-francois.com
>> |- http://bit.ly/hdKhCy : Rcpp article in JSS
>> |- http://bit.ly/elZJRJ : Montpellier Comedie Club - Avril 2011
>> `- http://bit.ly/fhqbRC : Rcpp workshop in Chicago on April 28th
>>
>>
>> _______________________________________________
>> Rcpp-devel mailing list
>> Rcpp-devel at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>>
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
http://romain-francois.com
|- http://bit.ly/hdKhCy : Rcpp article in JSS
|- http://bit.ly/elZJRJ : Montpellier Comedie Club - Avril 2011
`- http://bit.ly/fhqbRC : Rcpp workshop in Chicago on April 28th




More information about the Rcpp-devel mailing list