- 积分
- 47
- 注册时间
- 2003-9-12
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2005-4-23 04:17:17
|
显示全部楼层
来自 美国
Re:求助:如何将fortran转换成c程序?谢谢!
我就传一下吧
http://www.weihenstephan.de/~syring/f2c/f2c.html
This is an adaption of the Fortran77 to C translator f2c from netlib. The f2c "compiler" works as expected, the only deviation from the original documentation is in the fact that you can not use a *.f file specifier, i.e. it will compile only one source file at a time. I have included a slightly modified f2c.h include file that conditionally undefines huge etc. modifiers.
The compiler produces C code that must be linked against the runtime libraries libf77.lib and libi77.lib. While the translator itself runs in native Win32 mode, it may be necessary to install the Downhill library available at http://www.accurev.com/free/u2nt/ (a lightweight Un*x to Win32 compatibility library) if you get unresolved externals during linking.
Download:
Binary:
f2c.exe, f2c.h, libi77.lib, libf77.lib
Source:
contains the "binaries" together with the source and a test program
Remarks on building:
A sample Fortran test program is provided with the source distribution. The Fortran source is translated to C by VC5 custom build step and the resulting C program is compiled with the -MD option to link with libf77.lib and libi77.lib.
There is a potential problem with the binary/text dichotomy of the file opening modes. To be on the safe side, I would recommend to link your program with binmode.obj to set the default file mode to binary. In general, this required if your Fortran program uses a BACKSPACE. |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|