How to solve the error " missing required header GL/gl.h" while installing the Package mvoutlier in R?

R

R Problem Overview


I am trying to install the package mvoutlier but following error occurs during installation:

install.packages("mvoutlier")
configure: error: missing required header GL/gl.h 
ERROR: configuration failed for package ‘rgl’
* removing ‘/home/sam/R/x86_64-pc-linux-gnu-library /2.15/rgl’
ERROR: dependency ‘rgl’ is not available for package ‘compositions’
* removing ‘/home/sam/R/x86_64-pc-linux-gnu-library/2.15/compositions’
ERROR: dependency ‘compositions’ is not available for package ‘mvoutlier’
* removing ‘/home/sam/R/x86_64-pc-linux-gnu-library/2.15/mvoutlier’

After that I have install the rgl package successfully, then I tried to install the compositions package then the again same error occurs. Then I have again tried to install the mvoutlier package the same error occurs.

Can anyone let me know how I can resolve this problem. Thanking you in advance.

R Solutions


Solution 1 - R

I suspect you are running Ubuntu 12.04.I think you're going to find that this works for the GL/gl.h problem:

install these at the regular old terminal, ie pretend R doesn't exist for now:

libglu1-mesa-dev freeglut3-dev mesa-common-dev

You might get the following error later (in R) because of a tcl b****/gripe/complaint:

Error in structure(.External(.C_dotTcl, ...), class = "tclObj") : 
  [tcl] can't find package BWidget.

To fix this problem, if you have it:

sudo apt-get install bwidget

These are not R problems. They are OS problems!

Solution 2 - R

I ran into the same issue in between others on a Ubuntu based Linux distro (Linux Mint). Here I will share the worklog I'd done to fix it.

The full fix was:

Worklog

The first error was related to missing devel libraries of X11:

I fixed it installing:

However, after fix the issue, I felt into a new one like this one:

ERROR: configuration failed for package ‘rgl’

I checked the library on the repository:

dpkg-query: no path found matching pattern /usr/include/GL/gl.h

To fix this issue, install :

Then, I was prompt by a new error:

To fix the issue, install the libglu1 devel libraries:

Solution 3 - R

configure: error: missing required header GL/gl.h 

normally means you haven't installed the -dev version of a package, in this case GL.

On my system, GL/gl.h is owned by mesa-common-dev

$ dpkg -S /usr/include/GL/gl.h
mesa-common-dev: /usr/include/GL/gl.h

which would have been installed with apt-get install mesa-common-dev or via some GUI magic.

Solution 4 - R

On Ubuntu 16.04, I solved this problem (during rgl package installation) with sudo apt-get install libglu1-mesa-dev

Solution 5 - R

the current fedora package manager will fail to find these libraries as shown. Instead you need to do

    sudo dnf install mesa-libGL-devel mesa-libGLU-devel

Solution 6 - R

Based on the work breakdown by 3manuek, I figured only the libglu1-mesa-dev library was needed in ubuntu 16.04 LTS, and it worked.

Solution 7 - R

On, RHEL, sudo yum install mesa-libGLU-devel worked.

Solution 8 - R

I encountered an equivalent problem when testing a package that required 'rgl' on Travis. The problem is that the operating system lacks the necessary GL files on which the 'rgl' package draws.

A thread at R-forge offers the ingenious solution of running apt-get install r-cran-rgl, which will pull in any of the GL dependencies not already present on the operating system. This seems simpler than second-guessing which specific dependency is missing, and it remains possible to install a more recent version of 'rgl' if required.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSaurabhView Question on Stackoverflow
Solution 1 - Ruser3386237View Answer on Stackoverflow
Solution 2 - R3manuekView Answer on Stackoverflow
Solution 3 - RSpacedmanView Answer on Stackoverflow
Solution 4 - RCristina Palomo GaroView Answer on Stackoverflow
Solution 5 - RKeith AllenView Answer on Stackoverflow
Solution 6 - RuntillView Answer on Stackoverflow
Solution 7 - RJon HarmonView Answer on Stackoverflow
Solution 8 - RMartin SmithView Answer on Stackoverflow