Monday, December 20, 2010

64-bit compilation option

Error I met when compiling ft.C.1 in NPB-3.3:

mpif77 -O3 -m64 -o ../bin/ft.C.1 ft.o ../common/randi8.o ../common/print_results.o ../common/timers.o
ft.o: In function `transpose2_finish_':
ft.f:(.text+0x614): relocation truncated to fit: R_X86_64_PC32 against symbol `procgrid_' defined in COMMON section in ft.o
...

The reason is the data gets too large to fit in 2GB.


The related GNU compiler option is -mcmodel, and possible values are:
  • small. Tells the compiler to restrict code and data to the first 2GB of address space. All accesses of code and data can be done with Instruction Pointer (IP)-relative addressing.
  • medium. Tells the compiler to restrict code to the first 2GB; it places no memory restriction on data. Accesses of code can be done with IP-relative addressing, but accesses of data must be done with absolute addressing.
  • large. Places no memory restriction on code or data. All accesses of code and data must be done with absolute addressing.

No comments:

Post a Comment