Redhat's RHEL8 equivalent of "apk add --no-cache gcc musl-dev linux-headers" - rhel

I am trying this sample code from "https://docs.docker.com/compose/gettingstarted on Python installed on RedHat enterprise linux 7 / 8 image.
Getting error 127 on this line
RUN apk add --no-cache git gcc musl-dev linux-headers
Thanks

On Red Hat Enterprise Linux, installing the gcc package installs both the system C compiler and the C library development files, including the required UAPI kernel headers. So this command is sufficient to install a C development environment:
yum install gcc
If you need the C++ compiler, you should use this instead:
yum install gcc-c++

Related

I want to install G++ on my Linux Mint but not able to do so

I want to install g++ for using GROMACS on Linux mint. I typed the following command:
sudo apt-get install g++
It successfully installs the g++ but when I change the directory to Downloads to configure and make cmake and fftw, it (Downloads) is empty.
I have tried removing sudo apt-get remove g++ and re-installing g++ but it shows the same result. I don't know where it is downloading g++.
The command apt-get install g++ doesn't download any executables into your current directory or in the ~/Downloads/ directory.
Usually, it is installed in /usr/bin.
You can check for g++ with the command g++ --version.
Also, you can see where it is installed with whereis g++.
The build-essential package is a reference for all the packages needed
to compile a Debian package. It generally includes the GCC/g++
compilers and libraries and some other utilities
https://superuser.com/a/151558
For this purpose install them with command sudo apt install build-essential
and it will install all the things

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++

Simulating RISCV on RHEL5 -- Missing libmpc-devel

My goal is to simulate RISCV in VCS on RHEL 5.11.
I am following the lowRISC tagged memory tutorial, environment setup guide:
http://www.lowrisc.org/docs/tagged-memory-v0.1/setup/
The apt-get commands are substituted with yum and equivalent packages, per the GNU toolchain repo readme:
https://github.com/riscv/riscv-gnu-toolchain
sudo yum install autoconf automake libmpc-devel mpfr-devel gmp-devel gawk bison flex texinfo patchutils gcc gcc-c++
The libmpc-devel package cannot be found, and I cannot build GCC for RISCV without it.
I believe this package can be found for RHEL6, but I do not have VCS available on a RHEL6 machine.
Is there a workaround for this issue -- e.g. can I build GCC for RISCV on another machine, then do compilation and simulation on different boxes?

Installing g++ 5 on Amazon Linux

I'm trying to install g++ 5.x on an EC2 instance running Amazon Linux; in Amazon's central repository the latest version is 4.8.3. What configuration to can I make to allow yum to find a newer gcc-c++ package?
Late to the party, but for those like me:
sudo yum install gcc72 gcc72-c++
For Amazon Linux 2, you have to install the following
sudo yum install -y gcc-c++
It's a requirement to install some Ruby gems that need native extensions
Installing gcc5:
# Install required libraries
sudo yum install libmpc-devel mpfr-devel gmp-devel
# Gather source code
export GCC_VERSION=5.5.0
cd /tmp
curl -o "gcc-${GCC_VERSION}.tar.gz" \
https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc- ${GCC_VERSION}.tar.gz
tar xvzf "gcc-${GCC_VERSION}.tar.gz"
cd gcc-${GCC_VERSION}
# Configure and compile
./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
make -j 8
# Install
sudo make install
Ensure /usr/local/bin/ is in your PATH
You may advantageously install version 7.3.0 released on 25th January 18 here
You can run yum whatprovides g++ and it will output a list of different packages versions that provide the the g++ file.
example output:
...
gcc-c++-7.3.1-12.amzn2.x86_64 : C++ support for GCC
Repo : amzn2-core
Matched from:
Filename : /usr/bin/g++
gcc-c++-7.3.1-13.amzn2.x86_64 : C++ support for GCC
Repo : amzn2-core
Matched from:
Filename : /usr/bin/g++
On Amazon Linux 2 you can run sudo yum groupinstall "Development Tools" which will install many compilers and dependencies including g++
Probably like "amazon linux ami release 2016.03", when you have gcc-4.8.3 .
This OS is very close to CentOS 7.2 / RHEL 7.
Please try : # yum install centos-release-scl
If OK, you can do : # yum install devtoolset-4-gcc-c++ ... and get g++, gcc version 5.2.1 .
Enabling "5.2.1" : $ scl enable devtoolset-4 bash . Be aware that the setting is valid for the current terminal session only.
If any issues, I can supply a link to the four packages required for g++, gcc.

gcc-arm-linux-gnueabi command not found

I am trying to install the gnu arm toolchain for ubuntu. I first downloaded the tar from CodeSourcery. However when I go into the bin folder, I cannot run any of the binaries. I have tried with ./ and without and putting it in the PATH and it keeps telling me "Command not Found" yet the file is there in the folder right in front of me. Then I tried sudo apt-get install gcc-arm-linux-gnueabi except after it says it has installed successfully, I cannot find it with whereis gcc-arm-linux-gnueabi. Can anyone help?
fixed, using:
sudo apt-get install gcc-arm*
Are you compiling on a 64-bit OS? Try:
sudo apt-get install ia32-libs
I had the same problem when trying to compile the Raspberry Pi kernel. I was cross-compiling on Ubuntu 12.04 64-bit and the toolchain requires ia32-libs to work on on a 64-bit system.
See http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
CodeSourcery convention is to use prefix arm-none-linux-gnueabi- for all executables, not gcc-arm-linux-gnueabi that you mention. So, standard name for CodeSourcery gcc would be arm-none-linux-gnueabi-gcc.
After you have installed CodeSourcery G++, you need to add CodeSourcery directory into your PATH.
Typically, I prefer to install CodeSourcery into directory like /opt/arm-2010q1 or something like that. If you don't know where you have installed it, you can find it using locate arm-none-linux-gnueabi-gcc, however you may need to force to update your locate db using sudo updatedb before locate will work properly.
After you have identified where your CodeSourcery is installed, add it your PATH by editing ~/.bashrc like this:
PATH=/opt/arm-2010q1/bin:$PATH
Also, it is customary and very convenient to define
CROSS_COMPILE=arm-none-linux-gnueabi-
in your .bashrc, because with CROSS_COMPILE defined, most tools will automatically use proper compiler for ARM compilation without you doing anything.
if you are on 64 bit os then you need to install this additional libraries.
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
got the same error when trying to cross compile the raspberry pi kernel on ubunto 14.04.03 64bit under VM. the solution was found here:
-Install packages used for cross compiling on the Ubuntu box.
sudo apt-get install gcc-arm-linux-gnueabi make git-core ncurses-dev
-Download the toolchain
cd ~
git clone https://github.com/raspberrypi/tools
-Add the toolchain to your path
PATH=$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
notice the x64 version in the path command
I was also facing the same issue and resolved it after installing the following dependency:
sudo apt-get install lib32z1-dev
If you are on a 64bit build of ubuntu or debian (see e.g. 'cat /proc/version') you should simply use the 64bit cross compilers, if you cloned
git clone https://github.com/raspberrypi/tools
then the 64bit tools are in
tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
use that directory for the gcc-toolchain.
A useful tutorial for compiling that I followed is available here Building and compiling Raspberry PI Kernel (use the -x64 path from above as ${CCPREFIX})
You have installed a toolchain which was compiled for i686 on a box which is running an x86_64 userland.
Use an i686 VM.
Its a bit counter-intuitive. The toolchain is called gcc-arm-linux-gnueabi. To invoke the tools execute the following: arm-linux-gnueabi-xxx
where xxx is gcc or ar or ld, etc
try the following command:
which gcc-arm-linux-gnueabi
Its very likely the command is installed in /usr/bin.
I had to cross compile C code in Ubuntu for ARM. This worked for me:
$ sudo apt install gcc-arm-none-eabi
Later, tested it on the qemu emulator
#Install qemu
sudo apt-get install qemu qemu-user-static qemu-system-arm
#Cross compile "helloworld.c"
$ arm-none-eabi-gcc --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group helloworld.c -o helloworld
#Run
qemu-arm-static helloworld

Resources