3

I am trying to install a Fortran compiler on my Mac Pro 2019 (running macOS). First step is:

sudo apt-get install gfortran 

but I get error: command not found

I also tried

brew install gfortran

also

port install gfortran

but again, the same error.

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
shere
  • 149
  • 1
  • 2
  • 3
  • 6
    First, `apt-get` is for Debian/Ubuntu/Mint and derivatives and not MacOS. To use `brew` or `port`, you'll need to install them as they are third-party tools and don't come with MacOS. The instructions for installing `brew` are here: https://brew.sh/ and the instructions for installing `port` are here: https://guide.macports.org/chunked/installing.macports.html – Nasir Riley Aug 18 '19 at 22:59

1 Answers1

3

Instead of trying to install gfortran you should try gcc instead. gcc install comes with gfortran. This is available from homebrew or MacPorts.

Another method is to install pre-compiled binaries from here. Select the version based on your Mac OS version and you get an apple style loader. A .dmg file ready to load on your mac.

Natsfan
  • 181
  • 7