r - 安装包时的非零退出状态
问题描述
我正在尝试在 CentOs 托管的 RStudio 上安装软件包。最初控制台输出告诉我安装一些软件包,包括我使用 yum install 安装的 libcurl-devel 或 libxml2-devel。
我可以安装一些软件包。但是,tidyverse 给了我一些问题。尝试安装后我无法理解控制台输出,所以我将其粘贴在下面。谁能建议如何克服这个问题,以便我可以安装 tidyverse?
install.packages("tidyverse", dependencies = T)
Installing package into ‘/home/rstudio/mylibs’
(as ‘lib’ is unspecified)
also installing the dependency ‘lubridate’
trying URL 'https://cran.rstudio.com/src/contrib/lubridate_1.7.4.tar.gz'
Content type 'application/x-gzip' length 449850 bytes (439 KB)
==================================================
downloaded 439 KB
trying URL 'https://cran.rstudio.com/src/contrib/tidyverse_1.2.1.tar.gz'
Content type 'application/x-gzip' length 61647 bytes (60 KB)
==================================================
downloaded 60 KB
* installing *source* package ‘lubridate’ ...
** package ‘lubridate’ successfully unpacked and MD5 sums checked
** libs
g++ -m64 -std=gnu++0x -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/home/rstudio/mylibs/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppExports.cpp -o RcppExports.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/home/rstudio/mylibs/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c datetime.c -o datetime.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/home/rstudio/mylibs/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c period.c -o period.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/home/rstudio/mylibs/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c tparse.c -o tparse.o
g++ -m64 -std=gnu++0x -I/usr/include/R -DNDEBUG -I. -I./cctz/include/ -I./cctz/src/ -I"/home/rstudio/mylibs/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c update.cpp -o update.o
In file included from ./cctz/include/civil_time.h:18,
from update.cpp:4:
./cctz/include/civil_time_detail.h:37: error: expected nested-name-specifier before ‘year_t’
./cctz/include/civil_time_detail.h:37: error: ‘year_t’ has not been declared
./cctz/include/civil_time_detail.h:37: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:37: error: expected unqualified-id before ‘=’ token
./cctz/include/civil_time_detail.h:41: error: expected nested-name-specifier before ‘diff_t’
./cctz/include/civil_time_detail.h:41: error: ‘diff_t’ has not been declared
./cctz/include/civil_time_detail.h:41: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:41: error: expected unqualified-id before ‘=’ token
./cctz/include/civil_time_detail.h:46: error: expected nested-name-specifier before ‘month_t’
./cctz/include/civil_time_detail.h:46: error: ‘month_t’ has not been declared
./cctz/include/civil_time_detail.h:46: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:46: error: expected unqualified-id before ‘=’ token
./cctz/include/civil_time_detail.h:47: error: expected nested-name-specifier before ‘day_t’
./cctz/include/civil_time_detail.h:47: error: ‘day_t’ has not been declared
./cctz/include/civil_time_detail.h:47: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:47: error: expected unqualified-id before ‘=’ token
./cctz/include/civil_time_detail.h:48: error: expected nested-name-specifier before ‘hour_t’
./cctz/include/civil_time_detail.h:48: error: ‘hour_t’ has not been declared
./cctz/include/civil_time_detail.h:48: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:48: error: expected unqualified-id before ‘=’ token
./cctz/include/civil_time_detail.h:49: error: expected nested-name-specifier before ‘minute_t’
./cctz/include/civil_time_detail.h:49: error: ‘minute_t’ has not been declared
./cctz/include/civil_time_detail.h:49: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:49: error: expected unqualified-id before ‘=’ token
./cctz/include/civil_time_detail.h:50: error: expected nested-name-specifier before ‘second_t’
./cctz/include/civil_time_detail.h:50: error: ‘second_t’ has not been declared
./cctz/include/civil_time_detail.h:50: error: expected ‘;’ before ‘=’ token
./cctz/include/civil_time_detail.h:50: error: expected unqualified-id before ‘=’ token
./cctz/include/civil_time_detail.h:54: error: expected ‘)’ before ‘year’
./cctz/include/civil_time_detail.h:78: error: ‘cctz::detail::impl::is_leap_year’ declared as an ‘inline’ variable
./cctz/include/civil_time_detail.h:78: error: ‘year_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:78: error: expected ‘,’ or ‘;’ before ‘noexcept’
./cctz/include/civil_time_detail.h:81: error: ‘cctz::detail::impl::year_index’ declared as an ‘inline’ variable
./cctz/include/civil_time_detail.h:81: error: ‘year_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:81: error: ‘month_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:81: error: initializer expression list treated as compound expression
./cctz/include/civil_time_detail.h:81: error: expected ‘,’ or ‘;’ before ‘noexcept’
./cctz/include/civil_time_detail.h:84: error: ‘cctz::detail::impl::days_per_century’ declared as an ‘inline’ variable
./cctz/include/civil_time_detail.h:84: error: ‘year_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:84: error: ‘month_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:84: error: initializer expression list treated as compound expression
./cctz/include/civil_time_detail.h:84: error: expected ‘,’ or ‘;’ before ‘noexcept’
./cctz/include/civil_time_detail.h:88: error: ‘cctz::detail::impl::days_per_4years’ declared as an ‘inline’ variable
./cctz/include/civil_time_detail.h:88: error: ‘year_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:88: error: ‘month_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:88: error: initializer expression list treated as compound expression
./cctz/include/civil_time_detail.h:88: error: expected ‘,’ or ‘;’ before ‘noexcept’
./cctz/include/civil_time_detail.h:92: error: ‘cctz::detail::impl::days_per_year’ declared as an ‘inline’ variable
./cctz/include/civil_time_detail.h:92: error: ‘year_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:92: error: ‘month_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:92: error: initializer expression list treated as compound expression
./cctz/include/civil_time_detail.h:92: error: expected ‘,’ or ‘;’ before ‘noexcept’
./cctz/include/civil_time_detail.h:95: error: ‘cctz::detail::impl::days_per_month’ declared as an ‘inline’ variable
./cctz/include/civil_time_detail.h:95: error: ‘year_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:95: error: ‘month_t’ was not declared in this scope
./cctz/include/civil_time_detail.h:95: error: initializer expression list treated as compound expression
./cctz/include/civil_time_detail.h:95: error: expected ‘,’ or ‘;’ before ‘noexcept’
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/functional:56,
from /home/rstudio/mylibs/Rcpp/include/RcppCommon.h:61,
from /home/rstudio/mylibs/Rcpp/include/Rcpp.h:27,
from update.cpp:7:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/typeinfo:36: error: expected ‘}’ before end of line
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/typeinfo:36: error: expected ‘}’ before end of line
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/typeinfo:36: error: expected ‘}’ before end of line
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/typeinfo:36: error: expected declaration before end of line
make: *** [update.o] Error 1
ERROR: compilation failed for package ‘lubridate’
* removing ‘/home/rstudio/mylibs/lubridate’
Warning in install.packages :
installation of package ‘lubridate’ had non-zero exit status
ERROR: dependency ‘lubridate’ is not available for package ‘tidyverse’
* removing ‘/home/rstudio/mylibs/tidyverse’
Warning in install.packages :
installation of package ‘tidyverse’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp0Wx5ys/downloaded_packages’
解决方案
根据评论,这个问题似乎更多地与 CentOs6 相关,而不是 R 或 Tidyverse。我安装了一个旧版本的 lubridate,它似乎无法作为 tidyverse 包的一部分安装:
devtools::install_github("tidyverse/lubridate@before-CCTZ")
安装此旧版本的 lubridate 后,我尝试安装 tidyverse,但失败并显示类似的错误消息。
然后我安装了一个旧版本的 tidyverse,然后成功安装:
devtools::install_version("tidyverse", version = "1.1.1", repos = "http://cran.us.r-project.org")
推荐阅读
- node.js - 如何使用 node.js 获取 Selenium WebDriver 中元素的 XY 坐标
- flutter - 有没有办法改变 BottomSheet 的高度?
- c# - Web API 控制器模型返回 null
- c++ - 使用 OpenMP 并行化快速排序
- git - Docker 上带有 Alpine Linux 的 Apache git 服务器
- amazon-web-services - Lambda 在本地连接到 Aurora MySql - 部署到 AWS 时超时
- git - 如何在我的产品中处理硬编码 URL、数据库配置,该产品在 Git 级别具有多个模块?
- android - Firebase 云消息传递 POST 的 URL 是什么?
- javascript - 具有特定任务的文本分析器
- c++ - 在 OpenGL 中使用 imageStore 写入图像