This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Object file for Module is too large


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]