Assembler error - large data set.

Janne Blomqvist blomqvist.janne@gmail.com
Mon Dec 19 11:31:00 GMT 2011


On Mon, Dec 19, 2011 at 13:21, Daniel Carrera <dcarrera@gmail.com> wrote:
> Hello,
>
> I need to write a program that reads a very large data file and I am getting
> a strange assembler error. It's clearly to do with the size of my data. I
> have written a toy program that illustrates the error:
>
>
> program test
>    use iso_fortran_env, only : real64
>
>    implicit none
>
>    integer, parameter :: nrows = 233280000
>    integer, parameter :: rp = real64
>
>    real(rp), dimension(nrows) :: longitude, latitude, height, area
>
>    area = 0
>    height = 0
>    latitude = 0
>    longitude = 0
> end program
>
>
> When I compile I get this:
>
> gfortran -o test.o -c --std=f2008 -fimplicit-none -Wall -fbounds-check
> test.f90
> /tmp/ccKqApNC.s: Assembler messages:
> /tmp/ccKqApNC.s:31: Error: value of 000000014db5b000 too large for field of
> 4 bytes at 0000000000000061
>
>
> Almost any change to the program will make the error go way. For example, if
> I have fewer variables, or if I use "real" instead of "real(rp)".
>
> I don't know what to make of this and I'm hoping that someone can help me
> out.

I suspect you're running into the size limit of the static data (.bss
in this case). With the default small memory model, all static symbols
must fit within 2 GB. You could try to compile with -mcmodel=medium,
but a better approach IMHO is to make the arrays allocatable.

-- 
Janne Blomqvist



More information about the Fortran mailing list