Installing GCC, g++, Gfortran compilers under Linux

Source: Internet
Author: User
Tags gfortran

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.