Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.72k stars 12.41k forks source link

Homebrew R fails to allow installation of rgl #36043

Closed alexpreynolds closed 5 years ago

alexpreynolds commented 5 years ago

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

To help us debug your issue please explain:

Note: This is not a problem with the brew command itself, or running it, but is instead an issue with the results from running R after running brew install R. In other words, this may be a bug with the Homebrew R recipe, as opposed to Homebrew itself. I apologize if this is the wrong place to report a problem with recipes; please let me know if there is a different place to report this issue, if so.

I have documented issues here, where I attempt to install the rgl library within the current version of R (3.5.2) installed via Homebrew (1.9.2) and XQuartz (2.7.11), which fails:

https://stackoverflow.com/questions/54188181/how-to-install-rgl-in-os-x-10-14

Installation of rgl fails:

> install.packages("rgl")
...
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so':
  dlopen(/usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so, 6): Library not loaded: @rpath/libc++.1.dylib
  Referenced from: /usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so
  Reason: image not found
Error: package or namespace load failed for 'rgl':
 .onLoad failed in loadNamespace() for 'rgl', details:
  call: NULL
  error:        Loading rgl's DLL failed. 
        On MacOS, rgl depends on XQuartz, which you can download from xquartz.org.

Normally, running install.packages("rgl") should run to completion, after which I can run library("rgl") etc. to use RGL routines.

I am running the following within an xterm-based X11 terminal session within XQuartz:

$ brew --version
Homebrew 1.9.2
Homebrew/homebrew-core (git revision de1ec; last commit 2019-01-15)
Homebrew/homebrew-cask (git revision 68a73e; last commit 2019-01-14)
$ brew install R
...
$ uname -a
Darwin areynolds-macbook 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64
$ R
...
> version
               _                           
platform       x86_64-apple-darwin18.2.0   
arch           x86_64                      
os             darwin18.2.0                
system         x86_64, darwin18.2.0        
status                                     
major          3                           
minor          5.2                         
year           2018                        
month          12                          
day            20                          
svn rev        75870                       
language       R                           
version.string R version 3.5.2 (2018-12-20)
nickname       Eggshell Igloo 
> install.packages("rgl")
...
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so':
  dlopen(/usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so, 6): Library not loaded: @rpath/libc++.1.dylib
  Referenced from: /usr/local/lib/R/3.5/site-library/rgl/libs/rgl.so
  Reason: image not found
Error: package or namespace load failed for 'rgl':
 .onLoad failed in loadNamespace() for 'rgl', details:
  call: NULL
  error:        Loading rgl's DLL failed. 
        On MacOS, rgl depends on XQuartz, which you can download from xquartz.org.

I was able to solve this problem by running brew uninstall R and installing R via the CRAN distribution method. As a result, I believe this may suggest an issue with the Homebrew R recipe, or the installation of the rgl library with the configuration of R installed via the Homebrew R recipe.

fxcoudert commented 5 years ago

R in Homebrew is configured --without-x, I think this may be related to your issue. Maybe rgl requires R to have been compiled with X11 support?

pooranis commented 5 years ago

I have Homebrew R installed (so --without-x), and rgl installs just fine. Looking at the compiling output, the installer appears to recognize the OS as Darwin/MacOS and looks in the appropriate place for x11 and does find it. Is that the case for you?

MikeMcQuaid commented 5 years ago

Closing as not reproducible.