有关Fortran编译的一个错误

从来没有用过fortran, 今天有师弟让我帮忙跑一个fortran的程序, 我一编译就报如下错误

/tmp/ccy4yDLX.o: In function `output_':
Hjdk.for:(.text+0xc3): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0xfa): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x131): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x168): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x314): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x34b): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x382): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x3b9): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
/tmp/ccy4yDLX.o: In function `rk_':
Hjdk.for:(.text+0x653): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x663): relocation truncated to fit: R_X86_64_32S against symbol `sol_' defined in COMMON section in /tmp/ccy4yDLX.o
Hjdk.for:(.text+0x809): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status

解决方案是在编译时加上参数设置 -mcmodel=medium 就可以

gfortran  a.for  -mcmodel=medium

 

posted @ 2017-05-30 16:53  catinlbb  阅读(2835)  评论(1编辑  收藏  举报