View previous topic :: View next topic |
Author |
Message |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Wed Jan 25, 2012 3:40 pm Post subject: Nasty irritating MODule issue |
|
|
From time to time, I get updated source code from a colleague which contains changes to "INTERFACE" routines. So, I recompile the relevant source but then I get mismatching argument errors. The relevant .MOD file says it has been updated, but to get the compiler and linker to recognise the changes, I have to delete the .MOD file first!
Anyone experienced the issue?
I don't want to delete all the .MOD files as a matter of course, because we have some "recursive" USEs going on: (File B.FOR has "USE A"s and A.FOR has "USE B"s!!!) so deleting all the .MODs would cause a lot of grief as well!
TIA
K |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Jan 25, 2012 6:54 pm Post subject: |
|
|
I suspect that the only way to resolve this problem will be to rationalise the structure of the modules so that they are nolonger recursive. |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Thu Jan 26, 2012 1:02 pm Post subject: |
|
|
I suspect you're right!
K |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Jan 27, 2012 1:38 am Post subject: |
|
|
My impression of mixing code from multiple sources is that .mod files are only updated by the compiler, based on the date stamp of the .f95 files. If the file provided by your colleague is older than the .mod file, the .mod is not updated. I always delete all .mod ( and .obj) files before restarting a new build.
John |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Fri Jan 27, 2012 6:42 am Post subject: Re: |
|
|
JohnCampbell wrote: | My impression of mixing code from multiple sources is that .mod files are only updated by the compiler, based on the date stamp of the .f95 files. If the file provided by your colleague is older than the .mod file, the .mod is not updated. I always delete all .mod ( and .obj) files before restarting a new build.
John |
Aah! Very interesting comment/thought. I wonder, is there a version of "touch" that resets the date of a file to "something old", which, given our recursive behaviour, would avoid this problem?
K
edit: So I tried changing the modified/created/accessed times using "attributemagic", then recompiling my modules but none of the .MOD file dates were changed - so I wonder what the "rules" are???
K
2nd edit: So I deleted all the .OBJ files, recompiled all the source and the dates of "some" of the .MODs were changed, but not all!
K |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 318
|
Posted: Mon Jan 30, 2012 12:19 pm Post subject: |
|
|
OK, rather than a block "DEL *.MOD" before recompiling everything, I've changed my compile script to just delete the specific .MOD files for each source file, e.g.:
DEL A.MOD
FTN95 A.FOR
DEL B1.MOD
DEL B2.MOD
FTN95 B.FOR
and that seems to be the cleanest way to do it...
K |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Mon Jan 30, 2012 9:09 pm Post subject: Re: Nasty irritating MODule issue |
|
|
KennyT wrote: | we have some "recursive" USEs going on: (File B.FOR has "USE A"s and A.FOR has "USE B"s!!!) |
Recursive use statements is not legal Fortran. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
|