How to install a FORTRAN compiler on macOS?

6,056

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.

Share:
6,056

Related videos on Youtube

shere
Author by

shere

Updated on September 18, 2022

Comments

  • shere
    shere almost 2 years

    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.

    • Nasir Riley
      Nasir Riley almost 5 years
      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: brew.sh and the instructions for installing port are here: guide.macports.org/chunked/installing.macports.html