[Rd] R 3.1.0 and C++11

Romain François romain at r-enthusiasts.com
Thu Apr 10 18:04:39 CEST 2014


Le 10 avr. 2014 à 17:58, Martyn Plummer <plummerM at iarc.fr> a écrit :

> On Thu, 2014-04-10 at 11:14 -0400, Gabor Grothendieck wrote:
>> On Tue, Oct 29, 2013 at 1:58 AM,  <romain at r-enthusiasts.com> wrote:
>>> Le 2013-10-29 03:01, Whit Armstrong a écrit :
>>> 
>>>> I would love to see optional c++0x support added for R.
>>> 
>>> 
>>> c++0x was the name given for when this was in development. Now c++11 is a
>>> published standard backed by implementations by major compilers.
>>> people need to stop calling it c++0x
>>> 
>>> 
>>>> If there is anything I can do to help, please let me know.
>>> 
>>> 
>>> Come here https://github.com/romainfrancois/cpp11_article where I'm writing
>>> an article on C++11 and what would be the benefits.
>>> 
>> 
>> Unless you are willing to do it yourself currently Rtools on Windows uses
>> g++ 4.6.3 and that requires that one specify -std=c++0x or -std=gnu++0x .
>> 
>> Ubuntu 12.04 LTS also provides g++ 4.6.3.
>> 
>> g++ 4.7 is the first version of g++ that accepts -std=c++11 or -std=gnu++11
>> 
>> More info at:
>> http://gcc.gnu.org/projects/cxx0x.html
> 
> The R configure script is permissive and will enable "C++11" support if
> your compiler accepts -std=c++0x. Obviously you will only get partial
> support for the C++11 standard (But this is also true of some compilers
> that accept -std=c++11). You may be OK if you just want C99 features,
> which were missing from the C++98 standard, and features previously
> introduced in the TR1 extension. But there are no guarantees.
> 
> Cross-platform support for C++11 is going to remain poor for some time
> to come, I'm afraid.
> 
> Martyn

What would be a good enough motivation for distributing a version of Rtools based on a more recent gcc, e.g. in the 4.8 series, which has much better coverage of the standard. 

I don’t have the skills to build an Rtools distribution, but if I can help one way or another, please let me know. I could, perhaps with other interested parties sponsor someone’s time for example. 

Romain


More information about the R-devel mailing list