Discussion:
[Rcpp-devel] RcppEigen.package.skeleton r cmd check warning
Edward Roualdes
2014-05-07 16:05:04 UTC
Permalink
All,

I've narrowed down this R CMD CHECK warning all the way from my code (
https://github.com/roualdes/btf) to RcppEigen.package.skeleton() to an even
smaller example. Any thoughts / suggestsions to get rid of this warning
which will keep such packages off of CRAN are much appreciated. Below are
the steps to recreate the warning and some details along the way.
library(RcppEigen)
RcppEigen.package.skeleton('abc')
...
Warning message:

The following packages are referenced using Rcpp::depends attributes
however are not listed in the Depends and LinkingTo fields of the package
DESCRIPTION file: RcppEigen
sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] Rcpp_0.11.1 RcppEigen_0.3.2.1.2

loaded via a namespace (and not attached):
[1] compiler_3.1.0 grid_3.1.0 lattice_0.20-29 Matrix_1.1-3
[5] tools_3.1.0

As expected, installing $ R CMD INSTALL ~/Desktop/abc and functionality
work just fine. But, running $ R CMD BUILD ~/Desktop/abc/ && R CMD CHECK
~/abc_1.0.tar.gz provides a number of easily fixed warnings, and then the
following of which I fail to understand.

* checking compiled code ... WARNING
File ‘/Users/easy-e/Desktop/abc.Rcheck/abc/libs/abc.so’:
Found ‘___assert_rtn’, possibly from ‘assert’ (C)
Objects: ‘RcppExports.o’, ‘rcppeigen_hello_world.o’

A similar problem comes up with the following code as the only file in a
package's src/ directory.

#include <RcppEigen.h>
// [[Rcpp::depends(RcppEigen)]]
// [[Rcpp::export]]
Rcpp::List len(const Eigen::VectorXd& y) {
int n = y.size();
return Rcpp::List::create(Rcpp::Named("n") = n);
}

An attempt to learn from other packages ( sparseLTSEigen / lme4) was made,
but I found no such luck. Please let me know what I can do to help.

With much appreciation,
Edward
Dirk Eddelbuettel
2014-05-07 18:01:26 UTC
Permalink
Edward,

I cannot replicate that. As you can see below, I do have -Wall -pedantic
and what not on, but with my compiler (g++-4.8) everything is good.

Dirk


R> sourceCpp("/tmp/edward.cpp", verbose=TRUE, rebuild=TRUE)

Generated extern "C" functions
--------------------------------------------------------


#include <Rcpp.h>

RcppExport SEXP sourceCpp_72843_len(SEXP ySEXP) {
BEGIN_RCPP
SEXP __sexp_result;
{
Rcpp::RNGScope __rngScope;
Rcpp::traits::input_parameter< const Eigen::VectorXd& >::type y(ySEXP );
Rcpp::List __result = len(y);
PROTECT(__sexp_result = Rcpp::wrap(__result));
}
UNPROTECT(1);
return __sexp_result;
END_RCPP
}

Generated R functions
-------------------------------------------------------

`.sourceCpp_72843_DLLInfo` <- dyn.load('/tmp/RtmppWxdwY/sourcecpp_9911c88ac60/sourceCpp_76679.so')

len <- Rcpp:::sourceCppFunction(function(y) {}, FALSE, `.sourceCpp_72843_DLLInfo`, 'sourceCpp_72843_len')

rm(`.sourceCpp_72843_DLLInfo`)

Building shared library
--------------------------------------------------------

DIR: /tmp/RtmppWxdwY/sourcecpp_9911c88ac60

/usr/lib/R/bin/R CMD SHLIB -o 'sourceCpp_76679.so' --preclean 'edward.cpp'
ccache g++-4.8 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/RcppEigen/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -O3 -Wall -pipe -Wno-unused -pedantic -std=c++11 -c edward.cpp -o edward.o
g++-4.8 -shared -Wl,-Bsymbolic-functions -Wl,-z,relro -o sourceCpp_76679.so edward.o -L/usr/lib/R/lib -lR
R>
--
Dirk Eddelbuettel | ***@debian.org | http://dirk.eddelbuettel.com
Dirk Eddelbuettel
2014-05-07 18:32:49 UTC
Permalink
Edward,

On 7 May 2014 at 12:05, Edward Roualdes wrote:
| I've narrowed down this R CMD CHECK warning all the way from my code (https://
| github.com/roualdes/btf) to RcppEigen.package.skeleton() to an even smaller
| example.  Any thoughts / suggestsions to get rid of this warning which will
| keep such packages off of CRAN are much appreciated.  Below are the steps to
| recreate the warning and some details along the way.

Sorry, I think I read your email the wrong way in my first reply.

| > library(RcppEigen)
| > RcppEigen.package.skeleton('abc')
| ...
| Warning message:                                                              
|              
| The following packages are referenced using Rcpp::depends attributes however
| are not listed in the Depends and LinkingTo fields of the package DESCRIPTION
| file: RcppEigen 

That should be harmless. You did cut off the messages showing that we DO
added RcppEigen to Imports and LinkingTo.

For the other warning, I see these chiefly as failures of the default
package.skeleton() we wrap around: incomplete help pages etc pp, incomplete
sections in help pages.

The resulted page builds / checks for me (after fixing the one .Rd file's
examples section).

I too find it highly annoying that package.skeleton() creates packages with
so many warnings. It would be worth replacing / enhancing, and if I have time
and nothing more pressing to work on I may.

| As expected, installing $ R CMD INSTALL ~/Desktop/abc and functionality work
| just fine.  But, running $ R CMD BUILD ~/Desktop/abc/ && R CMD CHECK ~/

Right.

| abc_1.0.tar.gz provides a number of easily fixed warnings, and then the
| following of which I fail to understand.
|
| * checking compiled code ... WARNING
| File ‘/Users/easy-e/Desktop/abc.Rcheck/abc/libs/abc.so’:
|   Found ‘___assert_rtn’, possibly from ‘assert’ (C)
|     Objects: ‘RcppExports.o’, ‘rcppeigen_hello_world.o’

Now that would be a real warning bug, and I don't have it with gcc / g++ 4.8.

| A similar problem comes up with the following code as the only file in a
| package's src/ directory.
|
| #include <RcppEigen.h>
| // [[Rcpp::depends(RcppEigen)]]
| // [[Rcpp::export]]
| Rcpp::List len(const Eigen::VectorXd& y) {
|   int n = y.size();
|   return Rcpp::List::create(Rcpp::Named("n") = n);
| }

As I showed you, that too builds without issue for me.

| An attempt to learn from other packages ( sparseLTSEigen / lme4) was made, but
| I found no such luck. Please let me know what I can do to help.

I appreciate the offer for help. Right now I don't have a reproducible
problem for you to work on (apart from creating a new / better
package.skeleton() or a post process for it...)

Cheers, Dirk
--
Dirk Eddelbuettel | ***@debian.org | http://dirk.eddelbuettel.com
Edward Roualdes
2014-05-08 01:33:49 UTC
Permalink
Dirk,

Thanks for checking this out and suggesting that it is likely just my
machine. After a successful build / run on travis cl, we've basically
confirmed that my machine has the issue.

Thank you,
Edward
Post by Dirk Eddelbuettel
Edward,
| I've narrowed down this R CMD CHECK warning all the way from my code (https://
| github.com/roualdes/btf) to RcppEigen.package.skeleton() to an even smaller
| example. Any thoughts / suggestsions to get rid of this warning which
will
| keep such packages off of CRAN are much appreciated. Below are the
steps to
| recreate the warning and some details along the way.
Sorry, I think I read your email the wrong way in my first reply.
| > library(RcppEigen)
| > RcppEigen.package.skeleton('abc')
| ...
|
| The following packages are referenced using Rcpp::depends attributes however
| are not listed in the Depends and LinkingTo fields of the package DESCRIPTION
| file: RcppEigen
That should be harmless. You did cut off the messages showing that we DO
added RcppEigen to Imports and LinkingTo.
For the other warning, I see these chiefly as failures of the default
package.skeleton() we wrap around: incomplete help pages etc pp, incomplete
sections in help pages.
The resulted page builds / checks for me (after fixing the one .Rd file's
examples section).
I too find it highly annoying that package.skeleton() creates packages with
so many warnings. It would be worth replacing / enhancing, and if I have time
and nothing more pressing to work on I may.
| As expected, installing $ R CMD INSTALL ~/Desktop/abc and functionality work
| just fine. But, running $ R CMD BUILD ~/Desktop/abc/ && R CMD CHECK ~/
Right.
| abc_1.0.tar.gz provides a number of easily fixed warnings, and then the
| following of which I fail to understand.
|
| * checking compiled code ... WARNING
| Found ‘___assert_rtn’, possibly from ‘assert’ (C)
| Objects: ‘RcppExports.o’, ‘rcppeigen_hello_world.o’
Now that would be a real warning bug, and I don't have it with gcc / g++ 4.8.
| A similar problem comes up with the following code as the only file in a
| package's src/ directory.
|
| #include <RcppEigen.h>
| // [[Rcpp::depends(RcppEigen)]]
| // [[Rcpp::export]]
| Rcpp::List len(const Eigen::VectorXd& y) {
| int n = y.size();
| return Rcpp::List::create(Rcpp::Named("n") = n);
| }
As I showed you, that too builds without issue for me.
| An attempt to learn from other packages ( sparseLTSEigen / lme4) was
made, but
| I found no such luck. Please let me know what I can do to help.
I appreciate the offer for help. Right now I don't have a reproducible
problem for you to work on (apart from creating a new / better
package.skeleton() or a post process for it...)
Cheers, Dirk
--
Dirk Eddelbuettel
2014-05-08 01:57:16 UTC
Permalink
Hi Edouard,

On 7 May 2014 at 21:33, Edward Roualdes wrote:
| Thanks for checking this out and suggesting that it is likely just my machine. 
| After a successful build / run on travis cl, we've basically confirmed that my 
| machine has the issue.

Thanks for reporting back. And yes, Travis (and other 'clean' virtual
machines) is a good test bed, as is win-builder. I hope you get your machine
straightened out.

Dirk
--
Dirk Eddelbuettel | ***@debian.org | http://dirk.eddelbuettel.com
Loading...