简体   繁体   English

FORTRAN分段错误

[英]FORTRAN Segmentation Fault

The project written in Fortran runs in different machine fine, but when taken to some other Linux machines it does not. 用Fortran编写的项目可以在其他计算机上正常运行,但是带到其他Linux机器上则不能。 It says segmentation fault on one of them, and on the other it says segmentation fault (core dumped) . 它在其中一个上说segmentation fault ,而在另外一个上说segmentation fault (core dumped) I did gdb of my program, it is very surprising that it points the segfault to the first line in the program where it should print value of a variable kept in module. 我做了我的程序的gdb ,这很奇怪,它将segfault指向程序的第一行,该行应该打印模块中保存的变量的值。

I am compiling all of them as follows: 我将它们全部编译如下:

gfortran -mcmodel=large -fPIC -fopenmp -lgfortran ...

Do you know why this might be the case? 您知道为什么会这样吗? The gfortran version is 4.7.2 on Ubuntu 12.10. 在Ubuntu 12.10上,gfortran版本为4.7.2。

Perhaps you need to increase the stack size on those machines. 也许您需要增加这些计算机上的堆栈大小。 There are answers on this subject on Stackoverflow. 在Stackoverflow上有关于此主题的答案。 Check ulimit. 检查ulimit。

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

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