Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why fortran produces large files (.exe)?

Status
Not open for further replies.

Mietze

Programmer
Dec 5, 2009
1
DE
Hello!

I´m learning fortran since a few weeks and now i compared the size of a fortran and a 'C' executable ( a simple Hello World program ) and i was shocked: fortran produces about 220-330KB,
'C' about 20KB.
220...330KB for a very simple program??

I used the old Compaq Visual Fortran Compiler 6.1 (220KB) and
the g95 (330KB)

Why Fortran do this ??
 
It depends on your code generation mode. In CVF, there are 3 main modes (under Fortran/library)

o single threaded
o multi-threaded
o multi-threaded DLL

The first two put all the code from the fortran run-time library in the executable. The last one picks the run-time library when the program is executed. It means that you have to supply the runtime-library as part of the executable and loading is a lot slower but the size is 14K as opposed to 320K. If you build in release mode, it is even smaller (5K).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top