我正在尝试编译一个Fortran 90代码,该代码基本上解决了一个非常大的微分方程系统(大约5000个ODE)。为了提高求解器的精度,我必须增加解决方案数组的大小,我遇到了一个问题。我正在使用带有El Capitan的Mac电脑,配备i7 Intel核心处理器和8GB RAM。我使用Eclipse IDE和gfortran 5.3编译器。这是我的错误:
Building target: evolution_neutrinos_interpolation
Invoking: MacOS X Fortran Linker
gfortran -o "evolution_neutrinos_interpolation" ./Components_hamiltonian.o ./DormandPrinceIntegration.o ./evolution_equations.o ./evolution_self.o ./input.o ./interp.o ./output.o
final section layout:
__TEXT/__text addr=0x100000D72, size=0x0000839E, fileOffset=0x00000D72, type=1
__TEXT/__stubs addr=0x100009110, size=0x000000A8, fileOffset=0x00009110, type=28
__TEXT/__stub_helper addr=0x1000091B8, size=0x00000128, fileOffset=0x000091B8, type=32
__TEXT/__const addr=0x1000092E0, size=0x00000709, fileOffset=0x000092E0, type=0
__TEXT/__cstring addr=0x1000099F0, size=0x00000052, fileOffset=0x000099F0, type=13
__TEXT/__eh_frame addr=0x100009A48, size=0x000005A0, fileOffset=0x00009A48, type=19
__DATA/__got addr=0x10000A000, size=0x00000058, fileOffset=0x0000A000, type=29
__DATA/__nl_symbol_ptr addr=0x10000A058, size=0x00000010, fileOffset=0x0000A058, type=29
__DATA/__la_symbol_ptr addr=0x10000A068, size=0x000000E0, fileOffset=0x0000A068, type=27
__DATA/__data addr=0x10000A160, size=0x0000015A, fileOffset=0x0000A160, type=0
__DATA/__bss5 addr=0x10000A2BA, size=0x00000000, fileOffset=0x00000000, type=25
__DATA/__pu_bss5 addr=0x10000A2C0, size=0x003DB4C8, fileOffset=0x00000000, type=25
__DATA/__bss2 addr=0x1003E5788, size=0x0000000C, fileOffset=0x00000000, type=25
__DATA/__pu_bss2 addr=0x1003E5794, size=0x00000018, fileOffset=0x00000000, type=25
__DATA/__pu_bss3 addr=0x1003E57B0, size=0x00000050, fileOffset=0x00000000, type=25
__DATA/__huge addr=0x1003E5800, size=0xB9FFE3E8, fileOffset=0x00000000, type=25
ld: 32-bit RIP relative reference out of range (3098686801 max is +/-4GB): from ___interp_MOD_computation_2ndderivatives (0x100005F13) to _array2nd.3498 (0x1B8B297C0) in '___interp_MOD_computation_2ndderivatives' from ./interp.o for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [evolution_neutrinos_interpolation] Error 1
我应该确切地说,在编译代码时我真的是个新手,我几乎不明白我在做什么。但是,我觉得这个错误告诉我代码只使用4GB ram而不是8,所以我有点困惑。当我减小解决方案数组的大小时,错误消失,但我确实需要精度。是否有一个选项应添加到gfortran以使用8GB的RAM?这是我的编译命令:
gfortran -funderscoring -O0 -g -Wall -c -fmessage-length=0 -o
另外,根据我在互联网上阅读的内容,我应该确切地说我所有的真实变量都被声明为“双精度”,并且我的所有整数都被声明为“整数* 8”(至少,我试过)。我可以提供一些代码,但它相当大,我认为我不能 谢谢你的帮助!