简体   繁体   中英

cannot install/update package “rgl”: installation of package ‘rgl’ had non-zero exit status in Windows 10

I am trying to update my rgl from 0.103.5 to 0.104.16 version. When I ran updates, I get the following error message:

    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

I read through the similar errors in stackoverflow but could not relate to my issue. It seems like the error can be traced back to OpenGL libraries, but, I am not sure how to troubleshoot that either. My understanding is that OpenGL comes with the OS, not as a sperate R library. Any suggestions/directions would be appreciated.

My sessionInfo:

> 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 

The Windows build of rgl assumes that Freetype is available, and on your system it wasn't found.

The README for rgl says this:

BUILDING ON MICROSOFT WINDOWS

Install Rtools40 or newer.

Install Freetype via

pacman -S mingw-w64-{i686,x86_64}-freetype

Then the usual R CMD INSTALL should work.

Alternatively, wait a few days, and the binary build should be available on CRAN.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM