How to install gcc 4.7.3 on CentOS? - linux

I want to install gcc 4.7.3 on centos, but I use yum search gcc like that:
yum search gcc
it show me too many information to choose:
gcc-c++.x86_64 : C++ support for GCC
gcc-gnat.x86_64 : Ada 95 support for GCC
gcc-objc.x86_64 : Objective-C support for GCC
gcc-objc++.x86_64 : Objective-C++ support for GCC
gcc-plugin-devel.x86_64 : Support for compiling GCC plugins
libgcc.i686 : GCC version 4.8 shared support library
libgcc.x86_64 : GCC version 4.8 shared support library
relaxngcc-javadoc.noarch : Javadoc for relaxngcc
compat-gcc-44.x86_64 : Compatibility GNU Compiler Collection
compat-gcc-44-c++.x86_64 : C++ support for compatibility compiler
I don't know which one is gcc 4.7.3. I want to write install to Dokcerfile, please tell me how to install it in simple way. just using command via Terminal
Then,I using the command:
yum instal gcc-4.7.3
It show :
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Loading mirror speeds from cached hostfile
* base: mirror.neu.edu.cn
* extras: mirror.neu.edu.cn
* updates: mirror.neu.edu.cn
No package gcc-4.7.3 available.
Error: Nothing to do

I believe it is not possible to get 4.7.3 with devtools, instead, the devtools package would install you a gcc version 4.7.2.
devtoolset-1.1 package contains gcc-4.7.2
Follow the below commands to install devtoolset.
cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo
yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++
gcc is located in /opt/centos/devtoolset-1.0/root/usr/bin/ and so you will have to update $PATH
export PATH=/opt/centos/devtoolset-1.0/root/usr/bin/:$PATH
Now the gcc version should be version 4.7.2
You can check it using gcc -v command.
NOTE: There is an option for you download the source and build to get the latest changes in the devtoolset package.

Related

Building GCC 11.2 on Amazon Linux 2

While attempting to build GCC version 11.3 for Linux-x86_64 (with multilib and multiarch support enabled), I am getting the following error:
In file included from /usr/include/features.h:447,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from /home/slagathor/Developer/gcc-11.3.0/libgcc/../gcc/tsystem.h:87,
from /home/slagathor/Developer/gcc-11.3.0/libgcc/generic-morestack.c:32:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory
7 | # include <gnu/stubs-32.h>
From what I can tell this means that I don't have glibc-devel (32-bit version) installed; however when attempting to install it via YUM I get the following output:
$ sudo yum install glibc-devel.i686
Loaded plugins: amzn_workspaces_filter_updates, halt_os_update_check, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
firefox | 2.9 kB 00:00:00
workspaces-internal-dependencies | 2.2 kB 00:00:00
No package glibc-devel.i686 available.
I am using an Amazon Linux Workspace, any assistance would be helpful.
Maybe you are using centos so you need to go to chrome and search for "How to install glibc-devel.i686 for centos".

how to install gcc 4.9.2 on RHEL 7.4

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.
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
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}
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
For CentOS run this command
yum install gcc-c++

How to change the default compiler of Linux Mint 18.0 from version 5.3.1 to a version below 4.0?

I need to compile a special program (i.e. configuring, making, and making install processes of nest) by an old version of g++ such as 3.3 or 3.4. However, I don't have such versions in my package manager.
I downloaded g++-3.0-3.0.4-7_alpha-deb, but I don't know if it is the true version for Linux, or how can I install it and set as the default compiler. I will appreciate if any one informs me of its possible dangers to my Linux (as I read in Google).
First : You can have as many versions of gcc, g++ as you want, installed at the same time.
The default Mint 18, Ubuntu 16.04 versions are :
sudo apt install g++ g++-4.7 g++-4.8 g++-4.9
The reliable gcc, g++ version 3.4.6 : compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb
https://drive.google.com/file/d/0B7S255p3kFXNRTkzQnRSNXZ6UVU/view?usp=sharing
, and compat-gcc-34-c++_3.4.6-20_amd64.deb https://drive.google.com/file/d/0B7S255p3kFXNV3J3bnVoWGNWdG8/view?usp=sharing
Please install with sudo dpkg -i compat-gcc*
Using, examples : 1) export CC=gcc34 CXX=g++34 && [other command] , like 2) export CC=gcc34 CXX=g++34 && ./configure ... and 3) make CC=gcc34 CXX=g++34

R package installation in Linux

I am trying to install a R package in Ubuntu using the following commands:
R CMD INSTALL rpart_4.1-5.tar.gz
install.packages("/home/rpart_4.1-5.tar.gz", repos = NULL, type="source")
* installing to library '/R/library'
* installing *source* package 'rpart' ...
** package 'rpart' successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package 'rpart'
* removing '/R/library/rpart'
I have GCC 4.8.2 installed and the command gcc -v provides the following output:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/tools/stow/gcc-4_8_2-2.x86-64.linux.centos.5/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8.2/configure --prefix=/mnt/gcc/buildir/gcc-4.8.2
Thread model: posix
gcc version 4.8.2 (GCC)
Last time I face the same issue, installing GCC (same version) solved it (posted a similar query on Stackoverflow on this topic). However, this time it is not working. Could someone please let me know what is causing this issue.
UPDATE: We are trying to manually install the dependencies to see if it works. We have installed Make and GCC 4.8.2:
However, I still get the following error:
* installing to library '/opt/vertica/R/library'
* installing *source* package 'rpart' ...
** package 'rpart' successfully unpacked and MD5 sums checked
** libs
cc -std=gnu99 -I/opt/vertica/R/include -DNDEBUG -I/usr/local/include -fpic -c anova.c -o anova.o
make: cc: Command not found
make: *** [anova.o] Error 127
ERROR: compilation failed for package 'rpart'
* removing '/opt/vertica/R/library/rpart'
Are there any other dependencies that we need to install apart from Make and GCC?
Your system doesn't have make utility for compilation.
Please execute following command to install make in your system.
sudo apt-get install build-essential
If you just do
sudo apt-get install r-base-dev
you all the key dependencies relevant for R package building which is what you want here. This includes the compiler, make etc as part of built-essential as well as specific libraries needed by R. There is a reason we created this package :)
If your machine does not have permanent internet access, look for previously-asked questions about "apt-get without internet access" etc.

Haskell cabal install: missing C library iw

I'm running Fedora 19 x64, and
I'm trying to install xmobar via cabal install. After installing a bunch of dependencies, I'm stuck at
cabal: Missing dependency on a foreign library:
* Missing C library: iw
I can't find anything about this iw library and I'm a bit lost at how to continue.
I've got all of the standard c libs installed, as far as I can tell.
sudo yum install glibc-common glibc glibc-devel glibc-headers glibc-utils glibc-devel glib2-devel gcc-c++ gcc
Loaded plugins: auto-update-debuginfo, langpacks, refresh-packagekit
Package glibc-common-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-devel-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-headers-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-utils-2.17-18.fc19.x86_64 already installed and latest version
Package glibc-devel-2.17-18.fc19.x86_64 already installed and latest version
Package glib2-devel-2.36.3-3.fc19.x86_64 already installed and latest version
Package gcc-c++-4.8.1-1.fc19.x86_64 already installed and latest version
Package gcc-4.8.1-1.fc19.x86_64 already installed and latest version
Nothing to do
Under Ubuntu the same workaround:
cabal: Missing dependency on a foreign library:
* Missing C library: iw
was resolved though I thought that it can be also two libraries for C language build tools:
liwc : Tools for manipulating C source code
iwyu : Analyze #includes in C and C++ source files
after these additions & libiw-dev library new xmobar was compiled.
Libraries are packaged differently by your OS. For fedora, if you're missing library A, you often will find packages named libA and libA-devel. Luckily, you don't need to guess - instead just ask yum what packages has some file of interest. Below, I asked about the shared object file libiw.so.
yum whatprovides *libiw.so*
...
1:wireless-tools-devel-29-9.1.fc19.x86_64 : Development headers for the
: wireless-tools package
Repo : fedora
Matched from:
Filename : /usr/lib64/libiw.so
1:wireless-tools-29-9.1.fc19.x86_64 : Wireless ethernet configuration tools
Repo : installed
Matched from:
Provides : libiw.so.29()(64bit)
Filename : /lib64/libiw.so.29
I'm surprised Fedora would install without these packages, but if that's the case then obtaining the packages is just a yum install command away.
For anyone trying to install xmobar through cabal on arch,
the missing package that includes iw is called wireless_tools.
You can install that with
pacman -S wireless_tools

Resources