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

Douglas Bates bates at stat.wisc.edu
Thu Nov 14 21:34:02 CET 2013


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20131114/c9621a22/attachment.html>


More information about the Rcpp-devel mailing list