Open Anjan-stat opened 1 year ago
I have reinstalled gfortran, deleted and reinstalled xcode-build tool, edited and rebuilt the Makevars file (I may have made a mistake here). But I still get the same error. I would be very happy if someone could help. Thank you!
My machine info:
Platform : aarch64-apple-darwin20
R.version : 4.2.2
MacOS : Monterey (12.6.5)
Chip : Apple M1 Max
Here is my solution:
brew install gcc
which gfortran
. In my case, it returns /opt/homebrew/bin/gfortran
In terminal, type
mkdir -p ~/.R
nano ~/.R/Makevars
FC = /opt/homebrew/bin/gfortran
F77 = /opt/homebrew/bin/gfortran
FLIBS = -L/opt/homebrew/lib/gcc/14 -lgfortran -lquadmath -lm
Note: /opt/homebrew/lib/gcc is the location of the gcc installed by homebrew, dols /opt/homebrew/lib/gcc
in terminal to find which number is available, in my case it is 14
Here is my solution:
brew install gcc
- in terminal, type
which gfortran
. In my case, it returns/opt/homebrew/bin/gfortran
- in terminal, type
In terminal, type
mkdir -p ~/.R nano ~/.R/Makevars
- In the ~/.R/Makevars, add
FC = /opt/homebrew/bin/gfortran F77 = /opt/homebrew/bin/gfortran FLIBS = -L/opt/homebrew/lib/gcc/14 -lgfortran -lquadmath -lm
Note: /opt/homebrew/lib/gcc is the location of the gcc installed by homebrew, do
ls /opt/homebrew/lib/gcc
in terminal to find which number is available, in my case it is 14
This approach can be applied to various R packages that require compilation for M-chip MacBooks. Thank you for providing such a valuable solution!
I'm trying to install SPARK on Mac but getting the following error R version: 4.3.1 MacOC: M1 Pro