【问题标题】:Error installing r packages (Linux Mint 17.1) "error: C preprocessor "g++ -E" fails sanity check"安装 r 包时出错(Linux Mint 17.1)“错误:C 预处理器“g++ -E”未通过完整性检查”
【发布时间】:2015-09-26 17:40:57
【问题描述】:

我已转移到 Linux 系统(以前的 OSX 用户),我正在尝试安装我的 R 包。

我遇到的第一个问题是:

Warning in install.packages("stringi") :
  'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead?  (y/n)

但我通过使用以下方式启动 R 解决了这个问题:

$ sudo R

如果有人对使用“sudo”有更永久的解决方案(因为我将来会使用 RStudio),我很想知道!

但是现在,我遇到了一个我找不到解决方案的问题。当我尝试安装“stringi”时,我得到以下信息:

* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /usr/lib/R
checking for R... /usr/lib/R/bin/R
checking for R >= 3.1.0... yes
checking for cat... /bin/cat
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... g++ -E
configure: error: in `/tmp/Rtmplf58Ya/R.INSTALL2d1959f5fc41/stringi':
configure: error: C preprocessor "g++ -E" fails sanity check
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/usr/local/lib/R/site-library/stringi’

行是什么:

configure: error: C preprocessor "g++ -E" fails sanity check

参考?我相当确定我的 C 编译器基于这一行工作:

checking whether the C compiler works... yes

还有这一行:

checking whether we are using the GNU C compiler... yes

但就像我说的,我现在才开始深入研究 Linux 系统的内部工作原理,所以我可能完全错了。

非常感谢任何和所有的帮助!

编辑:我使用的是 Linux Mint 17.1 (MATE) 和 R 版本 3.2.1

【问题讨论】:

    标签: c linux r gcc g++


    【解决方案1】:

    尝试安装 g++: sudo apt-get install g++

    可以安装 GNU C 编译器 (GCC),但并不总是默认安装 g++。

    至于必须sudo 进入 R Studio,这相当于在 OS X 中安装程序时必须输入密码 - 这只是 Linux 系统的小复杂性之一(顺便说一下,OS X 基于BSD Linux)。我想您在不安装软件包时不一定需要使用sudo(不确定,说实话还没有真正使用过 R Studio)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-06
      • 1970-01-01
      • 2018-02-02
      相关资源
      最近更新 更多