Installing rgl on Ubuntu and Mac: X11 not found

前端 未结 7 2061
后悔当初
后悔当初 2020-11-28 07:32

I have seen this question here: Error in loading rgl package with Mac OS X but there is no mentioning about installation error, which is my case. I cannot install rgl<

7条回答
  •  失恋的感觉
    2020-11-28 07:45

    On Ubuntu 16.04 and 18.04, you might get this issue when trying to install rgl from CRAN:

    checking for X... no configure: error: X11 not found but required, configure aborted.

    ERROR: configuration failed for package ‘rgl’

    Credit is due to this blog which solved my problems at installing rgl:

    http://solaimurugan.blogspot.ca/2015/09/3d-data-visualization-using-r-configure.html
    

    In case the link above disappears, the solution, as outlined in the blog is:

    sudo apt-get install xorg 
    sudo apt-get install libx11-dev 
    sudo apt-get install libglu1-mesa-dev 
    

    More recently, installing rgl on a fresh ubuntu 16.04 install also requires a further step (as noted in the comments below), if you get this error:

    fatal error: ft2build.h: No such file or directory

    This is solved with:

    sudo apt-get install libfreetype6-dev
    

    Then installing rgl from CRAN should just work.

提交回复
热议问题