1

Is it still possible to somehow get a downgraded version of gfortran? Currently I have version 10.2.0 but this leads to some incompatibility in the compilation of some fortran code in a package I wish to install. As I am on a new machine, it is probably ok for me to uninstall gfortran without too much problems elsewhere but I couldn't see how I might then get a downgraded version of gfortran. I am looking for gfortran version 9.1.0 and I am on a MacOs Big Sur operating system.

CAF
  • 329
  • 3
  • 14

1 Answers1

0

All versions of gfortran are available. You can get the source code and compile yourself.

You can also get the binaries for many operating systems. Specifically for MacOS homebrew allows selecting a specific version of the package: https://stackoverflow.com/a/9832084/721644 homebrew - how to install older versions
Try brew search to find what is available first. Homebrew does not allow simple downgrading but you can have multiple versions using https://apple.stackexchange.com/a/222645

  • Thanks for your reply, it seems the `brew install gfortran@9.1.0` and `brew search gfortran` do not give me any useful results. The latter for example just returns ===> Casks gfortran (tick) – CAF Dec 08 '20 at 08:45
  • @CAF On Linux if I am not the admin I normally go via the compiling the source coude route and it should work on MacOS too. It is not that hard. If you do need the binary, you need to find out which versions are available in the package manager history, try `brew search gcc` and `brew search gfortran` and consider https://apple.stackexchange.com/a/222645 – Vladimir F Героям слава Dec 08 '20 at 09:11
  • @CAF GCC includes gfortran. – Vladimir F Героям слава Dec 08 '20 at 09:15
  • I see ok I installed gcc@7. But when I do `which gfortran` it says I don't have it. But if gfortran is part of gcc why is that so? – CAF Dec 08 '20 at 09:29
  • @CAF I do not know, I do not use Mac. Too many complications like yours. See https://stackoverflow.com/questions/26919450/can-not-install-gfortran-via-homebrew – Vladimir F Героям слава Dec 08 '20 at 09:35
  • @CAF One can only compile the complete GCC. Gfortran is an integral part of GCC. The GCC sources are at the official site https://gcc.gnu.org/releases.html and the releases contain compilation instructions. The script to download any prerequisities is incuded. One needs to set the prefix (default is /usr/local but you probably want $HOME) and enable fortran during configure. – Vladimir F Героям слава Dec 08 '20 at 14:54