- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"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
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.
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
The old fortran was vers 10.1 and the compilation was done for again win32 application only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
The old fortran was vers 10.1 and the compilation was done for again win32 application only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have a large array that is DATA-initialized?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"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
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Building with /MD just "shifts" code size from the EXE to DLLs.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page