Silverfrost Forums

Welcome to our forums

Creating MOD-files

1 Jul 2010 8:47 #6590

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

2 Jul 2010 2:28 #6592

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

2 Jul 2010 10:43 #6593

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

13 Jul 2010 7:17 #6611

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.

FTN95 prog.f95 /-MINIMISE_REBUILD

i.e. put a minus sign before MINIMISE_REBUILD.

13 Jul 2010 8:47 #6615

Paul, thank you for this information! I have now included the option /-minimise_rebuild in my batch file.

Regards, Wilfried

Please login to reply.