5

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.

1

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
  • 1
    That's much, much too old. CUDA 7 supports GCC 4.9.x – einpoklum Mar 16 '17 at 10:44
1

Devtoolset-2 provides g++-4.8.2 : # dnf install --nogpgcheck devtoolset-2-gcc-c++

Further INFO : Please read my post here https://stackoverflow.com/questions/37774923/downgrading-c-c-compiler-on-fedora-23-to-a-matlab-r2016a-compatible-compiler/37776358#37776358


And devtoolset-3 provides g++-4.9.2 . No repo for Fedora 24, but with no extra dependencies for these EL7 packages, they install easily. ... The four packages :

devtoolset-3-gcc-4.9.2-6.2.el7.x86_64.rpm
devtoolset-3-gcc-c++-4.9.2-6.2.el7.x86_64.rpm
devtoolset-3-libstdc++-devel-4.9.2-6.2.el7.x86_64.rpm
devtoolset-3-runtime-3.1-12.el7.x86_64.rpm

... are available as one package, devtoolset-3-gcc-c++_el7.tar https://drive.google.com/file/d/0B7S255p3kFXNeElrMmc0TTlYLWM/view?usp=sharing

Unpack, and

cd devtoolset-3-gcc-c++_el7/
# dnf install ./*

Be aware that the command scl enable devtoolset-3 bash enables gcc/g++ v4.9 in the current terminal session only.


EDIT : A copy of the CentOS7 repo files and the "key file" works perfect in Fedora 24. Just copy {CentOS-SCLo-scl-rh.repo, CentOS-SCLo-scl.repo} to /etc/yum.repos.d/, and RPM-GPG-KEY-CentOS-SIG-SCLo to /etc/pki/rpm-gpg/ .

Files, CentOS-SCLo-scl-el7.tar.gz https://drive.google.com/file/d/0B7S255p3kFXNSnR0TkJKbm5qMDQ/view?usp=sharing

Install : # dnf install devtoolset-3-gcc-c++

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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