Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Size of the executable

Pappu_M_
Beginner
2,196 Views
I used to work with ver 9 and 10.. several years ago and recently i tried the latest version of visual fortran. I foung that what used to be like about 470 KB of executable now comes to about 870. I tried several different options and compiled but i always get the size to be around 870 which is almost twice the size it used to be. I wonder what is going on.
0 Kudos
1 Solution
mecej4
Honored Contributor III
2,196 Views
"DATA initialized" quite simply means "initialized in a DATA statement". By today's standards, a real array of size 4000 is tiny -- it fits into 16 kbytes.

What you call "pointers" are simply base offsets for the individual conceptual arrays packed into the container array. They have little to do with the Fortran 9+ POINTER attribute.

Without an understanding of the structure of an EXE file at the machine/OS level, I think that it is futile to question changes in the size of the EXE files produced by different compiler versions and options. To see my point, consider the program

[fortran]print *,'Hello World!'
end
[/fortran]
Compiled with the 12.0.4 compiler with /MD, it gives an 11 kb EXE file. Compiled with /MT /Zi /fpe:0 /traceback, it gives an EXE file that is over 600 kb long. The change may look large as a relative change, but the explanation is quite simple: the difference is caused by the inclusion of debugging code and the needed Fortran runtime in the EXE file.

View solution in original post

0 Kudos
8 Replies
mecej4
Honored Contributor III
2,196 Views
Much depends on which options you used with the two instances that you compare. Newer compiler versions can, for example, provide alternate CPU codepaths in the EXE. Since there are many extensions to the instruction set, it is understandable that the EXE size should increase with newer compilers.

If the old version was for IA32 targets and the new for 64-bit targets, the larget pointer size would increase the EXE size for the latter.

If you use /MD instead of /MT with a single version of the compiler, the EXE sizes can differ greatly.

Linker options can play a role, as well.

Unless it is felt that there is a problem with the EXE size, there is nothing to do.
0 Kudos
Pappu_M_
Beginner
2,196 Views
The application is Release win32 console. I tried three different optimization levels, f66 option etc.. but all produced almost similar size code. I am not sure what "/MD" and "/MT"... are.
The old fortran was vers 10.1 and the compilation was done for again win32 application only.
0 Kudos
Pappu_M_
Beginner
2,196 Views
The application is Release win32 console. I tried three different optimization levels, f66 option etc.. but all produced almost similar size code. I am not sure what "/MD" and "/MT"... are.
The old fortran was vers 10.1 and the compilation was done for again win32 application only.
0 Kudos
Pappu_M_
Beginner
2,196 Views
Ok I did a little research and figured out how to use the MD and MT
Here are the results
With MT i got the size of executable as 869 KB
with MD i got the size of executable as 335 KB
I am not sure whether they both produce the same results though yet.
0 Kudos
Steven_L_Intel1
Employee
2,196 Views
Do you have a large array that is DATA-initialized?
0 Kudos
Pappu_M_
Beginner
2,196 Views
I dont know what you exactly mean by "DATA initialized". But this was an old program when we used to give a large array upfront and then use pointers etc... to segment the big array into various arrays by means of pointer. A very old practice perhaps no one does it that way these days. Anyway I have two such arrays each dimensioned as 4000. and then i use pointers to create all the arrays to pack into these two.
0 Kudos
mecej4
Honored Contributor III
2,197 Views
"DATA initialized" quite simply means "initialized in a DATA statement". By today's standards, a real array of size 4000 is tiny -- it fits into 16 kbytes.

What you call "pointers" are simply base offsets for the individual conceptual arrays packed into the container array. They have little to do with the Fortran 9+ POINTER attribute.

Without an understanding of the structure of an EXE file at the machine/OS level, I think that it is futile to question changes in the size of the EXE files produced by different compiler versions and options. To see my point, consider the program

[fortran]print *,'Hello World!'
end
[/fortran]
Compiled with the 12.0.4 compiler with /MD, it gives an 11 kb EXE file. Compiled with /MT /Zi /fpe:0 /traceback, it gives an EXE file that is over 600 kb long. The change may look large as a relative change, but the explanation is quite simple: the difference is caused by the inclusion of debugging code and the needed Fortran runtime in the EXE file.

0 Kudos
Steven_L_Intel1
Employee
2,196 Views
Building with /MD just "shifts" code size from the EXE to DLLs.
0 Kudos
Reply