View previous topic :: View next topic |
Author |
Message |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Thu Jul 01, 2010 9:47 am Post subject: Creating MOD-files |
|
|
Just a report:
I use several modules. The source code for 3 modules is within one FOR file. After compiling, I get one OBJ file and 3 MOD files. So far it is as it should be.
Now, when I use a batch job to compile all my files, the commands there are like c:\programme\silverfrost\ftn95\ftn95 /silent /fixed_format *.for
Funny: Old OBJ files are overwritten, old MOD files not!! So, before compiling I first have to delete the MOD files...
Regards, Wilfried |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Fri Jul 02, 2010 3:28 am Post subject: |
|
|
Wilfred,
I've noticed this also. As a consequence, I control the compilation with a batch file which I first delete all .obj and .mod files then list the compilation of files, so that the order of the creation of .mod files is before they are needed in other files.
I would suspect that if you use ftn95 *.f95, you could not guarantee the correct order and some files may use a previous version of the .mod file, if it is to change.
I have experienced this when developing software on 2 pc's (desktop and notebook), when copying files between computers, the apparent date stamp check for creation of .mod files can give the wrong version.
You could put all these rules in a makefile, but the safest and simplest is to use a batch file which controls the compilation.
I don't use Plato, so do not know what it does in this case.
John |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Fri Jul 02, 2010 11:43 am Post subject: |
|
|
John,
in between I also put a "del *.mod" into my batch file. Directly after compiling the modules file, I copy the MOD files into the respective directories.
Thanks, regards and a nice weekend,
Wilfried |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Tue Jul 13, 2010 8:17 am Post subject: |
|
|
I have had a look at the code for the compiler and this behaviour is deliberate. The mod file is only replaced if its content changes.
This apparently relates to the behavour of a makefile if mod files are included. One does not wish to trigger a remake unless the file has changed.
There is a compiler option MINIMISE_REBUILD that is configured on by default. If you switch this off then the mod file will be replaced.
Code: | FTN95 prog.f95 /-MINIMISE_REBUILD
|
i.e. put a minus sign before MINIMISE_REBUILD. |
|
Back to top |
|
|
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: Düsseldorf, Germany
|
Posted: Tue Jul 13, 2010 9:47 am Post subject: |
|
|
Paul, thank you for this information! I have now included the option /-minimise_rebuild in my batch file.
Regards, Wilfried |
|
Back to top |
|
|
|