Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Rtools 3.1 support C++11 on Windows

Tags:

r

rcpp

The latest version of Rtools (3.1) does not appear to include a version of g++ that supports C++11. Is there any particular reason for this?

like image 442
Dave Avatar asked Apr 12 '14 20:04

Dave


2 Answers

Precious volunteer time, maybe?

Rtools uses g++ 4.6.2. Which is totally fine for the use by R as R is a C program.

Now, many of us use C++ along with R (and judging from the Rcpp tag, you do too), and it does indeed pose a problem if you want to use features available only in g++ 4.7, 4.8, the AFAIK not-yet released 4.9, or an equivalent clang version --- and when you are in fact restricted to Windows.

On Linux or OS X, things are a little easier (though OS X had its own share of issue after the 10.9 release but it is getting better).

Someone needs to volunteer to provide a better / newer MinGW, or to pay someone to provide it. If you look at old release announcements, the Rtools compiler is not upgraded all that often. From what I can tell, there is only one R Core member working on this. And while that particular R Core member is very knowledgeable about C++ and and the state of the g++ compiler on Windows, he is also predominatly a C programmer...

like image 185
Dirk Eddelbuettel Avatar answered Oct 21 '22 00:10

Dirk Eddelbuettel


The compiler shipped with Rtools (gcc 4.6.3) is good enough to run the test suite of the devel version of Rcpp11, which uses features of C++11 quite extensively.

Details on unsupported features are available here, but the supported subset already feels like C++11. There were only a few things I had to compromise (delegated constructors and template aliases). They make code better, but we can live without them for now.

like image 20
Romain Francois Avatar answered Oct 21 '22 00:10

Romain Francois