I want to use the latest gcc without sudo privileges! !!

Introduction

On rental servers and servers managed by the company, sudo authority is not given to your account, and in many cases you cannot freely install applications with apt-get or yum.

That said, the essential applications are installed on the system itself, so there aren't many problems, but there may or may not be fatal problems such as "** gcc version is old **". ・ ・ (Zsh, some Python libraries, etc.)

So, I thought, "** Let's forcibly install the latest version of gcc in the local environment! **", and summarized the results of various investigations.

Precautions when installing gcc

gcc is a fairly large application (certainly about 4G). Therefore, please be careful about the following

--Free space at the installation destination --Let's decide the disk by considering the capacity --Installation time (make takes a long time) ――It is safe to use tmux or something

How to install gcc

The following is the command actually executed. In addition, various sources will be the latest as of April 2019.

#Move to a suitable directory (free)
cd ~/TMP

#DL and decompression of gcc source
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-8.3.0/gcc-8.3.0.tar.gz
tar -zxvf gcc-8.3.0.tar.gz
#Move to gcc directory
cd gcc-8.3.0


#Put the dependent packages in the gcc directory
# gmp
wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
tar xjf ./gmp-6.1.2.tar.bz2
mv gmp-6.1.2 gmp

# mpfr
wget https://www.mpfr.org/mpfr-current/mpfr-4.0.2.tar.bz2
tar xjf ./mpfr-4.0.2.tar.bz2
mv mpfr-4.0.2 mpfr

# mpc
wget http://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
tar -zxvf mpc-1.1.0.tar.gz
mv mpc-1.1.0 mpc


#build and install
mkdir build
cd build

#LIBRARY to the directory to configure and make_Keep in PATH
unset LIBRARY_PATH

#Change options as appropriate depending on the environment (in my environment as follows)
../configure --prefix=$HOME/local --enable-languages=c,c++ --disable-multilib
make
makefile

This is OK. If you get an error, it's a good idea to check the configure options first.

Also, don't forget to put the path to the installed directory.

reference

Build GCC 4.8.2 and install it in your home directory

Recommended Posts

I want to use the latest gcc without sudo privileges! !!
I want to use the activation function Mish
I want to use the R dataset in python
I want to use only the normalization process of SudachiPy
[Python] I want to use the -h option with argparse
I want to use VS Code and Spyder without anaconda! !! !!
I want to pin Spyder to the taskbar
I want to output to the console coolly
I want to handle the rhyme part1
I want to handle the rhyme part3
I want to use jar from python
I want to use Linux on mac
I want to use IPython Qt Console
I want to display the progress bar
I want to handle the rhyme part2
I want to handle the rhyme part5
I want to handle the rhyme part4
I want to use the Django Debug Toolbar in my Ajax application
I want to use the Qore SDK to predict the success of NBA players
I want to use MATLAB feval with python
I want to handle the rhyme part7 (BOW)
I want to use Temporary Directory with Python2
I want to use ceres solver from python
I don't want to use -inf with np.log
I want to use ip vrf with SONiC
I want to use only the SMTP MAIL FROM command and RCPT TO command without sending mail with Python's smtplib
I want to customize the appearance of zabbix
I want to display the progress in Python!
I want to use Python in the environment of pyenv + pipenv on Windows 10
I want to use PyTorch to generate something like the lyrics of Japari Park
I want to see the file name from DataLoader
I want to use self in Backpropagation (tf.custom_gradient) (tensorflow)
I want to grep the execution result of strace
I want to scroll the Django shift table, but ...
I wanted to use the Python library from MATLAB
I want to inherit to the back with python dataclass
I want to fully understand the basics of Bokeh
I want to write in Python! (3) Utilize the mock
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
I want to handle the rhyme part6 (organize once)
I want to automate ssh using the expect command!
I want to publish the product at the lowest cost
The programming language you want to be able to use
I want to handle the rhyme part8 (finished once)
I want to increase the security of ssh connections
I realized that it is nonsense to use the module without thinking because it is convenient.
I want to use Linux commands at the command prompt! Use Linux commands at the command prompt instead of Git Bash
[TensorFlow] I want to master the indexing for Ragged Tensor
I want to initialize if the value is empty (python)
I want to use R functions easily with ipython notebook
I want to save the photos sent by LINE to S3
How to use the generator
I want to automate ssh using the expect command! part2
maya Python I want to fix the baked animation again.
I want to move selenium for the time being [for mac]
[For those who want to use TPU] I tried using the Tensorflow Object Detection API 2
I want to get the operation information of yahoo route
I want to change the Japanese flag to the Palau flag with Numpy
I want to solve Sudoku (Sudoku)
I want to calculate the allowable downtime from the operating rate
I want to judge the authenticity of the elements of numpy array