我试图安装R包" igraph"在Linux服务器上并遇到一些错误。
我已尝试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’
我的环境是
有人会给我一些宝贵的建议吗?
由于我的问题的一致性,我关闭了这篇文章,尽管我仍然无法安装该软件包。谢谢大家!
答案 0 :(得分:1)
我通过将〜/ .R / Makevars文件更改为
来处理两个问题C=gcc-5
CXX=g++
CXX1X = g++-5
CFLAGS = -std=c99 -Wall -pedantic
前三行是问题1,最后一行是2。