linux f95编译器,Fortran 95编译器是否可以编译Fortran 77代码?

您没有提到在编译过程中遇到的错误。见this link。具体做法是:

-std=*std*

其中STD可以是“f95的”,“F2003”,“F2008”,“GNU”,或“传统”中的一个。该

Default value for std is ‘gnu’. From the same page: The ‘legacy’ value is equivalent but without the warnings for obsolete extensions, and may be useful for old non-standard programs. The ‘f95’, ‘f2003’ and ‘f2008’ values specify strict conformance to the Fortran 95, Fortran 2003 and Fortran 2008 standards, respectively; errors are given for all extensions beyond the relevant language standard, and warnings are given for the Fortran 77 features that are permitted but obsolescent in later standards.

例如,如果你有一个文件old_fortran.f77编译,你可以这样做:

gfortran -std=legacy old_fortran.f77 -o a.out

其中-o a.out给你的可执行a.out。我已成功使用此编译器的较旧版本,而无需使用此选项。尽管如此,您可能会收到一些警告。第一次尝试:

gfortran old_fortran.f77 -o a.out

编辑:在OP看下面的评论后,它看起来像可能涉及不同的问题。这可能是你的安装有问题(这是可能的),或者你的设备搞砸了。我认为你的路径中的链接器(ld)是32位,并且由编译器创建的目标文件可能是64位。只是一种预感。你可以发布输出

which ld

假设返回:/ path/to/ld。然后采取该输出,并做

file /path/to/ld

你可以张贴这两个命令的输出作为评论?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值