如何解决无法安装/更新包“rgl”:安装包“rgl”在 Windows 10 中的退出状态为非零
我正在尝试将我的 rgl 从 0.103.5 更新到 0.104.16 版本。当我运行更新时,我收到以下错误消息:
install.packages("rgl",dependencies = TRUE)
Installing package into ‘C:/Program Files/R/R-4.0.3’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
rgl 0.103.5 0.104.16 TRUE
installing the source package ‘rgl’
trying URL 'http://cran.rstudio.com/src/contrib/rgl_0.104.16.tar.gz'
Content type 'application/x-gzip' length 2832742 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'rgl' ...
** package 'rgl' successfully unpacked and MD5 sums checked
** using staged installation
Configuring for R 4+ including OpenGL
** libs
Warning: this package has a non-empty 'configure.win' file,so building only the main architecture
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -Iext -Iext/ftgl -I/mingw64/include/freetype2 -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c ABCLineset.cpp -o ABCLineset.o
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -Iext -Iext/ftgl -I/mingw64/include/freetype2 -DHAVE_PNG_H -DHAVE_FREETYPE -Iext -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c BBoxDeco.cpp -o BBoxDeco.o
In file included from glgui.h:10,from BBoxDeco.cpp:6:
ext/ftgl/FTGL/ftgl.h:32:10: Fatal error: ft2build.h: No such file or directory
#include <ft2build.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-40~1.3/etc/x64/Makeconf:229: BBoxDeco.o] Error 1
ERROR: compilation Failed for package 'rgl'
* removing 'C:/Program Files/R/R-4.0.3/rgl'
Warning in install.packages :
installation of package ‘rgl’ had non-zero exit status
我通读了 stackoverflow 中的类似错误,但与我的问题无关。似乎该错误可以追溯到 OpenGL 库,但是,我也不知道如何解决该问题。我的理解是 OpenGL 随操作系统一起提供,而不是作为单独的 R 库。任何建议/方向将不胜感激。
我的会话信息:
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics Grdevices utils datasets methods base
loaded via a namespace (and not attached):
[1] rstudioapi_0.13 magrittr_2.0.1 usethis_2.0.0 devtools_2.3.2 pkgload_1.1.0 githubinstall_0.2.2
[7] R6_2.5.0 rlang_0.4.10 fansi_0.4.1 httr_1.4.2 tools_4.0.3 pkgbuild_1.2.0
[13] data.table_1.13.6 xfun_0.20 sessioninfo_1.1.1 tinytex_0.28 cli_2.2.0 withr_2.3.0
[19] remotes_2.2.0 ellipsis_0.3.1 assertthat_0.2.1 digest_0.6.27 rprojroot_2.0.2 lifecycle_0.2.0
[25] Crayon_1.3.4 processx_3.4.5 purrr_0.3.4 callr_3.5.1 fs_1.5.0 ps_1.5.0
[31] testthat_3.0.1 curl_4.3 memoise_1.1.0 glue_1.4.2 compiler_4.0.3 desc_1.2.0
[37] prettyunits_1.1.1 jsonlite_1.7.2
解决方法
rgl
的 Windows 版本假定 Freetype 可用,但在您的系统上找不到它。
rgl 的自述文件是这样说的:
在微软 WINDOWS 上构建
安装 Rtools40 或更新版本。
通过安装 Freetype
pacman -S mingw-w64-{i686,x86_64}-freetype
然后通常的 R CMD INSTALL 应该可以工作。
或者,等待几天,二进制版本应该可以在 CRAN 上使用。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。