I have access to a cluster with CentOS 7, which has gcc installed. Unfortunately, gcc version is pretty old (4.8), and is reported incompatible by some of the Python packages I am using, requiring version >5.0. However, since I do not have root privilege, I cannot easily install/delete anything there.
I have followed some answers from stack exchange, installing the gcc 8.4 from source code. The make install
seem to be successful.
Then, I have followed the accepted answer to one question here (How to set the default gcc version for only one user?) to change the default. However, it does not work for me.
- The gcc 8.4 is located at
$HOME/gcc_8_4
with a (seemingly properly working) symlink$HOME/bin/gcc
. - The gcc 4.8 is located at
/usr/local/bin
. $HOME/bin
comes before/usr/local/bin
in thePATH
, as written in the mentioned answer.- If I call
./gcc --version
from$HOME/bin/gcc/bin
directory, I get the version 8.4. If I call it asgcc --version
from any location, I still get 4.8.
So, has something changed since that answer was posted? Why the 4.8 version is taken as a default one despite it coming after 8.4 version in the PATH
? Is there any way to fix that?
which gcc; echo $PATH
?/usr/bin/gcc
and/home/iegorval/bin:/home/iegorval/miniconda3/envs/smaln/bin:/home/iegorval/miniconda3/condabin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin