27

I got this message when i tried to install gfortran.

~$ brew install gfortran
Error: No available formula for gfortran
GNU Fortran is now provided as part of GCC, and can be installed with:
  brew install gcc

My question is how to install gfortran with homebrew or port?

or

If now GNU Fortran is a part of GCC How can i compile fortran code using gcc?

I'm not sure may be i've misunderstood something i remember that the last time i still can use gfortran to compile my code but now it doesn't work.

Further information:

when i use command brew list i still see that gfortran is there but can not use it.

Further information (latest):

ok, now i can use gfortran command but another problem come

~$ gfortran-4.9 hello.f
dyld: Library not loaded: /usr/local/lib/libcloog-isl.4.dylib
  Referenced from: /usr/local/Cellar/gcc/4.9.2/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/f951
  Reason: image not found
gfortran-4.9: internal compiler error: Trace/BPT trap: 5 (program f951)
Abort trap: 6
fronthem
  • 4,011
  • 8
  • 34
  • 55

1 Answers1

33

Just do brew install gcc per the instructions. The gcc package contains gcc, g++, gfortran etc.

normanius
  • 8,629
  • 7
  • 53
  • 83
janneb
  • 36,249
  • 2
  • 81
  • 97
  • thank you very much for your answer now i can use `gfortran` command but another problem come. – fronthem Nov 14 '14 at 09:51
  • It appears that cloog is not installed or is not correctly linked into Homebrew's prefix. Please post the output of `brew doctor` to Gist or a pastebin and link to it. – Tim Smith Nov 16 '14 at 04:31