-
-
Save craigminihan/b23c06afd9073ec32e0c to your computer and use it in GitHub Desktop.
sudo yum install libmpc-devel mpfr-devel gmp-devel | |
cd ~/Downloads | |
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O | |
tar xvfj gcc-4.9.2.tar.bz2 | |
cd gcc-4.9.2 | |
./configure --disable-multilib --enable-languages=c,c++ | |
make -j 4 | |
make install |
Thanks!
It takes infinity to build and install 😮
ftp 404
->
curl https://ftp.gnu.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
Life saver!
Works on Red Hat Enterprise Linux Server release 7.3 (Maipo).
ok, I can got it working, so how I can upgrade the cc compiler, because see below my console:
gcc --version
gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.cc --version
cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.thanks
I have the same problem for 5.2.0 on CentOS 7.6; after make install, gcc shows the new version but g++ shows 4.8.5!
Thanks,
Ajit
check current path of gcc with which gcc
, and then update symlink to your desired gcc path.
Thanks, but I didn't understand the instruction. My gcc already is the new one, it's the g++ that's the problem.
Looks like there was some problem with my original gcc, 4.8.5. I installed devtools-3 and rebuilt 5.2.0 with 4.9.2 from there. Now both gcc and g++ are the new version, 5.2.0.
Sorry about the noise, but thought this may help someone later, though I don't know exactly what the problem was in the first place.
Thanks, but I didn't understand the instruction. My gcc already is the new one, it's the g++ that's the problem.
My bad.
What I meant was to check the different versions of g++
/gcc
that you have and create a symbolic link to the desired g++
/gcc
.
So how to uninstall gcc built by this method? Thank you
Душевно
Hi
maybe you need to run :
./contrib/download_prerequisites
before running "./configure ... " command
I used make -j$(nproc)
and it went much faster too.
The command sequence below worked on my computer to update to version 7:
sudo yum -y install centos-release-scl
sudo yum -y install devtoolset-7
scl enable devtoolset-7 bash
gcc --version
The command sequence below worked on my computer to update to version 7:
sudo yum -y install centos-release-scl
sudo yum -y install devtoolset-7
scl enable devtoolset-7 bash
gcc --version
this actually fixed an issue i had with node-canvas
npx node-pre-gyp rebuild -C ./node_modules/canvas
gcc version 4.8.5 was not working
Tremendous!
Thanks. Save my day
But
-j 4
?... took hours for just 4 cpu.I used
--j
instead like @JBandassociate indicated