-2

How to install gcc version 4.8 on centos or scientific linux operating systems which require yum for installing.

I tried to download gcc from https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/ and then ran ./configure and then make. After running make it gives me the error: configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details.

Is there some way by which I may install gcc version 4.8 on linux using yum install

I tried: 1). I tried with yum --enablerepo=testing-2-devtools-6 install devtoolset-2-gcc devtoolset-2-gcc-c++ it gives me repository not found

2). yum group install "Development Tools". It gives me Package gcc-4.4.7-11.el6.x86_64 already installed and latest version

3). building it from scratch, you'll have to do ./contrib/download_prerequisites first to get MPFR, GMP and MPC in the GCC source tree, then make a separate directory and run /path/to/gcc/source/configure. It gives:

configure: error: building out of tree but /home/Softwares/gcc-4.8.2 contains host-x86_64-unknown-linux-gnu

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Steg Verner
  • 893
  • 2
  • 12
  • 28
  • If you insist on building it from scratch, you'll have to do ```./contrib/download_prerequisites``` first to get MPFR, GMP and MPC in the GCC source tree, then make a separate directory and run ```/path/to/gcc/source/configure``` - GCC needs to build MPFR, GMP and MPC at the same time, and doesn't support in source builds (last time I tried it). – Commander Coriander Salamander Apr 22 '15 at 02:24
  • @CommanderCorianderSalamander I tried that but it gives me: configure: error: building out of tree but /home/Softwares/gcc-4.8.2 contains host-x86_64-unknown-linux-gnu – Steg Verner Apr 22 '15 at 02:29

2 Answers2

2

https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/3/html/3.0_Release_Notes/DTS3.0_Release.html#Features Install the Red Hat Developer Toolset 3.0 (or 2.X) in a way similar to what is described here. (Basically you use a repo someone else built for CentOS).

Community
  • 1
  • 1
phoeagon
  • 2,080
  • 17
  • 20
  • I tried with yum --enablerepo=testing-2-devtools-6 install devtoolset-2-gcc devtoolset-2-gcc-c++ it gives me repository not found – Steg Verner Apr 22 '15 at 02:23
1

Google says to try

yum group install "Development Tools"

check out: http://www.cyberciti.biz/faq/centos-rhel-7-redhat-linux-install-gcc-compiler-development-tools/

Will
  • 4,299
  • 5
  • 32
  • 50
  • It gives me Package gcc-4.4.7-11.el6.x86_64 already installed and latest version – Steg Verner Apr 22 '15 at 02:25
  • Hmmm... You could try uninstalling with "yum group remove {groupname}" then try again, or use --exclude option to install everything else. Also, I'm seeing "group install" as well as "groupinstall" both being used. – Will Apr 22 '15 at 02:33