[Rcpp-devel] Header-only version of Rcpp provides a couple of gotcha's in RcppEigen

Romain Francois romain at r-enthusiasts.com
Thu Nov 14 23:20:38 CET 2013


It should be better now. My intuition about trunc was correct. Fixed in 
Rcpp (marked as 0.10.6.2).

I've also updated functions so that they use attributes rather than old 
school extern "C" SEXP(SEXP,SEXP,...) interfaces;

More details here:
https://github.com/RcppCore/RcppEigen/pull/2

Le 14/11/2013 21:34, Douglas Bates a écrit :
> If I install the latest, header-only, git version of Rcpp (f117a70),
> which is a great achievement by the way,  installation of RcppEigen
> encounters a few minor problems.  One seems to be related to conflicting
> definitions of trunc in Rmath.h and in fstream
>
> In file included from fastLm.cpp:23:
> In file included from ./fastLm.h:25:
> In file included from ../inst/include/RcppEigen.h:25:
> In file included from ../inst/include/RcppEigenForward.h:39:
> In file included from ../inst/include/unsupported/Eigen/SparseExtra:22:
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/fstream:641:60:
> error: no member named 'Rf_ftrunc' in 'std::ios_base'
> In file included from                      ios_base::openmode __mode =
> ios_base::out|ios_base::trunc)
>                                                                 ~~~~~~~~~~^
> RcppEigen.cpp:22:
> In file included from ../inst/include/RcppEigen.h:25:
> /home/bates/build/R-devel/include/Rmath.h:In file included from
> ../inst/include/RcppEigenForward.h348::3915::
> In file included from  note:
> ../inst/include/unsupported/Eigen/SparseExtra:expanded 22:
> from
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/fstreammacro
> :641'trunc'
> :60: error: #define trunc   ftrunc
> no                 ^
> member /home/bates/build/R-devel/include/Rmath.hnamed :247'Rf_ftrunc'
> :17in : 'std::ios_base'
> note: expanded from macro 'ftrunc'
> #define ftrunc          Rf_ftrunc
>                          ^
>                       ios_base::openmode __mode =
> ios_base::out|ios_base::trunc)
>
> The other looks like I was playing a bit fast and loose with converting
> an attribute to a list
>
> make: *** Waiting for unfinished jobs....
> fastLm.cpp:217:20: error: call to constructor of 'List' (aka
> 'Vector<19>') is ambiguous
>              List          dimnames(NumericMatrix(Xs).attr("dimnames"));
>                            ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> There is one more problem, but I think that needs a namespace qualifier.
>
> fastLm.cpp:240:6: error: use of undeclared identifier
> 'forward_exception_to_r'; did you mean 'Rcpp::forward_exception_to_r'?
>              forward_exception_to_r( ex );
>              ^~~~~~~~~~~~~~~~~~~~~~
>              Rcpp::forward_exception_to_r
> /home/bates/R/x86_64-unknown-linux-gnu-library/3.1/Rcpp/include/Rcpp/exceptions.h:172:17:
> note: 'Rcpp::forward_exception_to_r' declared here
>      inline void forward_exception_to_r( const std::exception& ex){
>                  ^
>
> Do these all look like issues that I should address in RcppEigen?

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30



More information about the Rcpp-devel mailing list