Original link: http://blog.sina.com.cn/s/blog_6dd65c6f0100y793.html
first, Ubuntu under the installation of Gcc/g++/gfortran
1. Installation
(1). GCC
The GCC compiler comes with Ubuntu. You can use the "gcc-v" command to see if it is installed.
(2). g++
Install the g++ compiler, which can be implemented by the command "sudo apt-get install build-essential".
after execution, the installation of Gcc,g++,make is completed. Build-essential is a complete set of tools, GCC,LIBC and so on.
with "g++-V" You can see if the g++ is installed successfully.
Note: "sudo apt-get install build-essential--fix-missing", this command is a patch installation build-essential, which has been installed partially build-essential, but is not installed completely , you can use this command to continue installing build-essential.
(3). Gfortran
input command: sudo apt-get install Gfortran
with the command "Gfortran-v", you can see if the Gfortran installation was successful.
2. After installing the software via Apt-get install, the installation directory of the software
1. Some software is installed through the Apt-get Install command, but which folder is the source code of these software and the files after the installation?
You can view it in the following two ways:
(1). Enter the command in Terminal: Dpkg-l software name
Eg:dpkg-l GCC
Dpkg-l gcc-4.4
Dpkg-l g++
Dpkg-l g++-4.4
(2). In the new acquisition of the package you have installed, select the point properties (or right-click), click on the Properties dialog box "installed Files" to see.
Two. Installation of Gcc/g++/gfortran under CentOS
1. Installation
Again Ubuntu under the direct apt-get install GCC g++ can be. Following similar logic, the Yum install GCC g++ report cannot find the g++ package under CentOS. Checked, the original name of the package is called gcc-c++. The complete should be yum install GCC gcc-c++
(1) GCC
Command: Yum install gcc
(2) G++/gfortran
Command: Yum install gcc-c++
After the command is executed, the G++/gfortran is installed.
Installing GCC, g++, Gfortran compilers under Linux