Ask Your Question
2

How to install gcc 6.4.1 on Fedora 26

asked 2017-08-16 23:01:44 -0500

isapir gravatar image

I'm trying to build CORE Network Emulator from source and I seem to have hit this gcc7 bug, so I want to install gcc 6.4.1 but when I try to run dnf install gcc-6.4.1 I get the error No package gcc-6.4.1 available

Running dnf list --all gcc shows only version 7.1.1-3

I downloaded gcc-6.4.1-1.fc25.x86_64.rpm from https://rpmfind.net/linux/rpm2html/se... but when I tried to run dnf install ./gcc-6.4.1-1.fc25.x86_64.rpm I got an error:

Problem: conflicting requests

  • nothing provides cpp = 6.4.1-1.fc25 needed by gcc-6.4.1-1.fc25.x86_64

How can I install gcc-6.4.1?

edit retag flag offensive close merge delete

Comments

There is a build for of 6.3.1 for F26 that I found here. Seems like the version got bumped to 7.x after that.

dnf install https://kojipkgs.fedoraproject.org//packages/gcc/6.3.1/2.fc26/x86_64/cpp-6.3.1-2.fc26.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/gcc/6.3.1/2.fc26/x86_64/gcc-6.3.1-2.fc26.x86_64.rpm

florian gravatar imageflorian ( 2017-08-17 03:03:10 -0500 )edit

The corresponding cpp packages must be downloaded as well and installed together with the gcc module. This how we resolved dependencies before we had yum or dnf to automate this.

villykruse gravatar imagevillykruse ( 2017-08-17 04:13:36 -0500 )edit

I guess that even if all dependencies are resolved conflicts will show up, probably it's better to download all gcc 6.4.1 related SRPMs, modify SPEC files changing installation prefix to something like /usr/local and rebuild all packages. Well, this is true if one wants to keep both gcc versions.

fcomida gravatar imagefcomida ( 2017-08-17 07:05:56 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
3

answered 2017-08-17 16:52:13 -0500

hedayat gravatar image

updated 2017-08-18 15:42:01 -0500

The bug you mentioned (which is NOT a gcc bug, but more a python incompatibility) apparently causes a warning, which will stop the compilation process if GCC is told to treat warnings as errors. Therefore, it seems that you can successfully compile the project with removing the flag (-Werror usually!) from compilation flags. It'll be much easier, and actually better, than trying to install an older version of GCC.

If you cannot solve the problem with above explanation, please provide the last executed command during the build and error messages. But if you see cc1: all warnings being treated as errors among the errors like the mentioned bug, you should do what I suggest! :P

Update: But for the actual question, while it is possible to install another version of GCC in Fedora, but it'd need some work. Personally, I'd suggest using Docker/Containers for this purpose: so, rather than installing another GCC in Fedora, I'd suggest using a docker image of an older version of Fedora which has the desired GCC version, install gcc on it and use that to compile your programs with another GCC version. It'd be probably the easiest solution these days...

edit flag offensive delete link more

Comments

+1 Not an answer to the question, but nevertheless a good answer to the real problem

villykruse gravatar imagevillykruse ( 2017-08-18 10:49:06 -0500 )edit

:) yeah... but I remembered a 'lazy' solution for that problem too, so I update the answer!

hedayat gravatar imagehedayat ( 2017-08-18 15:38:53 -0500 )edit

Thank you for the detailed explanation. I removed the -Werror flag from configure and that solved the issue for me.

isapir gravatar imageisapir ( 2017-08-19 12:01:17 -0500 )edit

:) You're welcome!

hedayat gravatar imagehedayat ( 2017-08-19 14:10:35 -0500 )edit
1

answered 2017-11-03 20:02:50 -0500

fcomida gravatar image
edit flag offensive delete link more
0

answered 2017-11-03 18:13:01 -0500

Hello, I would also like to install gcc-6.4.1-1.fc25 on my Fedora 26 system inorder to use the latest CUDA libraries with Caffe. How did you resolve the dependency conflict with libgomp-6.4.1-1.fc25? This conflicts with libgomp-7.1.1-2.fc26 that is already installed on my system. I'm not keen on using the force option, as I'm not sure if this will break my gcc7.

Is there a clear method that allows gcc6 and gcc7 to coexist?

Thanks! Senthil

edit flag offensive delete link more

Comments

Hi! You've posted an "Answer". If you have a question, please open a new one. If you want to comment about an existing question, add comments to the question. Thanks :)

hedayat gravatar imagehedayat ( 2017-11-12 14:25:53 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-08-16 22:45:53 -0500

Seen: 5,128 times

Last updated: Aug 18 '17