LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2345|回复: 15

lenny 中没有g77了,如何编译原来的文件

[复制链接]
发表于 2008-12-30 23:46:40 | 显示全部楼层 |阅读模式
今天试了一下lenny,发现没有g77了。在http://release.debian.org/lenny/goals.txt中说明是用gfortran替代g77,http://wiki.debian.org/GfortranTransition有也有一些说明,但是我看了仍然无法编译原来的fortran程序,有谁已经试成功了,告知一声。
发表于 2008-12-31 00:05:41 | 显示全部楼层
man gfortran
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-31 00:11:14 | 显示全部楼层
已经看过,除了一个 -ff2c选项之外,没有看到其它的。
在 .bashrc 中设置
f77="gfortran -ff2c"
export  f77

f77 -O -I../../include -c hypoDD.f -o hypoDD.o
hypoDD.inc:33.21:
    Included at hypoDD.f:39:

     &          MAXCL=    50)
                    1
Error: Symbol 'maxcl' at (1) has no IMPLICIT type
回复 支持 反对

使用道具 举报

发表于 2008-12-31 11:48:43 | 显示全部楼层
买看明白,你修改bashrc干什么?
回复 支持 反对

使用道具 举报

发表于 2008-12-31 12:58:34 | 显示全部楼层
为何非要g77
直接用gfortran就行了
Post by yuzheng;1932001
今天试了一下lenny,发现没有g77了。在http://release.debian.org/lenny/ ... ,告知一声。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-4 14:01:58 | 显示全部楼层
(1)有很多旧的代码用gfotran是无法编译通过的,如果是自己写的代码,当然是用gfortran来编译。
(2)修改.bashrc是以为gfortan可以象gcc一样通过-std参数来指定采用c89,c99的标准,但是gfrotran中的-std参数并没有g77的标准,我就以为必须指定连接库就可以(原来的很多g77程序用了f2c的连接库)
-std=std
           Conform to the specified standard.  Allowed values for std are gnu,
           f95, f2003 and legacy.

没有办法,我只好用回CentOS5.2。
回复 支持 反对

使用道具 举报

发表于 2009-1-4 15:41:28 | 显示全部楼层
不懂,不懂。
回复 支持 反对

使用道具 举报

发表于 2009-1-4 15:45:16 | 显示全部楼层
还是没看明白你该bashrc干什么?

你不用make吗?还是直接命令行敲进去?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-4 15:55:09 | 显示全部楼层
$make
f77 -O -I../../include -c hypoDD.f -o hypoDD.o
hypoDD.inc:33.21:
Included at hypoDD.f:39:

用make,写bashrc 是为了不修改原来makefile中编译器的名字。
回复 支持 反对

使用道具 举报

发表于 2009-1-4 19:26:28 | 显示全部楼层
Post by yuzheng;1932001
今天试了一下lenny,发现没有g77了。在http://release.debian.org/lenny/goals.txt中说明是用gfortran替代g77,http://wiki.debian.org/GfortranTransition有也有一些说明,但是我看了仍然无法编译原来的fortran程序,有谁已经试成功了,告知一声。


虽然大一的时候曾经学过 Fortran,今天早已忘得一干二净了。。。

我不大熟识 gFortran,但 BLFS 手册里有这麽一段:

http://www.linuxfromscratch.org/blfs/view/svn/general/gcc.html
Note

The Fortran compiler included with the GCC-4.x package now aims to be conformant with the Fortran 95 standard, not the Fortran 77 standard as all previous versions of GCC have been. Please note the following paragraph copied directly from the GCC-4.1.2 gfortran man page.

“Gfortran is not yet a fully conformant Fortran 95 compiler. It can generate code for most constructs and expressions, but work remains to be done. In particular, there are known deficiencies with ENTRY, NAMELIST, and sophisticated use of MODULES, POINTERS and DERIVED TYPES. For those whose Fortran codes conform to either the Fortran 77 standard or the GNU Fortran 77 language, we recommend to use g77 from GCC 3.4.x”

Instructions to install the 3.4.6 version of the Fortran compiler can be found in GCC-3.3.6 and on the BLFS Wiki.

明显地 Lenny 的默认 gcc 绝不可能是 gcc-3.x 了,也许要自行安装旧版才行
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表