Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
564 views
in Technique[技术] by (71.8m points)

r - Installing rgl on Ubuntu and Mac: X11 not found

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 package, using this command in R:

source("http://bioconductor.org/biocLite.R")
biocLite("rgl")

The following error is displayed:

configure: error: X11 not found but required, configure aborted. ERROR: configuration failed for package ‘rgl’ * removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl’

I checked this address /Library/Frameworks/R.framework/Versions/3.2/Resources/library and there is no rgl folder, so I cannot delete aglrgl.so (or rgl.so), which is the answer to the above-mentioned question. Can you please help me with this installation problem? Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...