Access Keys:
Skip to content (Access Key - 0)

Use f77 -c to compile modules separately

To separately compile Fortran modules before linking them together, use the '-c' option to the 'f77' compiler. For example, if you have two source files, named 'file1.f' and 'file2.f', type these commands:

f77 -c file1.f
f77 -c file2.f

Then, you can link them together with this command:

f77 file1.o file2.o

You only need to recompile a Fortran module if it has been changed since it was last compiled. Once you have recompiled any changed modules, you can link them together as shown above. Doing this can save you quite a bit of time.

If you have many modules in your program, you may want to consider using 'make' which automatically figures out which of your modules need to be recompiled (by checking when they were last modified), and then links them.

If you weant to learn more about 'f77' or 'make', you can read the manual pages by using the 'man' command:

man f77
man make

IS&T Contributions

Documentation and information provided by IS&T staff members

Last Modified:

February 04, 2012

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
olc-fortran olc-fortran Delete
r-content r-content Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
This product/service is:
Easy to use
Difficult to use

This article is:
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki