Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: installation of package ‘rgl’ had non-zero exit status

Tags:

r

rgl

I would like to use plot 3D so I was trying to download rgl but whenever I am trying to install this, I am getting this error in rgl package installation. So can you please suggest me something.

install.packages("rgl", dependencies=TRUE)
     Installing package into ‘/root/R/x86_64-unknown-linux-gnu-library/3.2’
     (as ‘lib’ is unspecified)
     --- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.skazkaforyou.com/src/contrib/rgl_0.95.1247.tar.gz'
Content type 'application/x-gzip' length 2014799 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
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... no
checking GL/gl.h presence... no
checking for GL/gl.h... no
checking GL/glu.h usability... no
checking GL/glu.h presence... no
checking for GL/glu.h... no
configure: error: missing required header GL/gl.h
ERROR: configuration failed for package ‘rgl’
* removing ‘/root/R/x86_64-unknown-linux-gnu-library/3.2/rgl’

The downloaded source packages are in
‘/tmp/RtmpP1KuPN/downloaded_packages’
Warning message:
In install.packages("rgl", dependencies = TRUE) :
      installation of package ‘rgl’ had non-zero exit status
like image 222
meghavarshney Avatar asked Aug 13 '15 07:08

meghavarshney


People also ask

What does a non-zero exit status mean?

A non-zero exit status indicates failure. This seemingly counter-intuitive scheme is used so there is one well-defined way to indicate success and a variety of ways to indicate various failure modes. When a command terminates on a fatal signal whose number is N , Bash uses the value 128+ N as the exit status.

What is non-zero exit status updating HTML index of packages in Library?

The non-zero exit status simply indicates that there was an error during the installation of the "package". You can extract the archive manually and then load the functions therein with, e.g., source('bivpois.

How do I download a new package in R?

Alternatively, you can install R packages from the menu. In RStudio go to Tools → Install Packages and in the Install from option select Repository (CRAN) and then specify the packages you want. In classic R IDE go to Packages → Install package(s) , select a mirror and install the package.


1 Answers

The installation of rgl needs some system libraries to be previously installed. The index page of the package rgl provides some important information:

SystemRequirements: OpenGL, GLU Library, zlib (optional), libpng (>=1.2.9, optional), FreeType (optional)

Once we know that OpenGL and GLU Library are mandotory, we have to check whether they already are present or not in the system. One way is to read the log of the installation of rgl. If these lines appear:

checking GL/gl.h usability... no
checking GL/gl.h presence... no
checking for GL/gl.h... no
checking GL/glu.h usability... no
checking GL/glu.h presence... no
checking for GL/glu.h... no
configure: error: missing required header GL/gl.h

It means that GLU Library is missing and must be installed. For example, on Ubuntu, we can run:

sudo apt-get install libglu1-mesa-dev

In RedHat, it would be:

yum install Mesa-devel

This will install the headers of the GLU Library. And we can then run again:

install.packages("rgl", dependencies = TRUE)
like image 188
2 revsuser3710546 Avatar answered Sep 30 '22 15:09

2 revsuser3710546