This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Object file for Module is too large
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Alison Boeckmann <alisonboeckmann at fastmail dot fm>
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 11 May 2009 22:57:17 -0700
- Subject: Re: Object file for Module is too large
- References: <1242099074.10778.1314981615@webmail.messagingengine.com>
On Mon, May 11, 2009 at 08:31:14PM -0700, Alison Boeckmann wrote:
> Here is test.f90
>
> module dtest
> integer max
> parameter (max=9999999)
> real, dimension(max) :: x
> end module dtest
>
> With gfortran and g95, test.o is very large.
> With ifort, it is small.
> Why is this?
Don't use static arrays. See any book on Fortran 95 and the
ALLOCATE statement.
> My application has very large modules and I cannot run it
> with gfortran or g95.
> Is this a problem with gcc?
Some people would probably say 'yes'; other, would say
it is a design flaw in the user's software.
> Is there an option that can be used to make
> gfortran and g95 behave like ifort?
No.
Try something like
module dtest
integer max
parameter (max=9999999)
real, dimension(:), allocatable :: x
contains
subroutine alloc_x
if (allocated(x)) deallocate(x)
allocate(x(max))
end subroutine alloc_x
end module dtest
--
Steve