安装软件包时出现错误:致命错误:没有找到文件或目录:stdlib.h

4

我刚刚设置好了我的Linux Mint系统,现在我想安装一个R包。我做了以下操作:

sudo apt-get install r-base

sudo R

在R中,我输入了(就像生物信息学主页上所指示的那样):
source("http://bioconductor.org/biocLite.R")

biocLite("GEOquery")

这是结果:
> source("http://bioconductor.org/biocLite.R")
Installing package into ‘/home/robert/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://www.bioconductor.org/packages/2.13/bioc/src/contrib/BiocInstaller_1.12.1.tar.gz'
Content type 'application/x-gzip' length 13520 bytes (13 Kb)
opened URL
==================================================
downloaded 13 Kb

* installing *source* package ‘BiocInstaller’ ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Bioconductor version 2.13 (BiocInstaller 1.12.1), ?biocLite for help
A newer version of Bioconductor is available after installing a new version of
  R, ?BiocUpgrade for help
* DONE (BiocInstaller)

The downloaded source packages are in
    ‘/tmp/RtmpDSnlDj/downloaded_packages’
Bioconductor version 2.13 (BiocInstaller 1.12.1), ?biocLite for help
A newer version of Bioconductor is available after installing a new version of
  R, ?BiocUpgrade for help
> biocLite("GEOquery")
BioC_mirror: http://bioconductor.org
Using Bioconductor version 2.13 (BiocInstaller 1.12.1), R version 3.0.2.
Installing package(s) 'GEOquery'
also installing the dependencies ‘BiocGenerics’, ‘bitops’, ‘Biobase’, ‘XML’, ‘RCurl’

trying URL 'http://bioconductor.org/packages/2.13/bioc/src/contrib/BiocGenerics_0.8.0.tar.gz'
Content type 'application/x-gzip' length 30969 bytes (30 Kb)
opened URL
==================================================
downloaded 30 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/bitops_1.0-6.tar.gz'
Content type 'application/x-gzip' length 8734 bytes
opened URL
==================================================
downloaded 8734 bytes

trying URL 'http://bioconductor.org/packages/2.13/bioc/src/contrib/Biobase_2.22.0.tar.gz'
Content type 'application/x-gzip' length 1848944 bytes (1.8 Mb)
opened URL
==================================================
downloaded 1.8 Mb

trying URL 'http://cran.fhcrc.org/src/contrib/XML_3.98-1.1.tar.gz'
Content type 'application/x-gzip' length 1582216 bytes (1.5 Mb)
opened URL
==================================================
downloaded 1.5 Mb

trying URL 'http://cran.fhcrc.org/src/contrib/RCurl_1.95-4.3.tar.gz'
Content type 'application/x-gzip' length 879143 bytes (858 Kb)
opened URL
==================================================
downloaded 858 Kb

trying URL 'http://bioconductor.org/packages/2.13/bioc/src/contrib/GEOquery_2.28.0.tar.gz'
Content type 'application/x-gzip' length 13630252 bytes (13.0 Mb)
opened URL
==================================================
downloaded 13.0 Mb

* installing *source* package ‘BiocGenerics’ ...
** R
** inst
** preparing package for lazy loading
Creating a new generic function for ‘append’ in package ‘BiocGenerics’
Creating a new generic function for ‘as.data.frame’ in package ‘BiocGenerics’
Creating a new generic function for ‘as.vector’ in package ‘BiocGenerics’
Creating a new generic function for ‘cbind’ in package ‘BiocGenerics’
Creating a new generic function for ‘rbind’ in package ‘BiocGenerics’
Creating a new generic function for ‘duplicated’ in package ‘BiocGenerics’
Creating a new generic function for ‘anyDuplicated’ in package ‘BiocGenerics’
Creating a new generic function for ‘eval’ in package ‘BiocGenerics’
Creating a new generic function for ‘pmax’ in package ‘BiocGenerics’
Creating a new generic function for ‘pmin’ in package ‘BiocGenerics’
Creating a new generic function for ‘pmax.int’ in package ‘BiocGenerics’
Creating a new generic function for ‘pmin.int’ in package ‘BiocGenerics’
Creating a new generic function for ‘Reduce’ in package ‘BiocGenerics’
Creating a new generic function for ‘Filter’ in package ‘BiocGenerics’
Creating a new generic function for ‘Find’ in package ‘BiocGenerics’
Creating a new generic function for ‘Map’ in package ‘BiocGenerics’
Creating a new generic function for ‘Position’ in package ‘BiocGenerics’
Creating a new generic function for ‘get’ in package ‘BiocGenerics’
Creating a new generic function for ‘mget’ in package ‘BiocGenerics’
Creating a new generic function for ‘is.unsorted’ in package ‘BiocGenerics’
Creating a new generic function for ‘lapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘sapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘mapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘match’ in package ‘BiocGenerics’
Creating a new generic function for ‘order’ in package ‘BiocGenerics’
Creating a new generic function for ‘paste’ in package ‘BiocGenerics’
Creating a new generic function for ‘rank’ in package ‘BiocGenerics’
Creating a new generic function for ‘rep.int’ in package ‘BiocGenerics’
Creating a new generic function for ‘rownames’ in package ‘BiocGenerics’
Creating a new generic function for ‘colnames’ in package ‘BiocGenerics’
Creating a new generic function for ‘union’ in package ‘BiocGenerics’
Creating a new generic function for ‘intersect’ in package ‘BiocGenerics’
Creating a new generic function for ‘setdiff’ in package ‘BiocGenerics’
Creating a new generic function for ‘sort’ in package ‘BiocGenerics’
Creating a new generic function for ‘table’ in package ‘BiocGenerics’
Creating a new generic function for ‘tapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘unique’ in package ‘BiocGenerics’
Creating a new generic function for ‘unlist’ in package ‘BiocGenerics’
Creating a new generic function for ‘xtabs’ in package ‘BiocGenerics’
Creating a new generic function for ‘clusterCall’ in package ‘BiocGenerics’
Creating a new generic function for ‘clusterApply’ in package ‘BiocGenerics’
Creating a new generic function for ‘clusterApplyLB’ in package ‘BiocGenerics’
Creating a new generic function for ‘clusterEvalQ’ in package ‘BiocGenerics’
Warning in getPackageName(environment(fdef)) :
  Created a package name, ‘2014-08-07 15:23:56’, when none found
Creating a new generic function for ‘clusterExport’ in package ‘BiocGenerics’
Creating a new generic function for ‘clusterMap’ in package ‘BiocGenerics’
Creating a new generic function for ‘parLapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘parSapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘parApply’ in package ‘BiocGenerics’
Creating a new generic function for ‘parRapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘parCapply’ in package ‘BiocGenerics’
Creating a new generic function for ‘parLapplyLB’ in package ‘BiocGenerics’
Creating a new generic function for ‘parSapplyLB’ in package ‘BiocGenerics’
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (BiocGenerics)
* installing *source* package ‘bitops’ ...
** package ‘bitops’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c bit-ops.c -o bit-ops.o
In file included from bit-ops.c:1:0:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [bit-ops.o] Error 1
ERROR: compilation failed for package ‘bitops’
* removing ‘/home/robert/R/x86_64-pc-linux-gnu-library/3.0/bitops’
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... rm: cannot remove 'a.out.dSYM': Is a directory

configure: error: C compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package ‘XML’
* removing ‘/home/robert/R/x86_64-pc-linux-gnu-library/3.0/XML’
* installing *source* package ‘Biobase’ ...
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c Rinit.c -o Rinit.o
In file included from Rinit.c:1:0:
/usr/share/R/include/Rinternals.h:32:20: fatal error: stdio.h: No such file or directory
 # include <stdio.h>
                    ^
compilation terminated.
make: *** [Rinit.o] Error 1
ERROR: compilation failed for package ‘Biobase’
* removing ‘/home/robert/R/x86_64-pc-linux-gnu-library/3.0/Biobase’
ERROR: dependency ‘bitops’ is not available for package ‘RCurl’
* removing ‘/home/robert/R/x86_64-pc-linux-gnu-library/3.0/RCurl’
ERROR: dependencies ‘Biobase’, ‘XML’, ‘RCurl’ are not available for package ‘GEOquery’
* removing ‘/home/robert/R/x86_64-pc-linux-gnu-library/3.0/GEOquery’

The downloaded source packages are in
    ‘/tmp/RtmpDSnlDj/downloaded_packages’
Old packages: 'boot', 'class', 'cluster', 'foreign', 'KernSmooth', 'lattice',
  'MASS', 'Matrix', 'mgcv', 'nlme', 'nnet', 'rpart', 'spatial'
Update all/some/none? [a/s/n]: a
trying URL 'http://cran.fhcrc.org/src/contrib/boot_1.3-11.tar.gz'
Content type 'application/x-gzip' length 230713 bytes (225 Kb)
opened URL
==================================================
downloaded 225 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/class_7.3-11.tar.gz'
Content type 'application/x-gzip' length 19592 bytes (19 Kb)
opened URL
==================================================
downloaded 19 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/cluster_1.15.2.tar.gz'
Content type 'application/x-gzip' length 271734 bytes (265 Kb)
opened URL
==================================================
downloaded 265 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/foreign_0.8-61.tar.gz'
Content type 'application/x-gzip' length 333301 bytes (325 Kb)
opened URL
==================================================
downloaded 325 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/KernSmooth_2.23-12.tar.gz'
Content type 'application/x-gzip' length 33518 bytes (32 Kb)
opened URL
==================================================
downloaded 32 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/lattice_0.20-29.tar.gz'
Content type 'application/x-gzip' length 347091 bytes (338 Kb)
opened URL
==================================================
downloaded 338 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/MASS_7.3-33.tar.gz'
Content type 'application/x-gzip' length 486785 bytes (475 Kb)
opened URL
==================================================
downloaded 475 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/Matrix_1.1-4.tar.gz'
Content type 'application/x-gzip' length 1670503 bytes (1.6 Mb)
opened URL
==================================================
downloaded 1.6 Mb

trying URL 'http://cran.fhcrc.org/src/contrib/mgcv_1.8-2.tar.gz'
Content type 'application/x-gzip' length 663555 bytes (648 Kb)
opened URL
==================================================
downloaded 648 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/nlme_3.1-117.tar.gz'
Content type 'application/x-gzip' length 759268 bytes (741 Kb)
opened URL
==================================================
downloaded 741 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/nnet_7.3-8.tar.gz'
Content type 'application/x-gzip' length 28424 bytes (27 Kb)
opened URL
==================================================
downloaded 27 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/rpart_4.1-8.tar.gz'
Content type 'application/x-gzip' length 818733 bytes (799 Kb)
opened URL
==================================================
downloaded 799 Kb

trying URL 'http://cran.fhcrc.org/src/contrib/spatial_7.3-8.tar.gz'
Content type 'application/x-gzip' length 43593 bytes (42 Kb)
opened URL
==================================================
downloaded 42 Kb

* installing *source* package ‘boot’ ...
** package ‘boot’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (boot)
* installing *source* package ‘cluster’ ...
** package ‘cluster’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c clara.c -o clara.o
clara.c:12:18: fatal error: math.h: No such file or directory
 #include <math.h>
                  ^
compilation terminated.
make: *** [clara.o] Error 1
ERROR: compilation failed for package ‘cluster’
* removing ‘/usr/lib/R/library/cluster’
* restoring previous ‘/usr/lib/R/library/cluster’
* installing *source* package ‘foreign’ ...
** package ‘foreign’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c R_systat.c -o R_systat.o
R_systat.c:20:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
compilation terminated.
make: *** [R_systat.o] Error 1
ERROR: compilation failed for package ‘foreign’
* removing ‘/usr/lib/R/library/foreign’
* restoring previous ‘/usr/lib/R/library/foreign’
* installing *source* package ‘KernSmooth’ ...
** package ‘KernSmooth’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fpic  -O3 -pipe  -g  -c blkest.f -o blkest.o
/bin/bash: gfortran: command not found
make: *** [blkest.o] Error 127
ERROR: compilation failed for package ‘KernSmooth’
* removing ‘/usr/lib/R/library/KernSmooth’
* restoring previous ‘/usr/lib/R/library/KernSmooth’
* installing *source* package ‘lattice’ ...
** package ‘lattice’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c init.c -o init.o
In file included from init.c:2:0:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [init.o] Error 1
ERROR: compilation failed for package ‘lattice’
* removing ‘/usr/lib/R/library/lattice’
* restoring previous ‘/usr/lib/R/library/lattice’
* installing *source* package ‘MASS’ ...
** package ‘MASS’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c MASS.c -o MASS.o
In file included from MASS.c:18:0:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [MASS.o] Error 1
ERROR: compilation failed for package ‘MASS’
* removing ‘/usr/lib/R/library/MASS’
* restoring previous ‘/usr/lib/R/library/MASS’
* installing *source* package ‘nnet’ ...
** package ‘nnet’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c nnet.c -o nnet.o
In file included from nnet.c:25:0:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [nnet.o] Error 1
ERROR: compilation failed for package ‘nnet’
* removing ‘/usr/lib/R/library/nnet’
* restoring previous ‘/usr/lib/R/library/nnet’
* installing *source* package ‘rpart’ ...
** package ‘rpart’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c anova.c -o anova.o
In file included from rpart.h:6:0,
                 from anova.c:4:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [anova.o] Error 1
ERROR: compilation failed for package ‘rpart’
* removing ‘/usr/lib/R/library/rpart’
* restoring previous ‘/usr/lib/R/library/rpart’
* installing *source* package ‘spatial’ ...
** package ‘spatial’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c init.c -o init.o
In file included from init.c:18:0:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [init.o] Error 1
ERROR: compilation failed for package ‘spatial’
* removing ‘/usr/lib/R/library/spatial’
* restoring previous ‘/usr/lib/R/library/spatial’
* installing *source* package ‘class’ ...
** package ‘class’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c class.c -o class.o
In file included from class.c:19:0:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [class.o] Error 1
ERROR: compilation failed for package ‘class’
* removing ‘/usr/lib/R/library/class’
* restoring previous ‘/usr/lib/R/library/class’
* installing *source* package ‘Matrix’ ...
** package ‘Matrix’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -DNTIMER -I./SuiteSparse_config     -fpic  -O3 -pipe  -g  -c CHMfactor.c -o CHMfactor.o
In file included from Mutils.h:10:0,
                 from CHMfactor.h:4,
                 from CHMfactor.c:2:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                          ^
compilation terminated.
make: *** [CHMfactor.o] Error 1
ERROR: compilation failed for package ‘Matrix’
* removing ‘/usr/lib/R/library/Matrix’
* restoring previous ‘/usr/lib/R/library/Matrix’
* installing *source* package ‘nlme’ ...
** package ‘nlme’ successfully unpacked and MD5 sums checked
** libs
gfortran   -fpic  -O3 -pipe  -g  -c chol.f -o chol.o
/bin/bash: gfortran: command not found
make: *** [chol.o] Error 127
ERROR: compilation failed for package ‘nlme’
* removing ‘/usr/lib/R/library/nlme’
* restoring previous ‘/usr/lib/R/library/nlme’
* installing *source* package ‘mgcv’ ...
** package ‘mgcv’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -fopenmp -fpic  -O3 -pipe  -g  -c coxph.c -o coxph.o
coxph.c:13:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [coxph.o] Error 1
ERROR: compilation failed for package ‘mgcv’
* removing ‘/usr/lib/R/library/mgcv’
* restoring previous ‘/usr/lib/R/library/mgcv’

The downloaded source packages are in
    ‘/tmp/RtmpDSnlDj/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
There were 17 warnings (use warnings() to see them)

为什么会失败?我没有做任何特殊的事情,只是想安装一个软件包 =(

我看到的第一个错误是说找不到stdlib.h - 为什么他找不到这个库呢?


@Matthew Plourde:一个简单的安装libc就足够了。并不是每个人都默认知道stdio.h是什么。 - nico
@nico 是的,你说得对。那个问题的语气触动了我的怒火。 - Matthew Plourde
2
我怎么知道最后我需要执行sudo apt-get install g++ gfortran libxml2-dev libcurl4-gnutls-dev? - user3182532
1个回答

7

R包是需要编译的源代码。如果您的系统上有适当的编译器,R会调用它!

您似乎缺少stdlib.h和stdio.h
这些是标准的C头文件,可以在libc软件包中找到。

在Linux Mint中应该是libc6-dev

所以尝试: sudo apt-get install libc6-dev

您可能还需要安装其他软件包:

R安装手册 是一篇不错的阅读材料:

您需要一种编译C和FORTRAN 90的方法(请参阅使用FORTRAN)。您的C编译器应符合ISO/IEC 60059、POSIX 1003.1和C99标准。R会尝试选择适当的标志来处理它所知道的C编译器,但您可能需要设置CC或CFLAGS。对于具有glibc的最新版本的gcc,这意味着包括-std = gnu99。如果检测到编译器为gcc,则会将-std = gnu99附加到CC中,除非与CFLAGS的设置冲突。(请注意,即使用于链接的运行编译器的必要选项,例如用于设置体系结构的选项,也应作为CC的一部分指定,而不是在CFLAGS中指定。)
除非您不想在屏幕上查看图表(或使用Mac),否则您需要安装“X11”,包括其头文件和客户端库。对于最近的Fedora发行版,至少需要安装RPM“libX11”、“libX11-devel”、“libXt”和“libXt-devel”。在Debian中,我们建议使用元包“xorg-dev”。如果您真的不想要这些,请使用--with-x = no显式配置R而不使用X11。
命令行编辑(和命令完成)取决于GNU readline库:所有功能都需要4.2或更高版本。否则,您将需要使用--with-readline = no(或等效)进行配置。
适当的iconv函数是必不可少的。 R使用要求iconv能够在“latin1”和“UTF-8”之间进行转换,识别“”(作为当前编码)和“ASCII”,并且可以将Unicode宽字符格式“UCS-[24] [BL] E”进行翻译 - 这对于glibc而言是正确的,但对于大多数商业Unix则不然。但是,您可以利用GNU libiconv(可能作为插件替换:请参见http://www.gnu.org/software/libiconv/)。
操作系统需要具有足够的宽字符类型支持:这在配置时进行了检查。少量POSIX函数是必不可少的,如果可用,将使用其他函数。
需要tar程序以解压缩源代码和软件包(包括推荐的软件包)。最好使用可以自动检测压缩存档的版本以供untar()使用:configure脚本在tar之前查找gtar和gnutar:使用环境变量TAR覆盖此设置。
需要适当版本的grep和sed工具:问题通常出现在旧的AT&T和BSD变体中。 configure将尝试查找合适的版本(包括在某些商业Unix上使用的/ usr / xpg4 / bin中查找)。
如果没有安装makeinfo版本4.7或更高版本,则无法构建大多数手册,如果没有安装,则一些HTML手册将链接到CRAN。要制作手册的PDF版本,您还需要安装文件texinfo.tex(它是GNU texinfo发行版的一部分,但通常成为TeX包的一部分在重新分配中)以及texi2dvi。此外,texi2dvi和texinfo.tex的版本需要兼容:我们已经看到了使用texinfo 4.13和旧的TeX发行版本(TeXLive 2007和MiKTeX 2.8)出现问题的情况。可能可以使用texinfo版本5.x,最好是5.2或更高版本。
PDF文档(包括doc / NEWS.pdf)和构建vignettes需要pdftex和pdflatex。我们需要LaTeX版本2005/12/01或更高版本(用于支持UTF-8)。构建PDF软件包手册(包括R参考手册
总之,你需要一个合适的编译环境。

我已经安装了g++,解决了问题。然后我遇到了一个错误,说缺少gfortran。所以我也安装了它。现在他说找不到xml2-config。我不明白为什么他不只是下载并安装他需要的东西,如果我给他sudo权限的话...? - user3182532
R不应作为root运行,并且只期望您的系统安装了适当的编译工具。许多人肯定不希望R除其自身软件包外,尝试在其系统上安装其他内容。无论如何,我强烈建议您避免以root用户身份运行软件,因为这可能会带来安全问题。此外,您可能会遇到软件包被安装在/root文件夹而不是您的主目录中的问题(不确定是否是这种情况)。 - nico

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接