I have installed the latest available gfortran package (together with Apple Developer Tools installed, as well as "command line developer tools") as described here:
https://gcc.gnu.org/wiki/GFortranBinariesMacOS
If I try to run a simple fortran code from terminal using:
gfortran test.f90 -o test
I get the following error:
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
I am running it on Catalina 10.15.7 and xCode version 12.0.1.
I have found a similar question that was solved by reinstalling xCode, but that did not help me. What do I need to do to get it working? I will be happy to add context/details to the question if it helps.
Thanks!
Edit
Instead of installing the gfortran package itself, I installed the whole gcc using homebrew:
brew install gcc
and that solved the problem.