EDA365电子论坛网

标题: Linux下fortran程序Segmentation fault错误 [打印本页]

作者: mytomorrow    时间: 2021-1-26 18:21
标题: Linux下fortran程序Segmentation fault错误
在Linux下运行某个程序,总是遇到Segmentation fault错误。同样程序在自己的PC windows下运行正常,查看Linux机器,内存足够。Intel 官网上给的解决方案是:http://software.intel.com/en-us/ ... segmentation-fault/
9 N. ]& h2 [0 l9 F+ ^
, U1 c" p: R4 ?( z2 ^On Linux*, the stack space can be increased using:
9 K! ]" j, j6 w: |: {ulimit -s unlimited     for bash shell, or 0 L. N3 e# O# D3 e! }
limit stacksize unlimited     for csh shell.3 N) w, S' ^% @7 c. X
, `, |( q: b' U9 }! Q
( s: f$ \! w' ~8 B7 P
原因是初始分配的stack空间不足,将其设置为 unlimited即可。
) U" M: f, V- h: s- _. d) r% F: s7 {+ Q2 _
' ]. l( r1 d9 ~1 ^9 m
Linux: The size of "unlimited" varies by Linux configuration, so you may need to specify a larger, specific number to ulimit (for example, 999999999). On Linux also note that many 32bit Linux distributions ship with a pthread static library (libpthread.a) that at runtime will fix the stacksize to 2093056 bytes regardless of the ulimit setting. To avoid this problem do not link with the -static option or the -fast option. Instead of -fast, use options: -ipo -O3 -no-prec-div -xP . This only affects the 32bit Linux distributions and does not apply to the 64bit Linux distributions.
! N- Y" V) a4 N; C$ R3 T: i* v, n0 x( I* q1 B, E$ t5 `. F* ?) N  ]) t' E

作者: Uifhjvv    时间: 2021-1-26 18:58





欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2