[Rcpp-devel] trying installing RcppCNPy with -std=c++11 (or c++0x) and failed due to incompatible number of arguments

Dirk Eddelbuettel edd at debian.org
Wed Feb 20 02:15:00 CET 2013


On 19 February 2013 at 11:47, Gong-Yi Liao wrote:
| Dear list,
| 
| I tried to load integer data from a Python .npy file by using RcppCNPy, 
| while I tried to install RcppCNPy, I got the following error messages:
| -----------------------------------------
| R> install.packages('RcppCNPy')
| Installing package(s) into ‘/usr/local/lib/R/site-library’
| (as ‘lib’ is unspecified)
| trying URL 'http://ftp.ussg.iu.edu/CRAN/src/contrib/RcppCNPy_0.2.0.tar.gz'
| Content type 'application/x-gzip' length 224174 bytes (218 Kb)
| opened URL
| ==================================================
| downloaded 218 Kb
| 
| * installing *source* package ‘RcppCNPy’ ...
| ** package ‘RcppCNPy’ successfully unpacked and MD5 sums checked
| ** libs
| g++ -I/usr/share/R/include -DNDEBUG 
| -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -std=c++11 -O2 
| -pipe -g -c cnpy.cpp -o cnpy.o
| In file included from 
| /usr/include/c++/4.7/bits/locale_facets_nonio.h:1901:0,
| from /usr/include/c++/4.7/locale:43,
| from /usr/include/c++/4.7/iomanip:45,
| from cnpy.cpp:10:
| /usr/include/c++/4.7/bits/codecvt.h:216:45: error: macro "length" passed 
| 4 arguments, but takes just 1
| /usr/include/c++/4.7/bits/codecvt.h:215:7: error: expected ‘;’ at end of 
| member declaration
| /usr/include/c++/4.7/bits/codecvt.h:217:7: error: expected 
| unqualified-id before ‘{’ token
| make: *** [cnpy.o] Error 1
| ERROR: compilation failed for package ‘RcppCNPy’
| * removing ‘/usr/local/lib/R/site-library/RcppCNPy’
| * restoring previous ‘/usr/local/lib/R/site-library/RcppCNPy’

Good news, got to look at this on train commute home. It is plainly my
error. And a fix (of just adding #define R_NO_REMAP before #include'ing
Rinternals.h) will be forthcoming.  The "length" gave it away.

You can also simply not #include<iomanip> and the error is also avoided.

I'll commit a fix in a bit.

Dirk

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


More information about the Rcpp-devel mailing list