User compilers installation
Installation of GNU compilers
There are many ways to install GNU compilers. And the following is found to be the most simple and straightforward way. The following ingredients are the simplified version of here.
-
First download and unpacked your desired version of gcc compiler. Here an official gcc download address are provided https://ftp.gnu.org/gnu/gcc . And we will take version 5.2.0 as an example. If other versions are desired, please replace
5.2.0
in all following instructions by the version number, e.g. replacegccver=5.2.0
bygccver=4.9.3
.gccver=5.2.0 mkdir ~/gcc-tmp cd ~/gcc-tmp wget https://ftp.gnu.org/gnu/gcc/gcc-${gccver}/gcc-${gccver}.tar.gz tar -xzf gcc-${gccver}.tar.gz
-
Download the prerequisite sources into the same gcc source directory.
cd ~/gcc-tmp/gcc-${gccver} ./contrib/download_prerequisites
-
Create a building directory and configure gcc. One important thing here is that the building directory must be different from the source directory.
mkdir ~/gcc-tmp/build cd ~/gcc-tmp/build ~/gcc-tmp/gcc-${gccver}/configure --prefix=/path/to/install/the/gcc/ --disable-multilib
-
Build gcc.
cd ~/gcc-tmp/build make
-
Install gcc.
cd ~/gcc-tmp/build make install
-
Clean all temporary folders and files.
cd ~ rm -rf ~/gcc-tmp
Installation of MPICH
MPICH is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard. The following ingredients are the simplified version of here.
-
First download and unpacked your desired version of mpich. Here an official mpich download address are provided http://www.mpich.org/static/downloads/. And we will take version 3.2 as an example. If other versions are desired, please replace
3.2
in all following instructions by the version number, e.g. replacempichver=3.2
bympichver=3.1.4
.mpichver=3.2 mkdir ~/mpich-tmp cd ~/mpich-tmp wget http://www.mpich.org/static/downloads/${mpichver}/mpich-${mpichver}.tar.gz tar -xzf mpich-${mpichver}.tar.gz
-
Configure mpich.
cd ~/mpich-tmp/mpich-${mpichver} LD_LIBRARY_PATH=/path/to/installed/gcc/lib64 ./configure CC=/path/to/installed/gcc/bin/gcc CXX=/path/to/installed/gcc/bin/g++ F77=/path/to/installed/gcc/bin/gfortran FC=/path/to/installed/gcc/bin/gfortran --prefix=/path/to/install/the/mpich/
-
Install mpich.
cd ~/mpich-tmp/mpich-${mpichver} make install
-
Clean all temporary folders and files.
cd ~ rm -rf ~/mpich-tmp
Updating List:
-
2015-11-19: Added the first version of the compilers installation instructions.
-
2015-11-20: Added the installation instructions for mpich.
Please let me know if any of other compilers are useful to be installed under local directory.
Yingzhou Li