MantisBT - CMake
View Issue Details
0002361CMakeCMakepublic2005-10-13 10:402008-01-15 21:10
 
Brad King 
urgentmajoralways
closedfixed 
 
 
0002361: FORTRAN 9x module dependencies parsing
FORTRAN 9x module dependencies parsing is not working properly due to the following problems:
1) The lexer file cmDependsFortranLexer.in.l specifies uppercase FORTRAN keywords (USE, MODULE, END, INTERFACE, INCLUDE etc.) only. The FORTRAN specification about keywords states that the language is case insensitive.
2) FORTRAN preprocessor (cpp, fpp) switches aren't passed to the cmake dependencies generator resulting in bogus dependencies. For example,

#ifdef DVF
use dflib
#else
use iolib
#endif

This generates two module dependencies while it must be one based on the value of DVF.
No tags attached.
duplicate of 0003109closed Brad King Fortran dependancy checker does not ignore comments 
related to 0005809closed Brad King Fortran 77/9x support enhancements 
Issue History
2007-10-03 15:49Brad KingRelationship addedrelated to 0005809
2007-10-03 15:49Brad KingRelationship addedduplicate of 0003109
2008-01-15 21:10Brad KingStatusassigned => closed
2008-01-15 21:10Brad KingNote Added: 0010160
2008-01-15 21:10Brad KingResolutionopen => fixed

Notes
(0003144)
Brad King   
2005-10-17 10:04   
The lexer was taken with permission from another author who did not include case-insensitive regular expressions. I think the mistake was that flex was not run with the "-i" option to make the lexer case insensitive. I have re-run flex with this additional option and committed the changes:

/cvsroot/CMake/CMake/Source/cmDependsFortranLexer.in.l,v <-- cmDependsFortranLexer.in.l
new revision: 1.5; previous revision: 1.4
/cvsroot/CMake/CMake/Source/cmDependsFortranLexer.cxx,v <-- cmDependsFortranLexer.cxx
new revision: 1.3; previous revision: 1.2

This should address problem #1.
(0003145)
Brad King   
2005-10-17 10:08   
For problem 0000002 the same issue exists in the C and C++ dependency scanners:

#ifdef FOO
# include "foo.h"
#else
# include "bar.h"
#endif

will result in a dependency on both foo.h and bar.h. Fixing this is non-trivial. Does the extra module dependency actually prevent things from building or does it just make them rebuild a little too often?
(0004785)
Warren Turkal   
2006-08-28 19:54   
For fortran90 at least, this problem causes failures in build. Basically, it looks like the generated makefiles don't know how to make the modules that are not supposed to be made. When a source file is erroneously marked as depending on one of those modules, the build fails.

For the first comment, if DVF is defined, you get a module called dflib, and you don't get iolib. If does not get built when DVF is defined, the generated makefiles can fill the presumed dependency of iolib for the source file.
(0010160)
Brad King   
2008-01-15 21:10   
This bug has been fixed by changes described in bug 0005809.