Discussion:
Linux unable to find the correct gcc
Syed Ahsan Ali Bokhari
2014-08-26 07:32:44 UTC
Permalink
I have compiled gcc 4.9 in CentOS 6.5 which had gcc 4.4.7 by default.
the default gcc is contained is /usr/bin directory. I have compiled a
newer version gcc 4.9 in /usr/local/gcc4.9 directory and added this
path in .bashrc as folllow

export PATH=$PATH:/usr/local/gcc-4.9.1/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc-4.9.1/lib/

But still the Linux find the gcc4.4.7 version and unable to find the
newly compiled one.

Ahsan
Markus Trippelsdorf
2014-08-26 07:36:25 UTC
Permalink
Post by Syed Ahsan Ali Bokhari
I have compiled gcc 4.9 in CentOS 6.5 which had gcc 4.4.7 by default.
the default gcc is contained is /usr/bin directory. I have compiled a
newer version gcc 4.9 in /usr/local/gcc4.9 directory and added this
path in .bashrc as folllow
export PATH=$PATH:/usr/local/gcc-4.9.1/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc-4.9.1/lib/
You probably want: export PATH=/usr/local/gcc-4.9.1/bin:$PATH

You can also use "make CC=/usr/local/gcc-4.9.1/bin/gcc" to build the
kernel.
--
Markus
Jonathan Wakely
2014-08-26 09:06:37 UTC
Permalink
Post by Syed Ahsan Ali Bokhari
I have compiled gcc 4.9 in CentOS 6.5 which had gcc 4.4.7 by default.
the default gcc is contained is /usr/bin directory. I have compiled a
newer version gcc 4.9 in /usr/local/gcc4.9 directory and added this
path in .bashrc as folllow
export PATH=$PATH:/usr/local/gcc-4.9.1/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc-4.9.1/lib/
But still the Linux find the gcc4.4.7 version and unable to find the
newly compiled one.
Ahsan
Wasn't this already explained three weeks ago?

https://gcc.gnu.org/ml/gcc-help/2014-08/msg00043.html
Syed Ahsan Ali Bokhari
2014-08-27 04:44:41 UTC
Permalink
Yes, I am at mistake. Actually on another system the other way works
i.e export PATH=$PATH:/usr/local/gcc-4.9.1/bin and I copied the paths
from that system. Failing to remember that previously explained answer
on gcc-help.
Thanks for correcting me again. I'll be learning from such mistakes.
Ahsan
Post by Jonathan Wakely
Post by Syed Ahsan Ali Bokhari
I have compiled gcc 4.9 in CentOS 6.5 which had gcc 4.4.7 by default.
the default gcc is contained is /usr/bin directory. I have compiled a
newer version gcc 4.9 in /usr/local/gcc4.9 directory and added this
path in .bashrc as folllow
export PATH=$PATH:/usr/local/gcc-4.9.1/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gcc-4.9.1/lib/
But still the Linux find the gcc4.4.7 version and unable to find the
newly compiled one.
Ahsan
Wasn't this already explained three weeks ago?
https://gcc.gnu.org/ml/gcc-help/2014-08/msg00043.html
Loading...