[Rcpp-devel] Bug with table sugar and NumericVector in Rcpp 0.10.3

Dirk Eddelbuettel edd at debian.org
Fri Mar 29 15:40:32 CET 2013


On 29 March 2013 at 15:24, romain at r-enthusiasts.com wrote:
| Le 2013-03-29 14:31, Dirk Eddelbuettel a écrit :
| > On 29 March 2013 at 09:11, romain at r-enthusiasts.com wrote:
| > |
| > | Hello,
| > |
| > | This is related to this change:
| > |
| > | 2013-01-15  Dirk Eddelbuettel  <edd at debian.org>
| > |
| > | 	* src/api.cpp (Rcpp): Commented-out coerce_to_string() for real 
| > and
| > | 	complex arguments as R-devel (as of today) dislikes use of non-API
| > | 	functions Rf_EncodeComplex’, ‘Rf_EncodeReal’, ‘Rf_formatComplex’
| > |
| > | So maybe Dirk has a plan to fix it.
| >
| > I do not.
| 
| Fine. So I'll fix it.

Hold on. 

I am in the middle of it. I do have a poor replacementment for EncodeReal,
and am about to test one for complex. Will post soon.

Am not covering scientific notation at this point.

Dirk

 
| > I had a choice to make between
| >
| >   a) keeping Rcpp on CRAN
| >
| >   b) keeping that feature.
| >
| > I chose a).
| >
| > If someone needs b), patches are always welcome.  It should not be 
| > hard to
| > support conversion to character.
| >
| > It wasn't the first time, and likely not the last time, that I had to 
| > curtail
| > code of yours to make a release possible.  Such is life.
| >
| > You write a lot of great code, but some violates some CRAN guidelines
| > (which unfortunately change over time) and some break other things. 
| > So
| > sometimes we do need to revert.
| >
| > Dirk
| >
| > | Romain
| > |
| > | Le 2013-03-29 07:27, Kevin Ushey a écrit :
| > | > Hi guys,
| > | >
| > | > When I attempt to 'sourceCpp' the following code, the R session
| > | > crashes:
| > | >
| > | > #include <Rcpp.h>
| > | > using namespace Rcpp;
| > | >
| > | > // [[Rcpp::export]]
| > | > IntegerVector counts(NumericVector x) {
| > | >   return table(x);
| > | > }
| > | >
| > | > The same code worked in Rcpp 0.10.2.
| > | >
| > | > A hint to the error comes if I try to compile a package with that
| > | > source code in a .cpp file: I get the error, when attempting to 
| > load
| > | > the package:
| > | >
| > | >
| > 
| > dlopen(/Library/Frameworks/R.framework/Versions/2.15/Resources/library/anRpackage/libs/x86_64/anRpackage.so,
| > | > 6): Symbol not found:
| > | >
| > | >
| > 
| > __ZN4Rcpp8internal16coerce_to_stringILi14EEEPKcNS_6traits12storage_typeIXT_EE4typeE
| > | >    Referenced from:
| > | >
| > | >
| > 
| > /Library/Frameworks/R.framework/Versions/2.15/Resources/library/anRpackage/libs/x86_64/anRpackage.so
| > | >   Expected in: flat namespace
| > | >  in
| > | >
| > | >
| > 
| > /Library/Frameworks/R.framework/Versions/2.15/Resources/library/anRpackage/libs/x86_64/anRpackage.so
| > | >
| > | > This is with R 2.15.3 on Mac OSX 10.8.3.
| > | >
| > | > -----
| > | >
| > | > In addition, if I attempt to compile Rcpp from source (with gcc 
| > 4.8)
| > | > I
| > | > get the following warnings:
| > | >
| > | >> install.packages("Rcpp", type="source",
| > | > INSTALL_opts="--no-multiarch")
| > | > Installing package(s) into
| > | > ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library’
| > | > (as ‘lib’ is unspecified)
| > | > trying URL 
| > 'http://cran.rstudio.com/src/contrib/Rcpp_0.10.3.tar.gz
| > | > [1]'
| > | > Content type 'application/x-gzip' length 2395986 bytes (2.3 Mb)
| > | > opened URL
| > | > ==================================================
| > | > downloaded 2.3 Mb
| > | >
| > | > * installing *source* package ‘Rcpp’ ...
| > | > ** package ‘Rcpp’ successfully unpacked and MD5 sums checked
| > | > ** libs
| > | > *** arch - x86_64
| > | > g++ -arch x86_64 
| > -I/Library/Frameworks/R.framework/Resources/include
| > | > -I/Library/Frameworks/R.framework/Resources/include/x86_64 
| > -DNDEBUG
| > | > -I../inst/include/ -I/usr/local/include    -fPIC  -g -O3 -Wall
| > | > -pedantic -c Date.cpp -o Date.o
| > | > g++ -arch x86_64 
| > -I/Library/Frameworks/R.framework/Resources/include
| > | > -I/Library/Frameworks/R.framework/Resources/include/x86_64 
| > -DNDEBUG
| > | > -I../inst/include/ -I/usr/local/include    -fPIC  -g -O3 -Wall
| > | > -pedantic -c Module.cpp -o Module.o
| > | > In file included from ../inst/include/Rcpp/Module.h:352:0,
| > | >                  from ../inst/include/Rcpp.h:63,
| > | >                  from Module.cpp:22:
| > | > ../inst/include/Rcpp/module/class.h: In member function
| > | > ‘Rcpp::class_<Class>::self& Rcpp::class_<Class>::derives(const
| > | > char*)’:
| > | > ../inst/include/Rcpp/module/class.h:495:56: warning: typedef
| > | > ‘parent_prop_class’ locally defined but not used
| > | > [-Wunused-local-typedefs]
| > | >              typedef typename parent_class_::prop_class
| > | > parent_prop_class ;
| > | > <snip, snip>
| > | >
| > | > although the package does install successfully. Not sure if it's
| > | > related or not.
| > | >
| > | > Thanks,
| > | > -Kevin
| > | >
| > | > Links:
| > | > ------
| > | > [1] http://cran.rstudio.com/src/contrib/Rcpp_0.10.3.tar.gz
| > |
| > | _______________________________________________
| > | 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
| 

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list