Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4054664
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:36:15+00:00 2026-05-20T14:36:15+00:00

In the last year I’ve started programming in Fortran working at a research university.

  • 0

In the last year I’ve started programming in Fortran working at a research university. Most of my prior experience is in web languages like PHP or old ASP, so I’m a newbie to compile statements.

I have two different code I’m modifying.

One has an explicit statement creating .o files from modules (e.g. gfortran -c filea.f90) before creating the executable.

Another are creating the executable file directly (sometimes creating .mod files, but no .o files, e.g. gfortran -o executable filea.f90 fileb.f90 mainfile.f90).

  • Is there a reason (other than, maybe, Makefiles) that one method is preferred over the other?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:36:16+00:00Added an answer on May 20, 2026 at 2:36 pm

    Compiling to object files first is called separate compilation. There are many advantages and a few drawbacks.

    Advantages:

    • easy to transform object files (.o) to libraries and link to them later
    • many people can work on different source files at the same time
    • faster compiling (you don’t compile the same files again and again when the source hasn’t changed)
    • object files can be made from different language sources and linked together at some later time. To do that, the object files just have to use the same format and compatible calling conventions.
    • separate compilation enables distribution of system wide libraries (either OS libraries, language standard libraries or third party libraries) either static or shared.

    Drawbacks:

    • There are some optimizations (like optimizing functions away) that the compiler cannot perform, and the linker does not care about; however, many compilers now include the option to perform “link time optimization”, which largely negates this drawback. But this is still an issue for system libraries and third party libraries, especially for shared libraries (impossible to optimize away parts of a component that may change at each run, however other techniques like JIT compilation may mitigate this).
    • in some languages, the programmer has to provide some kind of header for the use of others that will link with this object. For example in C you have to provide .h files to go with your object files. But it is good practice anyway.
    • in languages with text based includes like C or C++, if you change a function prototype, you have to change it in two places. Once in header file, once in the implementation file.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the last year and a bit of working on my team's code base
Since I started learning F# and OCaml last year, I've read a huge number
Last year, my group developed a web service that included basic search functionality. All
Last year, Scott Guthrie stated You can actually override the raw SQL that LINQ
Within the last year I have become addicted to subversion. I am an only
First a little intro: Last year i wrote this http://dragan.yourtree.org/code/canvas-3d-graph/ Now, i want to
I've noticed that just in the last year or so, many major websites have
I took a data structures class in C++ last year, and consequently implemented all
This XML file contained archived news stories for all of last year. I was
I downloaded Reflector.Net and it's an .Exe outside VS. I remember (last year) when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.