Fedora – Install another gcc version

fedoragcc

I'm trying to compile NVIDIA CUDA on a Fedora 24 Workstation.

I'm using CUDA version 7.5 and when I try to compile it I get this method:

gcc versions later than 4.9 are not supported!

I have installed:

gcc (GCC) 6.1.1.20160621 (Red Hat 6.1.1-3).

How can I install gcc 4.9 on my machine?

My question is related to this one, but on that one doesn't tell how to install to different gcc versions on the same machine.

On ubuntu I can do it with this command:

sudo apt-get install gcc-4.9 g++-4.9

But I have a Fedora 24.

Best Answer

There are compat-gcc* packages providing older version of GCC on Fedora. You can find them in koji and install them using dnf (version 3.4):

dnf install compat-gcc-34
Related Question