各位大神好!最近尝试使用学校的服务器运行R程序,需要自己配置环境。之前没有相关经验。
学校的服务器使用的是Ubuntu系统,我本地使用的SSH软件是Terminus。
成功安装R以后,想继续安装tidyverse包,但是遇到了一连串的错误。其中一些是需要安装其它软件,安装了以后,还是有错误。因为tidyverse包的安装及出错信息太长了,下面就以安装purrr包为例展示一下我安装时所遇到的问题:
root@**********:~# R
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages('purrr')
Installing package into '/usr/local/lib/R/site-library'
(as 'lib' is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/purrr_1.0.1.tar.gz'
Content type 'application/x-gzip' length 220628 bytes (215 KB)
==================================================
downloaded 215 KB
* installing *source* package 'purrr' ...
** package 'purrr' successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c backports.c -o backports.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c cleancall.c -o cleancall.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c coerce.c -o coerce.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c conditions.c -o conditions.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c flatten.c -o flatten.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c map.c -o map.o
map.c: In function 'map_impl':
map.c:86:11: warning: implicit declaration of function 'INTEGER_ELT'; did you mean 'INTEGER'? [-Wimplicit-function-declaration]
int n = INTEGER_ELT(ffi_n, 0);
^~~~~~~~~~~
INTEGER
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/cli/include" -fvisibility=hidden -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c pluck.c -o pluck.o
pluck.c: In function 'extract_vector':
pluck.c:130:41: warning: implicit declaration of function 'COMPLEX_ELT'; did you mean 'COMPLEX'? [-Wimplicit-function-declaration]
case CPLXSXP: return Rf_ScalarComplex(COMPLEX_ELT(x, offset));
^~~~~~~~~~~
COMPLEX
pluck.c:130:41: error: incompatible type for argument 1 of 'Rf_ScalarComplex'
In file included from pluck.c:3:0:
/usr/share/R/include/Rinternals.h:1411:7: note: expected 'Rcomplex {aka struct <anonymous>}' but argument is of type 'int'
SEXP Rf_ScalarComplex(Rcomplex);
^~~~~~~~~~~~~~~~
/usr/lib/R/etc/Makeconf:159: recipe for target 'pluck.o' failed
make: *** [pluck.o] Error 1
ERROR: compilation failed for package 'purrr'
* removing '/usr/local/lib/R/site-library/purrr'
The downloaded source packages are in
'/tmp/RtmpuM4x4y/downloaded_packages'
Warning message:
In install.packages("purrr") :
installation of package 'purrr' had non-zero exit status
我的系统信息:
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4
谢谢!