When compileAttributes comes across an export-ed C++ function that has one or more attributes, it generates two versions of it in RcppExports.cpp and RcppExports.R: one with the correct arguments, and one with no arguments. Does anyone else see this? I'm attaching a simple package created with Rcpp.package.skeleton("myPackage", attributes = TRUE), which I then edited to add a parameter "NumericVector z" to function "rcpp_hello_world" and manually rerun "compileAttributes()".
System details: R 3.0.2 on x86_64-apple-darwin10.8.0 (OS X Lion 10.7.5) and Rcpp 0.10.6 installed from CRAN.
Davor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myPackage_1.0.tar.gz
Type: application/x-gzip
Size: 2091 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140117/60dfe4fe/attachment.bin>
-------------- next part --------------
[Rcpp-devel] Bug: compileAttributes incorrectly handles Rcpp::export-ed functions with multiple arguments
10 messages · Davor Cubranic, Romain Francois, JJ Allaire +1 more
Davor,
On 17 January 2014 at 14:47, Davor Cubranic wrote:
| When compileAttributes comes across an export-ed C++ function that has one or more attributes, it generates two versions of it in RcppExports.cpp and RcppExports.R: one with the correct arguments, and one with no arguments. Does anyone else see this? I'm attaching a simple package created with Rcpp.package.skeleton("myPackage", attributes = TRUE), which I then edited to add a parameter "NumericVector z" to function "rcpp_hello_world" and manually rerun "compileAttributes()".
You had two mistakes here:
i) after you alter an interface to be used by Rcpp Attributes, you must
re-run the compileAttributes() function to update the files. See the
vignette for details.
(And if you use RStudio, this is done automagically)
ii) Your C++ function did not work as the 'List z = ...' parameter
shadowed an already declared parameter from the function interface.
Renaming to zz or z2 works, of course.
Doing i) and ii) lets you build the package as expected.
Dirk
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
On 2014-01-17, at 2:55 PM, Dirk Eddelbuettel wrote:
You had two mistakes here:
i) after you alter an interface to be used by Rcpp Attributes, you must
re-run the compileAttributes() function to update the files. See the
vignette for details.
What do you mean by this? Like I said, I changed the .cpp file and re-run compileAttributes. What I uploaded is the result afterwards.
(And if you use RStudio, this is done automagically)
So it is by devtools, on one of the functions I regularly use in my workflow, perhaps "test". If it wasn't, it would be such a pain.
ii) Your C++ function did not work as the 'List z = ...' parameter
shadowed an already declared parameter from the function interface.
Renaming to zz or z2 works, of course.
I fixed it and rerun compileAttributes. Still the same problem. New version of the package is attached. Davor -------------- next part -------------- A non-text attachment was scrubbed... Name: myPackage_1.0-1.tar.gz Type: application/x-gzip Size: 2093 bytes Desc: not available URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140117/459d1b8f/attachment.bin> -------------- next part --------------
On 17 January 2014 at 15:32, Davor Cubranic wrote:
| On 2014-01-17, at 2:55 PM, Dirk Eddelbuettel wrote:
|
| > You had two mistakes here:
| >
| > i) after you alter an interface to be used by Rcpp Attributes, you must
| > re-run the compileAttributes() function to update the files. See the
| > vignette for details.
|
| What do you mean by this? Like I said, I changed the .cpp file and re-run
| compileAttributes. What I uploaded is the result afterwards.
The equivalent of
$ cd myPackage; R -e 'Rcpp::compileAttributes(".")'
For once, I launched R and typed it by hand.
| > (And if you use RStudio, this is done automagically)
|
| So it is by devtools, on one of the functions I regularly use in my workflow, perhaps "test". If it wasn't, it would be such a pain.
|
| > ii) Your C++ function did not work as the 'List z = ...' parameter
| > shadowed an already declared parameter from the function interface.
| > Renaming to zz or z2 works, of course.
|
| I fixed it and rerun compileAttributes. Still the same problem. New version of the package is attached.
See here, based on your previous file.
edd at max:/tmp/davor/myPackage$ cat src/rcpp_hello_world.cpp
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List rcpp_hello_world(NumericVector z) {
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z2 = List::create( x, y ) ;
return z2 ;
}
edd at max:/tmp/davor/myPackage$ R CMD check .
* using log directory ?/tmp/davor/myPackage/..Rcheck?
* using R version 3.0.2 (2013-09-25)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ?./DESCRIPTION? ... OK
* checking extension type ... Package
* this is package ?myPackage? version ?1.0?
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
..Rcheck
These were most likely included in error. See section ?Package structure? in the ?Writing R Extensions? manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ?myPackage? can be installed ... WARNING
Found the following significant warnings:
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:31: All text must be in a section
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:32: All text must be in a section
See ?/tmp/davor/myPackage/..Rcheck/00install.out? for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
What Licence is it under ?
Standardizable: FALSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... WARNING
Found the following directory with the name of a check directory:
./..Rcheck
Most likely, these were included erroneously.
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... WARNING
prepare_Rd: myPackage-package.Rd:31: All text must be in a section
prepare_Rd: myPackage-package.Rd:32: All text must be in a section
prepare_Rd: myPackage-package.Rd:38-40: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... WARNING
Unknown package ?<pkg>? in Rd xrefs
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'rcpp_hello_world':
rcpp_hello_world
Code: function(z)
Docs: function()
Argument names in code not in docs:
z
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK
WARNING: There were 6 warnings.
NOTE: There was 1 note.
See
?/tmp/davor/myPackage/..Rcheck/00check.log?
for details.
edd at max:/tmp/davor/myPackage$
Hope this help, Dirk
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
On Jan 17, 2014, at 4:18 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
| What do you mean by this? Like I said, I changed the .cpp file and re-run
| compileAttributes. What I uploaded is the result afterwards.
The equivalent of
$ cd myPackage; R -e 'Rcpp::compileAttributes(".?)'
That?s what I meant when I said: ?I re-run compileAttributes?.
| I fixed it and rerun compileAttributes. Still the same problem. New version of the package is attached. See here, based on your previous file.
Dirk, I think we?re talking past each other. Can you please try the following steps exactly: 1. untag the myPackage-0.1-1.tar.gz that I attached in my previous message 2. cd myPackage 3. rm src/RcppExport.c R/RcppExport.c 4. Rscript -e ?Rcpp::compileAttributes()? 5. check whether duplicate definitions of ?rcpp_hello_world? appear in the generated RcppExport files. I get what?s in the attached 0.1-1 tar file: one copy of rcpp_hello_world with no parameters and one with a single parameter ?foo?. Davor
edd at max:/tmp/davor/myPackage$ cat src/rcpp_hello_world.cpp
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List rcpp_hello_world(NumericVector z) {
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z2 = List::create( x, y ) ;
return z2 ;
}
edd at max:/tmp/davor/myPackage$ R CMD check .
* using log directory ?/tmp/davor/myPackage/..Rcheck?
* using R version 3.0.2 (2013-09-25)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ?./DESCRIPTION? ... OK
* checking extension type ... Package
* this is package ?myPackage? version ?1.0?
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
..Rcheck
These were most likely included in error. See section ?Package structure? in the ?Writing R Extensions? manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ?myPackage? can be installed ... WARNING
Found the following significant warnings:
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:31: All text must be in a section
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:32: All text must be in a section
See ?/tmp/davor/myPackage/..Rcheck/00install.out? for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
What Licence is it under ?
Standardizable: FALSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... WARNING
Found the following directory with the name of a check directory:
./..Rcheck
Most likely, these were included erroneously.
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... WARNING
prepare_Rd: myPackage-package.Rd:31: All text must be in a section
prepare_Rd: myPackage-package.Rd:32: All text must be in a section
prepare_Rd: myPackage-package.Rd:38-40: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... WARNING
Unknown package ?<pkg>? in Rd xrefs
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'rcpp_hello_world':
rcpp_hello_world
Code: function(z)
Docs: function()
Argument names in code not in docs:
z
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK
WARNING: There were 6 warnings.
NOTE: There was 1 note.
See
?/tmp/davor/myPackage/..Rcheck/00check.log?
for details.
edd at max:/tmp/davor/myPackage$
Hope this help, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
Running compileAttributes with ?verbose = TRUE? was very informative:
$ Rscript -e 'Rcpp::compileAttributes(".", TRUE)'
Exports from /Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp:
List rcpp_hello_world(NumericVector foo)
Exports from /Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp~:
List rcpp_hello_world()
Answer: compileAttributes interprets Emacs backup files with extension ?.cpp~? as source files. (My fault for not zipping up the actual source directory but the product of "R CMD build".)
Probable source of the error is in compileAttributes (Attributes.R:355):
cppFiles <- list.files(srcDir, pattern = glob2rx("*.c*?))
You need a better way to identify C++ sources. R-exts manual says R?s make rules use .cc and .cpp for C++. (This is supposed to be recorded in R_HOME/etcR_ARCH/Makeconf, so it could potentially be processed dynamically, although I doubt that?s really necessary.)
Davor
On Jan 17, 2014, at 4:18 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
On 17 January 2014 at 15:32, Davor Cubranic wrote:
| On 2014-01-17, at 2:55 PM, Dirk Eddelbuettel wrote:
|
| > You had two mistakes here:
| >
| > i) after you alter an interface to be used by Rcpp Attributes, you must
| > re-run the compileAttributes() function to update the files. See the
| > vignette for details.
|
| What do you mean by this? Like I said, I changed the .cpp file and re-run
| compileAttributes. What I uploaded is the result afterwards.
The equivalent of
$ cd myPackage; R -e 'Rcpp::compileAttributes(".")'
For once, I launched R and typed it by hand.
| > (And if you use RStudio, this is done automagically)
|
| So it is by devtools, on one of the functions I regularly use in my workflow, perhaps "test". If it wasn't, it would be such a pain.
|
| > ii) Your C++ function did not work as the 'List z = ...' parameter
| > shadowed an already declared parameter from the function interface.
| > Renaming to zz or z2 works, of course.
|
| I fixed it and rerun compileAttributes. Still the same problem. New version of the package is attached.
See here, based on your previous file.
edd at max:/tmp/davor/myPackage$ cat src/rcpp_hello_world.cpp
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List rcpp_hello_world(NumericVector z) {
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z2 = List::create( x, y ) ;
return z2 ;
}
edd at max:/tmp/davor/myPackage$ R CMD check .
* using log directory ?/tmp/davor/myPackage/..Rcheck?
* using R version 3.0.2 (2013-09-25)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ?./DESCRIPTION? ... OK
* checking extension type ... Package
* this is package ?myPackage? version ?1.0?
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
..Rcheck
These were most likely included in error. See section ?Package structure? in the ?Writing R Extensions? manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ?myPackage? can be installed ... WARNING
Found the following significant warnings:
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:31: All text must be in a section
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:32: All text must be in a section
See ?/tmp/davor/myPackage/..Rcheck/00install.out? for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
What Licence is it under ?
Standardizable: FALSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... WARNING
Found the following directory with the name of a check directory:
./..Rcheck
Most likely, these were included erroneously.
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... WARNING
prepare_Rd: myPackage-package.Rd:31: All text must be in a section
prepare_Rd: myPackage-package.Rd:32: All text must be in a section
prepare_Rd: myPackage-package.Rd:38-40: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... WARNING
Unknown package ?<pkg>? in Rd xrefs
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'rcpp_hello_world':
rcpp_hello_world
Code: function(z)
Docs: function()
Argument names in code not in docs:
z
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK
WARNING: There were 6 warnings.
NOTE: There was 1 note.
See
?/tmp/davor/myPackage/..Rcheck/00check.log?
for details.
edd at max:/tmp/davor/myPackage$
Hope this help, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140117/89f8fe4a/attachment-0001.html>
Le 18 janv. 2014 ? 06:10, Davor Cubranic <cubranic at stat.ubc.ca> a ?crit :
Running compileAttributes with ?verbose = TRUE? was very informative:
$ Rscript -e 'Rcpp::compileAttributes(".", TRUE)'
Exports from /Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp:
List rcpp_hello_world(NumericVector foo)
Exports from /Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp~:
List rcpp_hello_world()
Answer: compileAttributes interprets Emacs backup files with extension ?.cpp~? as source files. (My fault for not zipping up the actual source directory but the product of "R CMD build".)
Probable source of the error is in compileAttributes (Attributes.R:355):
cppFiles <- list.files(srcDir, pattern = glob2rx("*.c*?))
Hi, This has bitten me too in various training I gave about Rcp. I guess [.]c(c|pp)$ would make a better pattern. WRE says (if you read between the lines) that c++ files are .cpp or .cc So this is a bug. Romain
You need a better way to identify C++ sources. R-exts manual says R?s make rules use .cc and .cpp for C++. (This is supposed to be recorded in R_HOME/etcR_ARCH/Makeconf, so it could potentially be processed dynamically, although I doubt that?s really necessary.) Davor On Jan 17, 2014, at 4:18 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
On 17 January 2014 at 15:32, Davor Cubranic wrote:
| On 2014-01-17, at 2:55 PM, Dirk Eddelbuettel wrote:
|
| > You had two mistakes here:
| >
| > i) after you alter an interface to be used by Rcpp Attributes, you must
| > re-run the compileAttributes() function to update the files. See the
| > vignette for details.
|
| What do you mean by this? Like I said, I changed the .cpp file and re-run
| compileAttributes. What I uploaded is the result afterwards.
The equivalent of
$ cd myPackage; R -e 'Rcpp::compileAttributes(".")'
For once, I launched R and typed it by hand.
| > (And if you use RStudio, this is done automagically)
|
| So it is by devtools, on one of the functions I regularly use in my workflow, perhaps "test". If it wasn't, it would be such a pain.
|
| > ii) Your C++ function did not work as the 'List z = ...' parameter
| > shadowed an already declared parameter from the function interface.
| > Renaming to zz or z2 works, of course.
|
| I fixed it and rerun compileAttributes. Still the same problem. New version of the package is attached.
See here, based on your previous file.
edd at max:/tmp/davor/myPackage$ cat src/rcpp_hello_world.cpp
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List rcpp_hello_world(NumericVector z) {
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z2 = List::create( x, y ) ;
return z2 ;
}
edd at max:/tmp/davor/myPackage$ R CMD check .
* using log directory ?/tmp/davor/myPackage/..Rcheck?
* using R version 3.0.2 (2013-09-25)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ?./DESCRIPTION? ... OK
* checking extension type ... Package
* this is package ?myPackage? version ?1.0?
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
..Rcheck
These were most likely included in error. See section ?Package structure? in the ?Writing R Extensions? manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ?myPackage? can be installed ... WARNING
Found the following significant warnings:
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:31: All text must be in a section
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:32: All text must be in a section
See ?/tmp/davor/myPackage/..Rcheck/00install.out? for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
What Licence is it under ?
Standardizable: FALSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... WARNING
Found the following directory with the name of a check directory:
./..Rcheck
Most likely, these were included erroneously.
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... WARNING
prepare_Rd: myPackage-package.Rd:31: All text must be in a section
prepare_Rd: myPackage-package.Rd:32: All text must be in a section
prepare_Rd: myPackage-package.Rd:38-40: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... WARNING
Unknown package ?<pkg>? in Rd xrefs
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'rcpp_hello_world':
rcpp_hello_world
Code: function(z)
Docs: function()
Argument names in code not in docs:
z
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK
WARNING: There were 6 warnings.
NOTE: There was 1 note.
See
?/tmp/davor/myPackage/..Rcheck/00check.log?
for details.
edd at max:/tmp/davor/myPackage$
Hope this help, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
_______________________________________________ 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
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140118/8cc53542/attachment.html>
Thanks for the report and sorry it took so long to get the the bottom of it (I had also tried reproing to no avail). This is now fixed with https://github.com/RcppCore/Rcpp/commit/d366984e6aabc426bae7f827b9fabc69df8d707b. J.J. On Sat, Jan 18, 2014 at 6:41 AM, Romain Francois
<romain at r-enthusiasts.com> wrote:
Le 18 janv. 2014 ? 06:10, Davor Cubranic <cubranic at stat.ubc.ca> a ?crit :
Running compileAttributes with ?verbose = TRUE? was very informative:
$ Rscript -e 'Rcpp::compileAttributes(".", TRUE)'
Exports from /Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp:
List rcpp_hello_world(NumericVector foo)
Exports from
/Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp~:
List rcpp_hello_world()
Answer: compileAttributes interprets Emacs backup files with extension
?.cpp~? as source files. (My fault for not zipping up the actual source
directory but the product of "R CMD build".)
Probable source of the error is in compileAttributes (Attributes.R:355):
cppFiles <- list.files(srcDir, pattern = glob2rx("*.c*?))
Hi,
This has bitten me too in various training I gave about Rcp. I guess
[.]c(c|pp)$ would make a better pattern.
WRE says (if you read between the lines) that c++ files are .cpp or .cc
So this is a bug.
Romain
You need a better way to identify C++ sources. R-exts manual says R?s make
rules use .cc and .cpp for C++. (This is supposed to be recorded in
R_HOME/etcR_ARCH/Makeconf, so it could potentially be processed dynamically,
although I doubt that?s really necessary.)
Davor
On Jan 17, 2014, at 4:18 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
On 17 January 2014 at 15:32, Davor Cubranic wrote:
| On 2014-01-17, at 2:55 PM, Dirk Eddelbuettel wrote:
|
| > You had two mistakes here:
| >
| > i) after you alter an interface to be used by Rcpp Attributes, you
must
| > re-run the compileAttributes() function to update the files. See
the
| > vignette for details.
|
| What do you mean by this? Like I said, I changed the .cpp file and re-run
| compileAttributes. What I uploaded is the result afterwards.
The equivalent of
$ cd myPackage; R -e 'Rcpp::compileAttributes(".")'
For once, I launched R and typed it by hand.
| > (And if you use RStudio, this is done automagically)
|
| So it is by devtools, on one of the functions I regularly use in my
workflow, perhaps "test". If it wasn't, it would be such a pain.
|
| > ii) Your C++ function did not work as the 'List z = ...' parameter
| > shadowed an already declared parameter from the function
interface.
| > Renaming to zz or z2 works, of course.
|
| I fixed it and rerun compileAttributes. Still the same problem. New
version of the package is attached.
See here, based on your previous file.
edd at max:/tmp/davor/myPackage$ cat src/rcpp_hello_world.cpp
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List rcpp_hello_world(NumericVector z) {
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z2 = List::create( x, y ) ;
return z2 ;
}
edd at max:/tmp/davor/myPackage$ R CMD check .
* using log directory ?/tmp/davor/myPackage/..Rcheck?
* using R version 3.0.2 (2013-09-25)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ?./DESCRIPTION? ... OK
* checking extension type ... Package
* this is package ?myPackage? version ?1.0?
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
..Rcheck
These were most likely included in error. See section ?Package structure? in
the ?Writing R Extensions? manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ?myPackage? can be installed ... WARNING
Found the following significant warnings:
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:31: All text must be
in a section
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:32: All text must be
in a section
See ?/tmp/davor/myPackage/..Rcheck/00install.out? for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
What Licence is it under ?
Standardizable: FALSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... WARNING
Found the following directory with the name of a check directory:
./..Rcheck
Most likely, these were included erroneously.
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ...
OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... WARNING
prepare_Rd: myPackage-package.Rd:31: All text must be in a section
prepare_Rd: myPackage-package.Rd:32: All text must be in a section
prepare_Rd: myPackage-package.Rd:38-40: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... WARNING
Unknown package ?<pkg>? in Rd xrefs
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'rcpp_hello_world':
rcpp_hello_world
Code: function(z)
Docs: function()
Argument names in code not in docs:
z
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK
WARNING: There were 6 warnings.
NOTE: There was 1 note.
See
?/tmp/davor/myPackage/..Rcheck/00check.log?
for details.
edd at max:/tmp/davor/myPackage$
Hope this help, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
_______________________________________________ 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 _______________________________________________ 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
Thanks! I forgot about the github repository ? hurray for no more R-Forge?s subversion browser? Should bug reports and requests now be filed as Github issues? Davor
On Jan 18, 2014, at 4:07 AM, JJ Allaire <jj.allaire at gmail.com> wrote:
Thanks for the report and sorry it took so long to get the the bottom of it (I had also tried reproing to no avail). This is now fixed with https://github.com/RcppCore/Rcpp/commit/d366984e6aabc426bae7f827b9fabc69df8d707b. J.J. On Sat, Jan 18, 2014 at 6:41 AM, Romain Francois <romain at r-enthusiasts.com> wrote:
Le 18 janv. 2014 ? 06:10, Davor Cubranic <cubranic at stat.ubc.ca> a ?crit :
Running compileAttributes with ?verbose = TRUE? was very informative:
$ Rscript -e 'Rcpp::compileAttributes(".", TRUE)'
Exports from /Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp:
List rcpp_hello_world(NumericVector foo)
Exports from
/Users/davor/projects/Davor/myPackage/src/rcpp_hello_world.cpp~:
List rcpp_hello_world()
Answer: compileAttributes interprets Emacs backup files with extension
?.cpp~? as source files. (My fault for not zipping up the actual source
directory but the product of "R CMD build".)
Probable source of the error is in compileAttributes (Attributes.R:355):
cppFiles <- list.files(srcDir, pattern = glob2rx("*.c*?))
Hi,
This has bitten me too in various training I gave about Rcp. I guess
[.]c(c|pp)$ would make a better pattern.
WRE says (if you read between the lines) that c++ files are .cpp or .cc
So this is a bug.
Romain
You need a better way to identify C++ sources. R-exts manual says R?s make
rules use .cc and .cpp for C++. (This is supposed to be recorded in
R_HOME/etcR_ARCH/Makeconf, so it could potentially be processed dynamically,
although I doubt that?s really necessary.)
Davor
On Jan 17, 2014, at 4:18 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
On 17 January 2014 at 15:32, Davor Cubranic wrote:
| On 2014-01-17, at 2:55 PM, Dirk Eddelbuettel wrote:
|
| > You had two mistakes here:
| >
| > i) after you alter an interface to be used by Rcpp Attributes, you
must
| > re-run the compileAttributes() function to update the files. See
the
| > vignette for details.
|
| What do you mean by this? Like I said, I changed the .cpp file and re-run
| compileAttributes. What I uploaded is the result afterwards.
The equivalent of
$ cd myPackage; R -e 'Rcpp::compileAttributes(".")'
For once, I launched R and typed it by hand.
| > (And if you use RStudio, this is done automagically)
|
| So it is by devtools, on one of the functions I regularly use in my
workflow, perhaps "test". If it wasn't, it would be such a pain.
|
| > ii) Your C++ function did not work as the 'List z = ...' parameter
| > shadowed an already declared parameter from the function
interface.
| > Renaming to zz or z2 works, of course.
|
| I fixed it and rerun compileAttributes. Still the same problem. New
version of the package is attached.
See here, based on your previous file.
edd at max:/tmp/davor/myPackage$ cat src/rcpp_hello_world.cpp
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List rcpp_hello_world(NumericVector z) {
CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
List z2 = List::create( x, y ) ;
return z2 ;
}
edd at max:/tmp/davor/myPackage$ R CMD check .
* using log directory ?/tmp/davor/myPackage/..Rcheck?
* using R version 3.0.2 (2013-09-25)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ?./DESCRIPTION? ... OK
* checking extension type ... Package
* this is package ?myPackage? version ?1.0?
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
..Rcheck
These were most likely included in error. See section ?Package structure? in
the ?Writing R Extensions? manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ?myPackage? can be installed ... WARNING
Found the following significant warnings:
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:31: All text must be
in a section
Warning: /tmp/davor/myPackage/man/myPackage-package.Rd:32: All text must be
in a section
See ?/tmp/davor/myPackage/..Rcheck/00install.out? for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... WARNING
Non-standard license specification:
What Licence is it under ?
Standardizable: FALSE
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... WARNING
Found the following directory with the name of a check directory:
./..Rcheck
Most likely, these were included erroneously.
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ...
OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... WARNING
prepare_Rd: myPackage-package.Rd:31: All text must be in a section
prepare_Rd: myPackage-package.Rd:32: All text must be in a section
prepare_Rd: myPackage-package.Rd:38-40: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... WARNING
Unknown package ?<pkg>? in Rd xrefs
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object 'rcpp_hello_world':
rcpp_hello_world
Code: function(z)
Docs: function()
Argument names in code not in docs:
z
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK
WARNING: There were 6 warnings.
NOTE: There was 1 note.
See
?/tmp/davor/myPackage/..Rcheck/00check.log?
for details.
edd at max:/tmp/davor/myPackage$
Hope this help, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
_______________________________________________ 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 _______________________________________________ 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
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140118/ba400a63/attachment.html>
On 18 January 2014 at 16:19, Davor Cubranic wrote:
| Thanks! | | I forgot about the github repository ? hurray for no more R-Forge?s | subversion browser? | | Should bug reports and requests now be filed as Github issues? Whatever works, and I leave that up to you. I still think that the list here gets more eyeballs. But if you have something more narrow, or already have a Pull Request ready and tested (hint, hint) then by all means post on Github. Dirk
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com