bbolker / bbmle

maximum likelihood estimation package
GNU General Public License v3.0
25 stars 13 forks source link

bbmle requires gcc 11? install fails after upgrade to R 4.2.1 (4.2.1_2 from homebrew) on Mac replaced gcc 11 with gcc 12 #33

Closed maspotts closed 2 years ago

maspotts commented 2 years ago

Hi: not sure if this a bbmle issue, but since I updated R to 4.2.1_2 (latest homebrew version) on my Mac (MacOS 12.5) I can no longer install bbmle because its installer is looking for /opt/brew/opt/gcc/lib/gcc/11/libgfortran.5.dylib, but the update (to 4.2.1_2) replaced gcc 11 with gcc 12 as an R dependency, which caused the removal of gcc 11, and so /opt/brew/opt/gcc/lib/gcc/12/libgfortran.5.dylib exists but /opt/brew/opt/gcc/lib/gcc/11/libgfortran.5.dylib does not (note: /opt/brew is my homebrew root). Is there anything I can do to get bbmle installed using gcc 12? No other packages (that I use) seem to have dependencies on gcc 11, but I'm actively using bbmle so can't do without it.

> install.packages("bbmle")
Installing package into ‘/opt/brew/lib/R/4.2/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/bbmle_1.0.25.tar.gz'
Content type 'application/x-gzip' length 524848 bytes (512 KB)
==================================================
downloaded 512 KB

* installing *source* package ‘bbmle’ ...
** package ‘bbmle’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/opt/brew/lib/R/4.2/site-library/mvtnorm/libs/mvtnorm.so':
  dlopen(/opt/brew/lib/R/4.2/site-library/mvtnorm/libs/mvtnorm.so, 0x0006): Library not loaded: '/opt/brew/opt/gcc/lib/gcc/11/libgfortran.5.dylib'
  Referenced from: '/opt/brew/lib/R/4.2/site-library/mvtnorm/libs/mvtnorm.so'
  Reason: tried: '/opt/brew/opt/gcc/lib/gcc/11/libgfortran.5.dylib' (no such file), '/opt/brew/Cellar/r/4.2.1_2/lib/R/lib/libgfortran.5.dylib' (no such file)
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘bbmle’
* removing ‘/opt/brew/lib/R/4.2/site-library/bbmle’

Thanks!

bbolker commented 2 years ago

Well, this problem is not within bbmle - it's from mvtnorm, which bbmle imports some functions from. Maybe try reinstalling mvtnorm ... ??

FWIW there seem to be a number of references to mvtnorm + brew + gfortran, although none is recent ...

maspotts commented 2 years ago

Ah, good point: hadn't noticed that! I worked around it for now by installing R manually from r-project, so I could finish my project, but once I'm at a loose end again I'll try reinstalling mtvnorm: thanks very much!