Build GCC 4.8.1 or higher on CentOS 6.5 - gcc

I want to use GCC 4.8.1 or higher on a HPC machine with CentOS 6.5 which has a very old GCC. I do not have admin rights so everything has to be local. Do I have to really compile everything from source? Isn't there any rpm package that I can only install GCC with its dependencies? I found GCC rpms for CentOS 7 but not 6.5.

Without admin rights, building from source is
likely most reliable means to use gcc-4.8.1.
You can try installing (or extracting) gcc-4.8.1
from the redhat developer tool kit 2.0 described here
https://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos
CentOS 7 RPM's are unlikely to work in general on CentOS 6.x.
The developer 2.0 toolkit was built on CentOS6

Related

Would a program compiled in a Centos 7 environment run in a Centos 5.6 environment?

Does anyone have experience running a program compiled using gcc in a Centos 7 linux environment in a Centos 5.6 linux environment? Are there specific gcc compiler versions or command line options that can do the job?
We haven't tried compiling or running programs yet except, of course, on our current Centos 5.6 platform where our programs are currently compiling and running fine.
We are considering upgrading some (but, unfortunately, not all) of our systems to Centos 7 to enable access to certain tools and software applications not available for Centos 5.6.

Code compiled on RHEL 8 using gcc not working on RHEL 6. Getting error `GLIBC_2.14' not found

We are having an application which is built using gcc on RHEL 8.
When we run the executable for this application on RHEL 6 we are getting error `GLIBC_2.14' not found required by application.
What are the options which can make application built on RHEL 8 using gcc run on RHEL 6.
What are the options which can make application built on RHEL 8 using gcc run on RHEL 6.
Running the application in a docker container may be a reasonable option.
You could also install GLIBC-2.14 (or newer) in parallel to the system GLIBC. See this answer.

Is it possible to install gcc 5+ version on redhat 5?

I have developed a qt application on Ubuntu 16 but for testing I need to run it on redhat 5. But I am using c++11 standard features in my code and gcc (very old version on redhat) does not recognise this. I need to know is it possible to install gcc version (anything above than 5.0) on redhat 5?
I have already searched online but most of the links take me to redhat 7. Please note that I cannot upgrade to rhel 7.

Install GCC 4.8 on Redhat 7 in offline mode

How to install GCC 4.8 on RHEL 7 in offline mode? (not registered with Redhat).
I searched for a solution but couldn't find a proper one.
There are two options that we can use
1) Create a local yum repository from DVD/ISO file - Google search will throw lot of links. One such thing is https://access.redhat.com/solutions/1355683
2) Another option is use the Centos repository. Centos is derived from RHEL and should be safe. You can set this as you repository. But, I will go for the first one
Not sure about GCC 4.8, but V6.3.1 is available via the Developer Toolset. See https://developers.redhat.com/products/developertoolset/updates/
I'm believe GCC 5.3 may still be accessible too.
There's a no-cost RHEL developer subscription to download here: https://developers.redhat.com/products/rhel/download/
HTH

How do I get gcc-3.2.2 on RHEL 5?

We just had our hosting provider build out a new RHEL 5 box for us to test some legacy stuff on:
uname -a: Linux myserver.foo.com 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9 03:29:54 EST 2009 i686 i686 i386 GNU/Linux
cat /etc/redhat-release: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
gcc -v: gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)
I'm having a hell of a time figuring out how to get gcc-3.2.2 installed on this machine:
I can't seem to compile 3.2.2 with the gcc 4.1.2 compiler
I can't seem to find a 3.2.2 installation via yum
I'm afraid of what would happen if I rpm'd it manually
Any advice?
EDIT: thanks for the suggestions so far, but just to clarify - the "legacy stuff" I mentioned isn't actually my company's legacy stuff. It's a 3rd party package and I don't have access to the code (and wouldn't want to change it even if I did)
I guess I'll look into the chroot thing, because at this point going back to a different RHEL seems heartbreaking.
You could try to install a RHEL 4 machine, it has gcc 3.4 which might work to build your stuff. Then you could try running the binaries on your RHEL 5.
It may just be easier to debug the legacy code to work on gcc 4.
What I would suggest is installing the rpm manually within a chroot. You would have to google a lot for the method but it should in theory work well. Alternatively you could just rewrite/update your legacy code (yes, I know it is easier said than done).

Resources