如何使用devtools和备用gcc进行安装? [英] How to install with devtools and an alternate gcc?

查看:136
本文介绍了如何使用devtools和备用gcc进行安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用

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

但是我得到引用在此问题中,我需要更新我的gcc。我使用的是Centos 6.7,默认的制作工具很旧,但是我安装了 devtoolset-2 给了我gcc和g ++ 4.8,我将它们链接到我的/ usr / bin目录中。

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)

我在我的〜/ .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

之前需要'{'如何正确配置 install_github

What do I need to do to configure install_github properly?

推荐答案

Y您还需要为C ++ 11编译设置等效的CXX:

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

 CXX1X=g++-4.8

应该这样做。如有疑问,请与R自己的 Makeconf 进行比较。

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

哦,您可能不需要 CXX1XSTD 作为 CXX_STD 中的值强加它。

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

这篇关于如何使用devtools和备用gcc进行安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆