【问题标题】:Troubles installing "rgl" on Ubuntu在 Ubuntu 上安装“rgl”时遇到问题
【发布时间】:2019-07-06 02:32:42
【问题描述】:

似乎我在 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

看起来错误出现在前三行中。 我的会话信息是

> 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  

有人知道哪里有问题吗?

【问题讨论】:

    标签: r rgl


    【解决方案1】:

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

      libcgal-dev, libglu1-mesa-dev, libglu1-mesa-dev
    

    您可以将它们安装在带有apt-get 的机器上,如下所示:

    sudo apt-get install libcgal-dev libglu1-mesa-dev libglu1-mesa-dev
    

    这应该解决依赖问题


    安装 X11 头文件:

    sudo apt-get install libx11-dev
    

    【讨论】:

    • 这三个的最后两个包不是一样吗?
    【解决方案2】:

    您需要安装 OpenGL 库。最简单的做法是将Michael Rutter's PPA 添加到您的存储库列表并安装r-cran-rgl

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

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

    【讨论】:

    • 尝试了您提供的代码。它工作并下载了所有东西。但是,当输入 require("rgl") 时,我收到了这个错误:Loading required package: rgl Warning messages: 1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display 2: In fun(libname, pkgname) : error in rgl_init
    • 对不起,不知道。您是否在无头/远程服务器上运行它?如果您在 R 中执行 x11() 会发生什么?
    • 我在专用服务器上运行它。输入 x11() 会得到 Error in .External2(C_X11, d$display, d$width, d$height, d$pointsize, : unable to start device X11cairo In addition: Warning message: In x11() : unable to open connection to X11 display ''
    【解决方案3】:

    我们在 Ubuntu 18.04 上安装 rgl 时遇到类似问题。

    所以我们添加了所有这些依赖项(一些取自之前的答案):

    sudo apt install libftgl2 libcgal-dev libglu1-mesa-dev libglu1-mesa-dev libx11-dev libfreetype6-dev
    

    经过大量尝试,我们成功了!

    我们也在这里发布了这个解决方案:https://r-forge.r-project.org/tracker/?group_id=234&atid=946&func=detail&aid=6553

    【讨论】:

      【解决方案4】:

      这是我的解决方案。它在 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") 
      

      【讨论】:

        猜你喜欢
        • 2012-08-27
        • 2015-07-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-24
        • 2019-11-11
        • 2017-10-15
        相关资源
        最近更新 更多