Replacing default gcc with 4.4

General support questions
Post Reply
mahmood
Posts: 122
Joined: 2017/06/04 12:21:09

Replacing default gcc with 4.4

Post by mahmood » 2018/11/11 18:36:05

Currently I have installed compat-gcc44 and I can run both gcc and gcc44. That is fine. However, wen I run gcc -v I get 4.8.3 version but I want to see 4.4.

That should be happen for one user only and it is not system wide. Is it safe to have

Code: Select all

export CC=/bin/gcc44
export CXX=/bin/g++44
in ~/.bashrc?

Any other idea?

mahmood
Posts: 122
Joined: 2017/06/04 12:21:09

Re: Replacing default gcc with 4.4

Post by mahmood » 2018/11/11 18:47:42

I have to say, that I am seeking a way to see 4.4 when I run gcc -v. That is, because an old version of OpenFOAM has some default rules, e.g Linux64Gcc.

So, the installation scripts create a string that depends on the gcc command. Therefore, if for any reason, it finds gcc44 instead of gcc, it will create Linux64Gcc44 and since there is no default rule for that, it gives me some error that the specified directory doesn't exists.

mahmood
Posts: 122
Joined: 2017/06/04 12:21:09

Re: Replacing default gcc with 4.4

Post by mahmood » 2018/11/11 18:51:13

Excuse me, I even tried

Code: Select all

alias gcc='gcc44'
alias cc='gcc44'
alias g++='g++44'
but don't know which one is better for my purpose. It seems that alias isn't a good way.

chemal
Posts: 776
Joined: 2013/12/08 19:44:49

Re: Replacing default gcc with 4.4

Post by chemal » 2018/11/11 18:51:34

wen I run gcc -v I get 4.8.3
Which means you are using an unsupported version of CentOS 7 from yesteryear.
Any other idea?
ln -s /usr/bin/gcc44 ~/bin/gcc and then put ~/bin at the front of yout $PATH.

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Replacing default gcc with 4.4

Post by TrevorH » 2018/11/11 20:17:41

We haven't shipped gcc 4.8.3 since 7.0 in 2014. You need to yum update to get up to date. There are literally hundreds of security updates that you are missing if you are running 7.0.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

mahmood
Posts: 122
Joined: 2017/06/04 12:21:09

Re: Replacing default gcc with 4.4

Post by mahmood » 2018/11/12 07:01:56

Thank you very much.
ln -s /usr/bin/gcc44 ~/bin/gcc and then put ~/bin at the front of yout $PATH.
Right.

Post Reply