【发布时间】:2018-05-24 14:24:26
【问题描述】:
我正在尝试在 Linux 服务器中安装 R 包“igraph”,但遇到了一些错误。
我试过install.packages("igraph"),得到了这些错误信息:
-
与
checking whether the C compiler works... no相关的问题:* installing *source* package ‘igraph’ ... ** package ‘igraph’ successfully unpacked and MD5 sums checked checking for gcc... /usr/local/bin/gcc checking whether the C compiler works... no configure: error: in `/tmp/RtmpPaaksz/R.INSTALL8c157a39a973/igraph': configure: error: C compiler cannot create executables See `config.log' for more details ERROR: configuration failed for package ‘igraph’ -
与
lazyeval.c:53: error: ‘for’ loop initial declarations are only allowed in C99 mode相关的问题:lazyeval.c: In function ‘make_lazy_dots’: lazyeval.c:53: error: ‘for’ loop initial declarations are only allowed in C99 mode lazyeval.c:53: note: use option -std=c99 or -std=gnu99 to compile your code lazyeval.c:63: error: redefinition of ‘nxt’ lazyeval.c:53: note: previous definition of ‘nxt’ was here make: *** [lazyeval.o] Error 1 ERROR: compilation failed for package ‘igraph’
我的环境是
- Linux
- R 3.4.3
谁能给我一个宝贵的建议?
由于我的问题的一致性,我关闭了这篇文章,但我仍然无法安装该软件包。谢谢大家!
【问题讨论】:
-
你能找到
config.log并上传吗? -
你运行的是什么操作系统?你是如何安装 R 的?你跑过
apt-get build-essential之类的东西吗?这应该包括一个编译器。 -
@SeGa 试图找到它,@MrFlick 我在帖子中添加了我的信息。
apt-get build-essential给了我这个-bash: apt-get: command not found。 -
谢谢,@G5W。我有点挣扎,并试图更改我的 ~/.R/Makevars 文件,它解决了
checking whether the C compiler works。但是,我更新的新错误来了。