1

I have a software application that requires updating GFortran to a newer version before making the program. I updated gcc, but GFortran did not update. This is on Scientific Linux 7.

$ gcc --version
gcc (GCC) 7.3.0

$ gfortran --version
GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)

How do I get GFortran to update? Even if it is just for this application? I'm using yum.

Edit: Searching for gfortran packages give the following:

$ sudo yum search all gfortran Loaded plugins: langpacks ============================== Matched: gfortran =============================== gcc-gfortran.x86_64 : Fortran support compat-gcc-44-gfortran.x86_64 : Fortran support for compatibility compiler compat-libgfortran-41.i686 : Compatibility Fortran 95 runtime library version : 4.1.2 compat-libgfortran-41.x86_64 : Compatibility Fortran 95 runtime library version : 4.1.2 libgfortran.i686 : Fortran runtime libgfortran.x86_64 : Fortran runtime libgfortran-static.i686 : Static Fortran libraries libgfortran-static.x86_64 : Static Fortran libraries mingw32-gcc-gfortran.x86_64 : MinGW Windows cross-compiler for FORTRAN for the : win32 target mingw64-gcc-gfortran.x86_64 : MinGW Windows cross-compiler for FORTRAN for the : win64 target

When I try to install gcc-gfortran.x86_64, I get

$ yum install gcc-gfortran.x86_64 Loaded plugins: langpacks Package gcc-gfortran-4.8.5-11.el7.x86_64 already installed and latest version Nothing to do

It's stuck on the old version.

Edit 2: Okay. In order to get something newer to show up, I tried to install devtoolset-7. It didn't show up in yum search, but the way to get the package available in Scientific Linux is this:

yum install yum-conf-repos yum install yum-conf-softwarecollections

Now, devtoolset-7 shows up in yum search, but I get this output when trying to install:

$ sudo yum install devtoolset-7 ... --> Finished Dependency Resolution Error: Package: devtoolset-7-gcc-gfortran-7.2.1-1.el7.sc1.x86_64 (softwarecollections) Requires: libgfortran4 >= 7.1.1-2 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest

But,

$ sudo yum search libgfortran4 Loaded plugins: langpacks Warning: No matches found for: libgfortran4 No matches found

1

If the package manager installed is yum (I noticed it in your question's tags), you can use the following to update GNU Fortran to the latest version available:

$ yum update gcc-gfortran
  • Hm, it says that that package is not available. Is this a Scientific Linux thing? – lori Feb 24 '18 at 1:44
  • Could you try running yum search gfortran? It should list available gfortran packages. – aliceinpalth Feb 24 '18 at 2:28
  • I'll put the output in the question. – lori Feb 24 '18 at 5:00
1

Please edit as necessary. And thank you Knud Larson for the reference repo packages.

In order for my version of to SL7 to even see a more recent version of GFortran to download, I attempted to install devtoolset-7. In order to access devtoolset-7, I needed to use these SL7 commands

# yum install yum-conf-repos

# yum install yum-conf-softwarecollections

Then devtoolset-7 was available to install. However, when attempting to install the package, libgfortran4 was not available. In order to get everything to install, I downloaded the repo packages suggested by Knud Larson plus libgfortran from CentOS and installed the libgfortran4

# yum install ./libgfortran4-7.1.1-2.2.1.el7.x86_64.rpm

Then devtoolset-7 installed

# yum install devtoolset-7-gcc-gfortran.x86_64

And now it's working. Thanks everyone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.