On an Amazon Linux 2 Docker image, "yum install gcc" installs gcc 7.3.1.
I want to install gcc 8. It seems it normally can be installed as part of "devtoolset-8" (https://www.softwarecollections.org/en/scls/rhscl/devtoolset-8/), but the instructions for either CentOS or RHEL seems not working on Amazon Linux.
So the only way to install gcc 8 on Amazon Linux is to install from source?
I also need the devtoolset-8-toolchain, how can that be installed?
Add the scl repo for centos:
sudo yum-config-manager --add-repo http://mirror.centos.org/centos/7/sclo/x86_64/rh/
Install this libgfortran dependency required for devtoolset-8:(source)
sudo yum install -y wget
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libgfortran5-8.3.1-2.1.1.el7.x86_64.rpm
sudo yum install libgfortran5-8.3.1-2.1.1.el7.x86_64.rpm -y
Install devtoolset-8 with nogpgcheck:(it would be much better to install the key for the repo)
sudo yum install -y devtoolset-8 --nogpgcheck
Finally enable the scl for devtoolset-8:
scl enable devtoolset-8 bash
Running this command shows both the gcc 7 and gcc 8 in the path:
which -a gcc
Output from which -a gcc
/opt/rh/devtoolset-8/root/usr/bin/gcc
/usr/bin/gcc
Related
I compile in Ubuntu 20.04 with gcc 7.5.0 and g++ 7.5.0(supporting cilk plus), but the error says that 'cilk/cilk.h: No such file or directory'the error is shown in the picture
Anybody could help me with the situation? Thanks a lot!
Your compiler still doesn't support cilkplus, just install it via apt-get install:
sudo apt-get install -y libcilkrts5
there you go,
UPDATE: Cilk is not supported with the gcc package on ubuntu 20.04,
to have cilk on ubuntu 20.04 you have to install gcc version < 7 , by the following instruction it's possible to install gcc-6 g++6 on ubuntu 20.04,
sudo vim /etc/apt/sources.list
add "deb http://dk.archive.ubuntu.com/ubuntu/ bionic main universe" to file
sudo apt update
sudo apt-get install gcc-6 g++-6 -y
check by gcc -v if you have downgraded correctly the gcc version Then the cilk extension should work.
I have problems with R-studio installation for Ubuntu 16.04 32-bit. I found out a reason for my problem here - https://mikewilliamson.wordpress.com/2016/11/14/installing-r-studio-on-ubuntu-16-10/. But the script examples are for 64-bit machine and I don't quite understand how I can change them for my 32-bit machine.
Does somebody had the same problems? How did you solve it?
o Install R 3.4.1 and Rstudio on ubuntu 16.04 LTS on 32 bit machine :
Carry out following steps :
cd $HOME
wget https://cran.rstudio.com/src/base/R-3/R-3.4.1.tar.gz
tar xvf R-3.4.1.tar.gz
cd R-3.4.1
sudo apt-get install gcc fort77 aptitude
sudo aptitude install g++
sudo aptitude install xorg-dev
sudo aptitude install libreadline-dev
sudo aptitude install gfortran
gfortran --version
sudo apt install libpcre3-dev liblzma-dev libbz2-dev
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
sudo apt-get install texlive-base
sudo apt-get install texinfo
sudo apt-get install texlive-fonts-extra
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libcairo2-dev libpng-dev zlib1g-dev libpixman-1-dev libxt-dev
java -version
need to build shared library (--enable-R-shlib)
the --enable-R-shlib option is needed for the RStudio IDE to work
sudo ./configure --enable-R-shlib
sudo make
sudo make install
R --version
cd $HOME
rm R-3.4.1.tar.gz
sudo rm -rf R-3.4.1
Only one warning is shown during compilation:
main.c: In function ‘dummy_ii’:
main.c:1669:12: warning: function returns address of local variable [-Wreturn-local-addr]
return (uintptr_t) ⅈ
^
Now you can install Rstudio (here for a 32 bits system; choose the correct one for you here https://www.rstudio.com/products/rstudio/download/):
sudo apt-get install gdebi-core
wget https://download1.rstudio.org/rstudio-1.0.143-i386.deb
sudo gdebi -n rstudio-1.0.143-i386.deb
rm rstudio-1.0.143-i386.deb
To know if you have a 32-bits or 64-bits system, enter:
uname -a
The machine hardware name lists whether your system is 32-bit (“i686” or “i386”) or 64-bit (“x86_64”).
For further details refer the link :
https://biostatsr.blogspot.in/2017/06/install-r-340-and-rstudio-on-ubuntu.html
It seems current versions of RStudio in Ubuntu 16.04 are not supported for 32-bit. So I enabled i386 architecture (https://blog.teststation.org/ubuntu/2016/05/12/installing-32-bit-software-on-ubuntu-16.04/) in order to install previous Ubuntu 32-bit versions.
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libstdc++6:i386
Then I was able to install RStudio 1.1.442 - Ubuntu 12.04-15.10/Debian 8 (32-bit) (https://download1.rstudio.org/rstudio-1.1.442-i386.deb). It worked for my Xubuntu 16.04 (32-bit)
The steps I've taken are below. During the ./configure step, unless I allow the system default for the cuDNN version (v5) instead of specifying v5.1.5 (as I want), I get an error saying that the environment version (v5) for cuDNN doesn't match the target version (5.1.5). Since I have downloaded the cuDNN v5.1.5 file for CUDA 8.0 from Nvidia I'm baffled.
What's more, after digging through https://github.com/tensorflow/tensorflow/blob/master/third_party/gpus/cuda_configure.bzl around line 240, I'm seeing that the version the bazel configure script checks against seems to only take into account the Major numeral of the cuDNN version (my Major, Minor and Patch numerals within cudnn.h are 5, 1, 5 respectively). So, I'm uncertain as to how it would ever allow version 5.1.5 to be installed. Maybe I'm looking at it wrong?
In any case, does anyone have a method of installing cuDNN 5.1.5 with CUDA 8.0 and Tensorflow 0.12 on a g2.2xlarge instance?
Thanks!
Steps
(Note: these work, but it installs cuDNN 5.0, not 5.1.5 as desired)
Provisioning
follow provisioning steps from: https://medium.com/#giltamari/tensorflow-getting-started-gpu-installation-on-ec2-9b9915d95d6f#.2hv67eeek
(i.e. up to but not including: sudo apt-get update && sudo apt-get -y upgrade)
Installing dependencies and tools
familiarize self with:
http://expressionflow.com/2016/10/09/installing-tensorflow-on-an-aws-ec2-p2-gpu-instance/
http://ramhiser.com/2016/01/05/installing-tensorflow-on-an-aws-ec2-instance-with-gpu-support/
https://alliseesolutions.wordpress.com/2016/09/08/install-gpu-tensorflow-from-sources-w-ubuntu-16-04-and-cuda-8-0-rc/
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y build-essential git python-pip libfreetype6-dev libxft-dev libncurses-dev libopenblas-dev gfortran python-matplotlib libblas-dev liblapack-dev libatlas-base-dev python-dev python-pydot linux-headers-generic linux-image-extra-virtual unzip python-numpy swig python-pandas python-sklearn unzip wget pkg-config zip g++ zlib1g-dev libcurl3-dev
sudo pip install -U pip
Installing Cuda 8
wget https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb
rm cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb
sudo apt-get update
sudo apt-get install -y cuda
Installing cuDNN
We want to download and install latest version of cuDNN. Downloading cuDNN requires logging into NVIDIA developer site, so we can’t use wget to fetch the files. Download the following files from NVIDIA and upload them to your AWS instance.
download cuDNN 5.1 for CUDA 8.0 on linux
scp -i ssh-key.pem path/to/downloaded/cudnn ubuntu#ec2{instance}.us-west-1.compute.amazonaws.com:~/
sudo tar -xzvf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
Configure the Environment
put following at end of ~/.bashrc:
export CUDA_HOME=/usr/local/cuda
export CUDA_ROOT=/usr/local/cuda
export PATH=$PATH:$CUDA_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_ROOT/lib64:$CUDA_ROOT/extras/CUPTI/lib64
source ~/.bashrc
sudo reboot
Installing Bazel
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf- set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf- set-selections
sudo apt-get install -y oracle-java8-installer
sudo apt-get install pkg-config zip g++ zlib1g-dev
scp https://github.com/bazelbuild/bazel/releases/download/0.3.2/bazel-0.3.2-installer-linux-x86_64.sh from local machine to ec2 instance
chmod +x bazel-0.1.4-installer-linux-x86_64.sh
./bazel-0.1.4-installer-linux-x86_64.sh --user
rm bazel-0.1.4-installer-linux-x86_64.sh
bazel version
Building and Installing Tensorflow
git clone --recurse-submodules https://github.com/tensorflow/tensorflow
cd tensorflow
TF_UNOFFICIAL_SETTING=1 ./configure
hit enter/default for all except:
CUDA version = 8.0, CUDA dependency = 3.0 (k520 gpu)
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
sudo pip install --upgrade /tmp/tensorflow_pkg/tensorflow-0.12.0rc1-cp27-cp27mu-linux_x86_64.whl
I am using CentOS 7.2
When I use yum groupinstall "Development Tools", gcc version is 4.8.5, like this:
I would like to install gcc 5.3
How to approach this with yum?
Update:
Often people want the most recent version of gcc, and devtoolset is being kept up-to-date, so maybe you want devtoolset-N where N={4,5,6,7...}, check yum for the latest available on your system). Updated the cmds below for N=7.
There is a package for gcc-7.2.1 for devtoolset-7 as an example. First you need to enable the Software Collections, then it's available in devtoolset-7:
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
which gcc
gcc --version
Update: Installing latest version of gcc 9: (gcc 9.3.0) - released March 12, 2020:
Same method can be applied to gcc 10 (gcc 10.1.0) - released May 7, 2020
Download file: gcc-9.3.0.tar.gz or
gcc-10.1.0.tar.gz
Compile and install:
//required libraries: (some may already have been installed)
dnf install libmpc-devel mpfr-devel gmp-devel
//if dnf install libmpc-devel is not working try:
dnf --enablerepo=PowerTools install libmpc-devel
//install zlib
dnf install zlib-devel*
./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
make -j 8 <== this may take around an hour or more to finish
(depending on your cpu speed)
make install
Tested under CentOS 7.8.2003 for gcc 9.3 and gcc 10.1
Tested under CentOS 8.1.1911 for gcc 10.1 (may take more time to compile)
Results: gcc/g++ 9.3.0/10.1.0
Installing gcc 7.4 (gcc 7.4.0) - released December 6, 2018:
Download file: https://ftp.gnu.org/gnu/gcc/gcc-7.4.0/gcc-7.4.0.tar.gz
Compile and install:
//required libraries:
yum install libmpc-devel mpfr-devel gmp-devel
./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
make -j 8 <== this may take around 50 minutes or less to finish with 8 threads
(depending on your cpu speed)
make install
Result:
Notes:
1. This Stack Overflow answer will help to see how to verify the downloaded source file.
2. Use the option --prefix to install gcc to another directory other than the default one. The toplevel installation directory defaults to /usr/local. Read about gcc installation options
You can use the centos-sclo-rh-testing repo to install GCC v7 without having to compile it forever, also enable V7 by default and let you switch between different versions if required.
sudo yum install -y yum-utils centos-release-scl;
sudo yum -y --enablerepo=centos-sclo-rh-testing install devtoolset-7-gcc;
echo "source /opt/rh/devtoolset-7/enable" | sudo tee -a /etc/profile;
source /opt/rh/devtoolset-7/enable;
gcc --version;
The best approach to use yum and update your devtoolset is to utilize the CentOS SCLo RH Testing repository.
yum install centos-release-scl-rh
yum --enablerepo=centos-sclo-rh-testing install devtoolset-7-gcc devtoolset-7-gcc-c++
Many additional packages are also available, to see them all
yum --enablerepo=centos-sclo-rh-testing list devtoolset-7*
You can use this method to install any dev tool version, just swap the 7 for your desired version. devtoolset-6-gcc, devtoolset-5-gcc etc.
Command to install GCC and Development Tools on a CentOS / RHEL 7 server
Type the following yum command as root user:
yum group install "Development Tools"
OR
sudo yum group install "Development Tools
If above command failed, try:
yum groupinstall "Development Tools
I'm trying to install TURN server on windows 8, i'm following THIS LINK,
so he mentioned just Follow all steps from above section.
E.g.
Install all dependencies;
LibEvent and TURN modules. and I don't know how to make those commands work on windows 8
First Step: Download & Install Prerequisite for CentOS:
yum install -y make gcc cc gcc-c++ wget
yum install -y openssl-devel libevent libevent-devel mysql-devel mysql-server