CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Could not run a Fortran program (http://www.cfd-online.com/Forums/main/11856-could-not-run-fortran-program.html)

Henry July 21, 2006 16:08

Could not run a Fortran program
 
Hello all,

I spent many days to finish the code of a fortran program. There is no error or warning when compiling every Subroutine. But there is a warning when I link them to build an "exe" file as the following:

"warning LNK4084: total image size -673341440 exceeds max (268435456); image may not run Creating browse info file..."

If I run the built "exe" file, there is a pop window coming out with the following error information:

"Could not execute: Bad executable format(Win32 error 193)."

Any suggestion please, thanks in advance.


Harish July 21, 2006 17:04

Re: Could not run a Fortran program
 
Memory problem.What compiler do you use?There is an option to increase cache size in some compilers.Try making dynamic allocation with memory deletion if you are using f90 or f95.

-H

zonexo July 22, 2006 08:07

Re: Could not run a Fortran program
 
maybe your matrix size is too big. that happen to me b4...

rt July 22, 2006 12:05

Re: Could not run a Fortran program
 
Probably, it is due to large memory allocation. So if you assign large unusable memory you must decrease your dimension sizes and ... else if you need such large memory you must increase your RAM based on your allocation (note that your allowable memory allocation is equal to your RAM size + your assigned virtual memory, in win32 you can check it with alt+ctrl+del then performance tab and then check total memory)

Henry July 22, 2006 14:37

Re: Could not run a Fortran program
 
Thanks Harish, I use Fortran Powerstation 4.0 and I couldnot find such option to increase the cache size.

Henry July 22, 2006 14:41

Re: Could not run a Fortran program
 
I define many 3-d matrix around (100,100,20) and I will try to make it smaller to see what it will happen. thanks Zonexo.

Henry July 22, 2006 15:01

Re: Could not run a Fortran program
 
Thanks a lot, rt. I will try to check it.

Renato. July 22, 2006 15:09

Re: Could not run a Fortran program
 
You'll need to use a linker parameter (something like /image:[image size]). I can't remember but you'll find it checking on the linker error messages by the number of the error 4084.

This boring problem could be solved with memory allocated dynamically. In this case you'll get success on compiling/linking your program and the lack of memory would appear only at runtime with the use of swap (a kind of memory extension on your hard disk).

in order to use memory allocation you would do:

real*8, allocatable :: a(:,:,:) allocate(a(100,100,5)) ! body of your program deallocate (a)

Cheers

Renato.


ztdep July 22, 2006 19:55

Re: Could not run a Fortran program
 
try to add anothter memory

Henry July 24, 2006 08:44

Thanks, it can run now!
 
Thanks all,

It is the memory problem and I define the matrix smaller, then the program could run!


All times are GMT -4. The time now is 17:12.