CentOS下安装build-essential,gcc,gfortran/g77编译器

安装完成gcc后发现 gcc -v 和g++ -v都能显示,唯独gfortran -v时显示 gfortran命令没有找到,说明gfortran没有安装。
命令安装如下:
(1)命令安装gcc
yum install gcc
(2)安装g++
yum install gcc-c++
结果显示gcc-c++已被成功安装,所以这样运行安装gfortran应该也不会出现问题
(3)安装gfortran
yum install gcc-gfortran
然后一路yes。。
运行gfortran -v 显示安装版本。。成功。。

补充g77的安装。。

依旧是在/media/CentOS_6.2_Final/Packages目录下:

[root@TTWORKTEAM Packages]# yum search g77
结果显示:
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* extras: mirrors.btte.net
* updates: mirrors.btte.net
=============================== N/S Matched: g77 ===============================
compat-gcc-34-g77.x86_64 : Fortran 77 support for compatibility compiler

Name and summary matches only, use “search all” for everything.

可以看到有一个软件包compat-gcc-34-g77.x86_64为g77编译器 ,命令安装如下:

[root@TTWORKTEAM Packages]# yum install compat-gcc-34-g77-3.4.6-19.el6.x86_64.rpm
过程显示:(一直选择Y,默认安装。。。)
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* extras: mirrors.btte.net
* updates: mirrors.btte.net
Setting up Install Process
Examining compat-gcc-34-g77-3.4.6-19.el6.x86_64.rpm: compat-gcc-34-g77-3.4.6-19.el6.x86_64
Marking compat-gcc-34-g77-3.4.6-19.el6.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package compat-gcc-34-g77.x86_64 0:3.4.6-19.el6 will be installed
–> Processing Dependency: compat-gcc-34 = 3.4.6-19.el6 for package: compat-gcc-34-g77-3.4.6-19.el6.x86_64
–> Processing Dependency: compat-libf2c-34 = 3.4.6-19.el6 for package: compat-gcc-34-g77-3.4.6-19.el6.x86_64
–> Processing Dependency: libg2c.so.0()(64bit) for package: compat-gcc-34-g77-3.4.6-19.el6.x86_64
–> Running transaction check
—> Package compat-gcc-34.x86_64 0:3.4.6-19.el6 will be installed
—> Package compat-libf2c-34.x86_64 0:3.4.6-19.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
compat-gcc-34-g77 x86_64 3.4.6-19.el6 /compat-gcc-34-g77-3.4.6-19.el6.x86_64
5.9 M
Installing for dependencies:
compat-gcc-34 x86_64 3.4.6-19.el6 base 3.7 M
compat-libf2c-34 x86_64 3.4.6-19.el6 base 51 k

Transaction Summary
================================================================================
Install 3 Package(s)

Total size: 9.6 M
Total download size: 3.8 M
Installed size: 19 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): compat-gcc-34-3.4.6-19.el6.x86_64.rpm | 3.7 MB 00:00
(2/2): compat-libf2c-34-3.4.6-19.el6.x86_64.rpm | 51 kB 00:00
——————————————————————————–
Total 7.2 MB/s | 3.8 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : compat-gcc-34-3.4.6-19.el6.x86_64 1/3
Installing : compat-libf2c-34-3.4.6-19.el6.x86_64 2/3
Installing : compat-gcc-34-g77-3.4.6-19.el6.x86_64 3/3

Installed:
compat-gcc-34-g77.x86_64 0:3.4.6-19.el6

Dependency Installed:
compat-gcc-34.x86_64 0:3.4.6-19.el6 compat-libf2c-34.x86_64 0:3.4.6-19.el6

Complete!

安装完成,用命令g77 -v检测安装是否成功和查看安装路径。

3 Comments

  1. Alan Author 九月 29, 2016 (12:44 下午)

    1.安装gcc-essential: yum install gcc gcc-c++ kernel-devel
    2.安装gfortran: yum install gcc-gfortran

  2. Alan Author 十月 3, 2016 (7:40 下午)

    ubuntu版本的可以使用sudo apt-get install build-essential gcc gfortran 进行安装编译器

  3. Alan Author 十月 3, 2016 (7:42 下午)

    make all

Leave a Comment

关于深蓝

仅仅是一个对编程很有爱好的人.
Copyright © 2008-2016 lanxinbase.com Rights Reserved. | 粤ICP备14086738号 |