Search code examples
gcchomebrewgfortran

Installing older gcc, gfortran version on mac big sur


I am trying to install (with pip install) on a mac BigSur a python package that needs gfortran. The package was last updated in 2020.

I initially did

brew install gcc

and that brought in gfortran, but my pip install failed with some fortran errors. My theory is that I need to revert to an older (circa 2020) version of gfortran.

I did

brew install gcc@8

but when I run

gfortran --version

it doesnt find gfortran.

I am a beginner with brew. Not sure what am I missing in these install games.


Solution

  • You are halfway there. Run these now

    ln -s /usr/local/bin/gfortran-8 /usr/local/bin/gfortran
    ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc
    

    The full process is explained here Updating and installing GNU/gfortran compiler on MacOS