简体   繁体   English

Fortran77程序不执行

[英]Fortran77 program does not execute

Working Fortran compilers sometimes generate invalid Win32.exe files工作的 Fortran 编译器有时会生成无效的 Win32.exe 文件

Hello everybody,大家好,

several working Fortran compilers seem to have a strange behavior in certain situations.几个可用的 Fortran 编译器在某些情况下似乎有奇怪的行为。 I have tried to compile and run Prof. John Denton's programs which can be found here:我尝试编译和运行 John Denton 教授的程序,可以在这里找到:

https://www.dropbox.com/sh/8i0jyxzjb57q4j4/AABD9GQ1MUFwUm5hMWFylucva?dl=0 https://www.dropbox.com/sh/8i0jyxzjb57q4j4/AABD9GQ1MUFwUm5hMWFylucva?dl=0

The different versions of the programs Meangen und Stagen could be compiled and worked fine. Meangen 和 Stagen 程序的不同版本可以编译并运行良好。 The last program named Multall also has several different versions.最后一个名为 Multall 的程序也有几个不同的版本。 As before, the appropriate source codes could be compiled without any problems.和以前一样,可以毫无问题地编译适当的源代码。 But: as I tried to run the resulting.exe files, I got a very strange error message saying Multall's.exe would NOT be a valid Win32 executable.但是:当我尝试运行生成的 .exe 文件时,我收到一条非常奇怪的错误消息,指出 Multall's.exe 不是有效的 Win32 可执行文件。

I used four different Fortran compilers (g77, Cygwin, Mingw, FTN95) on Windows XP and Windows 8, always with the same result.我在 Windows XP 和 Windows 8 上使用了四种不同的 Fortran 编译器(g77、Cygwin、Mingw、FTN95),结果总是相同。 I made several tests, and it seems to me the reason of the strange error message is the huge amount of source code Multall consists of.我做了几次测试,在我看来奇怪的错误消息的原因是 Multall 包含了大量的源代码。 There are much more than 16000 lines of code, so maybe the memory being allocated by default by the compiler for the code segment is too small and an overflow occurs. 16000多行代码,可能是编译器默认分配给代码段的内存太小,导致溢出。

I tried several command line options of the g77 compiler in order to increase the code segment's amount of memory, but none worked.我尝试了 g77 编译器的几个命令行选项以增加代码段的内存量,但没有一个起作用。 Can anybody tell me which of the g77's command line options make the huge program Multall's.exe work?谁能告诉我 g77 的哪个命令行选项可以使巨大的程序 Multall's.exe 工作? Or maybe I am wrong, and the strange error message has nothing to do with the code segment?或者我错了,奇怪的错误信息与代码段无关? Who can help me?谁能帮我?

Thanks a lot, I highly appreciate your help非常感谢,非常感谢您的帮助

Indeed, the problem is not the program size but the stack size. 事实上,这个问题是不是程序的大小,但堆栈大小。 This is due to the large common blocks. 这是由于大型公共块。 As a test you could reduce JD in commall-open-18.3 to 1000 and you will notice that the problem is solved. 作为测试,您可以将commall-open-18.3中的JD减少到1000,您将注意到问题已解决。 You could check whether the arrays are not oversized and adjust some parameters. 您可以检查是否数组不是过大,并调整一些参数。

I tried reducing common blocks - without any effect - then I tried on another computer and there the compilation went fine and the code runs - I am guessing it is some sort of screw-up of the libraries - maybe because I made a messy (first) installation where I didn't really know what I wass doing - but I really don't know.我尝试减少公共块 - 没有任何效果 - 然后我在另一台计算机上尝试并且编译顺利并且代码运行 - 我猜这是图书馆的某种搞砸了 - 可能是因为我弄得一团糟(首先) 安装我真的不知道我在做什么 - 但我真的不知道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM