“安装故障”;rgl";在Ubuntu上

“安装故障”;rgl";在Ubuntu上,r,rgl,R,Rgl,似乎我在Ubuntu上安装rgl包时遇到了麻烦。 跑步时 install.packages("rgl") 我犯了以下错误 checking for gcc... gcc -std=gnu99 checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking wh

似乎我在Ubuntu上安装rgl包时遇到了麻烦。 跑步时

install.packages("rgl")
我犯了以下错误

checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ISO C89... (cached) none needed
checking whether __attribute__((visibility())) is supported... yes
checking whether gcc -std=gnu99 accepts -fvisibility... yes
checking whether  accepts -fvisibility... no
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries , headers 
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking GL/glu.h usability... no
checking GL/glu.h presence... no
checking for GL/glu.h... no
Warning in install.packages :
  installation of package \u2018rgl\u2019 had non-zero exit status
错误似乎出现在alst的三行中。 我的会话信息是

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] doMC_1.3.3                    doParallel_1.0.8             
 [3] bit64_0.9-4                   bit_1.1-12                   
 [5] Defaults_1.1-1                quantstrat_0.9.1669          
 [7] blotter_0.9.1666              Rcpp_0.11.5                  
 [9] iterators_1.0.7               foreach_1.4.2                
[11] base64enc_0.1-2               FinancialInstrument_1.2.0    
[13] quantmod_0.4-4                PerformanceAnalytics_1.4.3541
[15] TTR_0.22-0                    data.table_1.9.4             
[17] xts_0.9-7                     zoo_1.7-12                   

loaded via a namespace (and not attached):
[1] chron_2.3-45     codetools_0.2-10 compiler_3.1.2   grid_3.1.2      
[5] lattice_0.20-30  plyr_1.8.1       reshape2_1.4.1   stringr_0.6.2   
[9] tools_3.1.2  

有人知道陷阱在哪里吗?

您需要安装OpenGL库。最简单的方法是添加到存储库列表并安装
r-cran-rgl

sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get update
sudo apt-get install r-cran-rgl

如果您需要在没有X11的情况下运行,我相信的答案会有所帮助(您可能需要
sudo-apt-get-install-xvfb
first…)

您实际上需要以下软件包:

您可以使用
apt get
将它们安装在机器上,如下所示:

sudo apt-get install libcgal-dev libglu1-mesa-dev libglu1-mesa-dev
这应该可以解决依赖性问题


要安装X11头文件,请执行以下操作:

sudo apt-get install libx11-dev

现在我们在Ubuntu 18.04上,在安装rgl时遇到了类似的问题

因此,我们添加了所有这些依赖项(一些来自前面的答案):

经过多次尝试,我们终于成功了


我们还在此处发布了此解决方案:

这是我的解决方案。它在Ubuntu 18.04中运行良好

sudo apt-get install xorg 
sudo apt-get install libx11-dev 
sudo apt-get install libglu1-mesa-dev 
sudo apt-get install libatlas-base-dev
sudo apt-get install gfortran
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install libblas-dev
sudo apt install python-autopep8
sudo apt install libftgl2 libcgal-dev libglu1-mesa-dev libglu1-mesa-dev libx11-dev libfreetype6-dev
sudo apt-get install libcgal-dev libglu1-mesa-dev libglu1-mesa-dev

install.packages("digest") 
install.packages("xtable") 
install.packages("rgl") 

尝试了您提供的代码。它成功地下载了所有的东西。但是,当输入
require(“rgl”)
时,我得到了这个错误:
加载所需的包:rgl警告消息:1:In rgl.init(initValue,onlyNULL):rgl:无法打开X11显示2:In fun(libname,pkgname):rgl_init中的错误
对不起,不知道。您是否在无头/远程服务器上运行此操作?如果从R中执行
x11()
操作会发生什么?我在专用服务器上运行它。键入
x11()
会导致.External2中出现
错误(C_x11,d$display,d$width,d$height,d$pointsize,:无法启动设备X11cairo另外:警告消息:在x11()中:无法打开到x11 display“”的连接。
这三个包中的最后两个包不是相同吗?
sudo apt install libftgl2 libcgal-dev libglu1-mesa-dev libglu1-mesa-dev libx11-dev libfreetype6-dev
sudo apt-get install xorg 
sudo apt-get install libx11-dev 
sudo apt-get install libglu1-mesa-dev 
sudo apt-get install libatlas-base-dev
sudo apt-get install gfortran
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install libblas-dev
sudo apt install python-autopep8
sudo apt install libftgl2 libcgal-dev libglu1-mesa-dev libglu1-mesa-dev libx11-dev libfreetype6-dev
sudo apt-get install libcgal-dev libglu1-mesa-dev libglu1-mesa-dev

install.packages("digest") 
install.packages("xtable") 
install.packages("rgl")