MantisBT - CMake
View Issue Details
0008785CMakeCMakepublic2009-03-24 08:412016-06-10 14:30
Denis Scherbakov 
Brad King 
normalminoralways
closedmoved 
CMake-2-6 
 
0008785: Fortran comment "C Module name" results in a search for module "name"
This is a remainder of a bug submitted to mail archive

http://www.cmake.org/pipermail/cmake/2009-March/027760.html [^]

The following Fortran code cannot be compiled with CMake, because CMake looks for module called "name", which of course, does not exist. If I replace "Module" with "_Module_" the code compiles.

=============forbug.f
C Line 1 (Output) ; Module name

      SUBROUTINE PRINT_SOMETHING()
        WRITE(*,*) 'Something'
      END
=============CMakeLists.txt
PROJECT(FORBUG Fortran)

CMAKE_MINIMUM_REQUIRED(VERSION 2.6.1 FATAL_ERROR)

SET (FORBUG_SRCS
     forbug.f
)

ADD_LIBRARY(forbug ${FORBUG_SRCS})
=============

Denis
Linux 2.6.28
CMake 2.6.3
GFortran 4.3
No tags attached.
patch cmake-fortran-fixed-fmt.patch (3,002) 2009-06-04 16:22
https://public.kitware.com/Bug/file/2301/cmake-fortran-fixed-fmt.patch
Issue History
2009-03-24 08:41Denis ScherbakovNew Issue
2009-06-04 16:22Brad KingStatusnew => assigned
2009-06-04 16:22Brad KingAssigned To => Brad King
2009-06-04 16:22Brad KingFile Added: cmake-fortran-fixed-fmt.patch
2009-06-04 16:25Brad KingNote Added: 0016638
2009-06-05 11:42Denis ScherbakovNote Added: 0016645
2009-06-05 11:43Denis ScherbakovNote Edited: 0016645
2012-08-13 10:37Brad KingStatusassigned => backlog
2012-08-13 10:37Brad KingNote Added: 0030537
2016-06-10 14:27Kitware RobotNote Added: 0041527
2016-06-10 14:27Kitware RobotStatusbacklog => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0016638)
Brad King   
2009-06-04 16:25   
The 'cmake-fortran-fixed-fmt.patch' file is one I posted on the mailing list in the thread you mentioned.

The primary roadblock to addressing this bug is distinguishing free- and fixed-format source files. We cannot just throw away lines starting in 'C' in free-format sources, but we have to do so in fixed-format sources. See the rest of the thread.

Are you aware of any tools that automatically and reliably distinguish the formats? Is it easy to classify them based purely on content (not just a filename heuristic)?
(0016645)
Denis Scherbakov   
2009-06-05 11:42   
(edited on: 2009-06-05 11:43)
On how to distinguish fixed and free form I would start with:

http://www.mail-archive.com/geany@uvena.de/msg00153.html [^]

... and finish. Because everything else is too complicated. In order to be 100% sure you have to do real parsing like GCC does (take a look at gcc/fortran/scanner.c). Much easier (I think) is to do heuristic analysis and allow users to select fortran form through a new file property in SET_SOURCE_FILE_PROPERTIES, if they want.

If you want to dig in into this problem, you can read the following:
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=bks&fname=/SGI_Developer/F77_RM/ch01.html [^]
http://www.delorie.com/gnu/docs/gcc/g77_701.html [^]
http://www.calmip.cict.fr/article.php?id_article=11 [^]
http://docs.sun.com/app/docs/doc/819-5263/aevls?a=view [^]

(0030537)
Brad King   
2012-08-13 10:37   
Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0041527)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.