The default for make is to build the
files in alphabetical (lexical) order, but if you have modules
that seldom works because the module must be compiled before any
file that uses it. So you need a Makefile with dependencies, but
those will not be scanned automatically. You have to create a
Makefile yourself and then set your project up not as a default
Fortran project, but as a manual makefile project, and import your
Makefile to the project. (Keep in mind that Eclipse really,
really wants to manage the files itself. Usually just copying the
file into the directory won't work.)
You should be able to use the default Xcode command-line make if
you've got those tools installed.
If you aren't familiar with make (it has a cranky syntax) there's
a basic tutorial at
https://en.wikibooks.org/wiki/Make
It's for C/C++ but the basics are the same.
To help with Fortran you can get a Perl script called makemake
that will set up a skeleton Makefile for you (it will need some
things filled in, like the name of the program and changing
F90=f90 to F90=gfortran). It's a bit old but should still work.
https://www.fortran.com/makemake.perl
perl should be on the Mac.
That's usually what causes the type of error you're describing.
It's really the .mod file it can't find (since it hasn't been
created yet when Main_program.f90 is being compiled).
On 09/11/2015 01:17 PM, Julien Colin wrote: