2

I have an issue on mac os x El Capitan with Xcode 7. I'm using fortran 6.1, downloaded from https://gcc.gnu.org/wiki/GFortranBinaries. I tried degrading to fortran 4.8. but that didn't help me. Following is the error:

installing source package ‘Nepidemic’ ... libs gfortran-4.8 -fPIC -Wall -g -O2 -c random_epi.f95 -o random_epi.o make: gfortran-4.8: No such file or directory make: *** [random_epi.o] Error 1 ERROR: compilation failed for package ‘Epidemic’

Any suggestions? Thanks in advance.

Found one similar issue, Can't find gfortran 4.8 to build package

Community
  • 1
  • 1
Vineetha
  • 157
  • 1
  • 2
  • 13

1 Answers1

11

Following: Unable to install fortran based packages in R - "gfortran -m32:not found"

I installed gfortran 6.1 from https://gcc.gnu.org/wiki/GFortranBinaries#MacOS

Then, I added the following to the file ~/.R/Makevars within my home directory pointing to my gfortran installation:

F77 = gfortran
FC = gfortran
FLIBS = -L/usr/local/gfortran/lib
Community
  • 1
  • 1
user25494
  • 1,289
  • 14
  • 27
  • Thank you. Could you tell me how can I add those in ~/.R/Makevars. I'm very new in this programming world! – Vineetha Jun 10 '16 at 18:30
  • Create a directory in your home directory called `.R`. With a text editor, create a file called `Makevars` in this new directory. Paste the text above in this file. – user25494 Jun 10 '16 at 19:41
  • Still working on my system running: R version 3.3.1 (2016-06-21) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.11.6 (El Capitan) – user25494 Oct 26 '16 at 12:26
  • Thanks. Mine is not working now. Removed 6.1 and installed 4.8. Still lots of issues. – Vineetha Oct 26 '16 at 21:31
  • Thanks, this worked for me under macOS Sierra (10.12.2), R version 3.3.2 and gfortran 5.4.0 installed from MacPorts. – thiagoveloso Dec 20 '16 at 16:58