Topic: The order of compiliation

I want to run a seris of codes to replicate results of a concerning paper.

The author says as below:

-----------------------------------------------------------------------------------------------------------
Programs should be compiled in the following order:

nrtype.f90 common_par.f90 storedata.f90 nrutil.f90 grid_generate.f90 sub_timeseries.f90
sub_optim.f90 eulereq2.f90 externalit.f90 plannervf.F90 interp.f90 process.f90
simulation.f90 bindingc.f90 valuef.f90 tax.f90 tauchenhussey.f brent.f90 mnbrak.f90
zbrent.f90 zbrac.f90 taxplan.f90 main.f90
-----------------------------------------------------------------------------------------------------------

How can I specify the order of compiliation in SimplyFortran?

Re: The order of compiliation

The paper most likely gives the order of compilation due to the interdependence of modules contained within the Fortran source files.  In other words, common_par.f90 uses a module provided by nrtype.f90 (possibly, not necessarily, but we'll assume that for now), so nrtype.f90 must be compiled first to generate the module file that common_par.f90 relies on.  Simply Fortran, however, automatically sorts out compilation order based on these module dependencies.  I would suggest adding all the files listed into a project and attempting to build it as-is.  It theoretically should "just work." This automatic calculation of compilation order is one of the first and most important features of Simply Fortran.

If it doesn't work, post back here, and we can walk through the steps of creating a makefile by hand.

Jeff Armstrong
Approximatrix, LLC

Re: The order of compiliation

Please see also my post under a new thread, 'Order of library search'
---
John

4 (edited by davidb 2013-09-06 18:46:17)

Re: The order of compiliation

Files have to be compiled in order of a "topological" sort, taking into account all of the dependencies between files. With Fortran these come about due to:

Include files
modules
submodules

Simply Fortran should work out the order automatically for files containing include files and modules. It doesn't work with sub modules but these aren't supported in gfortran yet in any case.

--
David