LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: yuzheng

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

[复制链接]
发表于 2009-1-4 21:21:27 | 显示全部楼层
那你直接改make多方便啊,应该只是改一个变量就搞定,

不过不知道最初的makefile里面是不是使用变量来定义编译器的。
回复 支持 反对

使用道具 举报

发表于 2009-1-4 21:41:45 | 显示全部楼层
使用gfortran来代替g77应该是没有问题的,很多人都这样做过了,

我也在上面跑过点fixed form格式的代码,

你应该改的是makefile,不是shell的rc,或者说只是改shell的rc不是正规解决方法,另外你就算改也应该是alias吧。

http://gcc.gnu.org/onlinedocs/gc ... html#Project-Status

1.5 Project Status

    As soon as gfortran can parse all of the statements correctly, it will be in the “larva” state. When we generate code, the “puppa” state. When gfortran is done, we'll see if it will be a beautiful butterfly, or just a big bug....

    –Andy Vaught, April 2000

The start of the GNU Fortran 95 project was announced on the GCC homepage in March 18, 2000 (even though Andy had already been working on it for a while, of course).

The GNU Fortran compiler is able to compile nearly all standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs, including a number of standard and non-standard extensions, and can be used on real-world programs.
In particular, the supported extensions include OpenMP, Cray-style pointers, and several Fortran 2003 features such as enumeration, stream I/O, and some of the enhancements to allocatable array support from TR 15581. However, it is still under development and has a few remaining rough edges.

[color="Red"]At present, the GNU Fortran compiler passes the NIST Fortran 77 Test Suite, and produces acceptable results on the LAPACK Test Suite. It also provides respectable performance on the Polyhedron Fortran compiler benchmarks and the Livermore Fortran Kernels test. It has been used to compile a number of large real-world programs, including the HIRLAM weather-forecasting code and the Tonto quantum chemistry package; see http://gcc.gnu.org/wiki/GfortranApps for an extended list.

Among other things, the GNU Fortran compiler is intended as a replacement for G77. At this point, nearly all programs that could be compiled with G77 can be compiled with GNU Fortran, although there are a few minor known regressions.

The primary work remaining to be done on GNU Fortran falls into three categories: bug fixing (primarily regarding the treatment of invalid code and providing useful error messages), improving the compiler optimizations and the performance of compiled code, and extending the compiler to support future standards—in particular, Fortran 2003.
回复 支持 反对

使用道具 举报

发表于 2009-1-4 22:38:20 | 显示全部楼层
。。。
你可以装一个非商业版的 intel visual fortran编译器。
我现在用的以前人写的代码也是f77的 可以照样用的

fortran 和intel fortran compiler都可以编译

要说效果还是intel编译器优化的好很多

我自己跑下来intel的编译器基本要快三四倍。当然每个人的代码算的东西不一样可能可比性也不是很多 不过还是建议你试试intel的编译器

Post by yuzheng;1933832
(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-5 09:16:18 | 显示全部楼层
谢谢大家,有空我再试一下。
回复 支持 反对

使用道具 举报

发表于 2010-3-11 22:50:00 | 显示全部楼层
我在suse下也是的,makefile众多的

f77 ,
而只有 gfortran,没有 f77
想用

alias f77='gfortran'
可是系统还是说不认识
结果我

单独自己调用就可以
也就是在 terminal中 手动输入可以

但是用 make file 却不行

为何
回复 支持 反对

使用道具 举报

发表于 2010-3-14 06:24:20 | 显示全部楼层

implicit type

这个是你的代码中MAXCL没有定义变量类型。


Post by yuzheng;1932006
已经看过,除了一个 -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
回复 支持 反对

使用道具 举报

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

本版积分规则

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