Patrick McCarthy
Patrick McCarthy

Reputation: 2538

How to install with devtools and an alternate gcc?

I'm trying to install feather from github using

library(devtools);install_github('wesm/feather/R')

But I get the error referenced in this issue, that I need to update my gcc. I'm using Centos 6.7 and the default make tools are old, but I installed devtoolset-2 which gave me gcc and g++ 4.8, which I symlinked into my /usr/bin directory.

$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)

$ gcc-4.8 --version
gcc-4.8 (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)

$ g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)

$ g++-4.8 --version
g++-4.8 (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)

I added these options into my ~/.R/Makevars:

$ cat ~/.R/Makevars 
CC=gcc-4.8
CXX=g++-4.8
CXX_STD=CXX11
CXX1XSTD=-Dstd=c++11

But when I try to install my package it fails because it tries to link in from the wrong includes:

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/cpp_type_traits.h:76: error: expected ‘{’ before ‘++’ token

What do I need to do to configure install_github properly?

Upvotes: 1

Views: 1876

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368231

You also need to set the CXX-equivalent for C++11 compilation:

 CXX1X=g++-4.8

That should do it. If in doubt, compare with R's own Makeconf.

Oh, and you probably do not need CXX1XSTD as the value in CXX_STD imposes it.

Upvotes: 3

Related Questions