I am trying to install gcc and g++ 4.9.2 on Linux. I'm pretty new with Linux and i saw some guides of how to install, but each time I encountered with another problem. I don't have any gcc right now on my machine. my Linux version is: Red Hat Enterprise Linux Server release 7.4 (Maipo) can someone help me and give me instructions from the beginning to the end how to do this properly? thank you very much.
RHEL comes with preconfigured repo, you can search for the desired packages and install them using yum package manager.
To do so, first run ( to search gcc
)
$ sudo yum search gcc
which will show you a list of available packages with the matching name
============================ Name Exactly Matched: gcc =============================
gcc.x86_64 : Various compilers (C, C++, Objective-C, ...)
gcc.x86_64 : Various compilers (C, C++, Objective-C, ...)
gcc.i686 : Various compilers (C, C++, Objective-C, ...)
=========================== Name & Summary Matched: gcc ============================
gcc-c++.x86_64 : C++ support for GCC
gcc-c++.i686 : C++ support for GCC
gcc-gdb-plugin.x86_64 : GCC plugin for GDB
gcc-gdb-plugin.i686 : GCC plugin for GDB
gcc-gdb-plugin.x86_64 : GCC plugin for GDB
gcc-objc.x86_64 : Objective-C support for GCC
...
Install the package you need by running ( to install gcc-c++
)
$ sudo yum install gcc-c++
It will the packages to be installed and ask for confirmation.
Dependencies resolved.
====================================================================================
Package Architecture Version Repository Size
====================================================================================
Installing:
gcc-c++ x86_64 8.3.1-2.fc29 updates 12 M
Transaction Summary
====================================================================================
Install 1 Package
Total download size: 12 M
Installed size: 29 M
Is this ok [y/N]:
NOTE: Steps mentioned above will install latest available version of the package.
Install a particular Version of a Package
Install all development tools
yum search gcc-c++
you will get a list of available packages, then install the package mentioning the correct name. –
Spermic # yum search gcc-c++
to know what's available. ( If you have run # yum-config-manager --enable rhel-server-rhscl-7-rpms
) –
Cyclostome scl enable devtoolset-3 bash
before loading program you compiled using GCC 4.9 library. –
Myasthenia yum install centos-release-scl-rh
yum install devtoolset-3-gcc devtoolset-3-gcc-c++
update-alternatives --install /usr/bin/gcc-4.9 gcc-4.9 /opt/rh/devtoolset-3/root/usr/bin/gcc 10
update-alternatives --install /usr/bin/g++-4.9 g++-4.9 /opt/rh/devtoolset-3/root/usr/bin/g++ 10
source scl_source enable devtoolset-3
–
Spermatophyte $ scl enable devtoolset-3 bash
softwarecollections.org/en/scls/rhscl/devtoolset-3 –
Cyclostome devtoolset-3
was EOL on Oct 2016. If you need the newer version of GCC, check the latest sevtoolset
version in the Software Collections site: softwarecollections.org/en/scls/user/rhscl/… –
Miles For installing the system compilers gcc, g++, the install command is # yum install gcc-c++
→ Provides version 4.8.5 : /usr/bin/{ gcc, g++ }
.
Other options: 1. gcc53-c++-5.3.0-1.el6.x86_64.rpm → https://drive.google.com/file/d/0B7S255p3kFXNRm9FVnZYUnhyZzg/view?usp=sharing&resourcekey=0-1N6zQa6Sbl_WycG1O9I7JA : Download and install : # cd Downloads/ && yum install ./gcc53-c++-5.3.0-1.el6.x86_64.rpm
..... Provides /usr/bin/{gcc53, g++53}
.
- The devtoolset´s : https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ →
# yum-config-manager --enable rhel-server-rhscl-7-rpms
Install gcc, g++ version 4.9.2 : # yum install devtoolset-3-gcc-c++
Note : You can have as many gcc/g++ versions as you want, installed at the same time. ( The system compilers are a must.)
- gcc49-c++-4.9.3-1.el6.x86_64.rpm https://drive.google.com/file/d/1Pwq1ua80dGM72i7rpDNAIIdfcR1WK-hG/view?usp=sharing → Provides
/usr/bin/{gcc49, g++49}
.
gcc63-c++-6.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1t4WrgvpEP-6_NN3qMJhz9MS3CJhHrHKc/view?usp=sharing → Provides
/usr/bin/{gcc63, g++63}
.gcc45-c++-4.5.4-1.el7.x86_64.rpm https://drive.google.com/file/d/15aRg-BPhuyaEyZA9Jy-iAyC21_pwN7nD/view?usp=sharing → Provides
/usr/bin/{gcc45, g++45, gfortran45}
gcc42-c++-4.2.4-1.el6.x86_64.rpm https://drive.google.com/file/d/1eYWk6Nd63xeqqAUoJldNWRuwEGO6cAyv/view?usp=sharing → Provides
/usr/bin/{gcc42, g++42}
gcc73-c++-7.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1PgwCP5tu8D0EJbJVTqJd7Vg8dJ4l4noi/view?usp=sharing → Provides
/usr/bin/{gcc73, g++73}
gcc48-c++-4.8.5-1.el6.x86_64.rpm https://drive.google.com/file/d/1w6fW6oSflDDYZt_cOpGj3QMEmzUC8Q9L/view?usp=sharing → Provides
/usr/bin/{gcc48, g++48, gfortran48}
gcc84-c++-8.4.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1xgFtsiDi2uiB1B0AcOaSpxVizzET-pJf/view?usp=sharing → Provides
/usr/bin/{gcc84, g++84, gfortran84}
devtoolset-6
link : Click CentOS 7 → mirror.centos.org/centos/7/sclo/x86_64/rh → devtoolset -3 -4 -6 -7 : devtoolset-6 has gcc-6.3.1 : # yum install devtoolset-6-gcc-c++
: gcc-6 a.o. will automatically be installed as dependencies. mirror.centos.org/centos/7/sclo/x86_64/rh/devtoolset-6 . ....... About gcc53-c++-5.3.0-1.el6.x86_64.rpm : Provides /usr/bin/{gcc53, g++53}. –
Cyclostome gcc84-c++-8.4.0-1.el7.x86_64.rpm
is ok. I will use it. –
Norford RHEL comes with preconfigured repo, you can search for the desired packages and install them using yum package manager.
To do so, first run ( to search gcc
)
$ sudo yum search gcc
which will show you a list of available packages with the matching name
============================ Name Exactly Matched: gcc =============================
gcc.x86_64 : Various compilers (C, C++, Objective-C, ...)
gcc.x86_64 : Various compilers (C, C++, Objective-C, ...)
gcc.i686 : Various compilers (C, C++, Objective-C, ...)
=========================== Name & Summary Matched: gcc ============================
gcc-c++.x86_64 : C++ support for GCC
gcc-c++.i686 : C++ support for GCC
gcc-gdb-plugin.x86_64 : GCC plugin for GDB
gcc-gdb-plugin.i686 : GCC plugin for GDB
gcc-gdb-plugin.x86_64 : GCC plugin for GDB
gcc-objc.x86_64 : Objective-C support for GCC
...
Install the package you need by running ( to install gcc-c++
)
$ sudo yum install gcc-c++
It will the packages to be installed and ask for confirmation.
Dependencies resolved.
====================================================================================
Package Architecture Version Repository Size
====================================================================================
Installing:
gcc-c++ x86_64 8.3.1-2.fc29 updates 12 M
Transaction Summary
====================================================================================
Install 1 Package
Total download size: 12 M
Installed size: 29 M
Is this ok [y/N]:
NOTE: Steps mentioned above will install latest available version of the package.
Install a particular Version of a Package
Install all development tools
yum search gcc-c++
you will get a list of available packages, then install the package mentioning the correct name. –
Spermic # yum search gcc-c++
to know what's available. ( If you have run # yum-config-manager --enable rhel-server-rhscl-7-rpms
) –
Cyclostome scl enable devtoolset-3 bash
before loading program you compiled using GCC 4.9 library. –
Myasthenia © 2022 - 2024 — McMap. All rights reserved.