Previous version of gfortran and mpif90


I have installed the gcc9 compiler with the “c-extras-gcc9” bundle, but I also need gfortran and mpif90 from the same version. Is there a way to install them?


I am thinking of installing Dnf package manager and add the official Fedora 31 repository (which has the gcc 9, gfortran 9, etc as default) and add the rpm packages from there since they are not available on Clear Linux bundles.

Anyone has a better idea?

Installing gfortran9 from Fedora 31 with Dnf was a bad idea. Too many system dependencies that made the Clear Linux installation broken. Didn’t work.

(yeah using DNF on clear linux won’t do well. if things are very hosed you can repair your system with “swupd repair --picky”)

Normally our gcc compat versions are only for the C language – other languages like C++ and fortran need system libraries (libstdc++ and libgfortran etc) that match the compiler and there really can only be one of those. With a lot of effort in theory it is possible to whack all that kind of in place but it’ll be fragile either way.

Can you give a hint of as to why you really want gcc 9 (which is ancient by now) versus the normal gcc 13 (soon to be 14) ? I can’t imagine gcc breaking fortran compatibility in newer versions (it’s not like fortran undergoes the same amount of language development as C++ does)