View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009241CMakeCMakepublic2009-07-07 15:412009-10-23 08:26
ReporterMaik Beckmann 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0009241: [g95] wrong CMAKE_Fortran_MODDIR_FLAG
Descriptionif CMAKE_Fortran_MODULE_DIRECTORY is, i.e.

  set(CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/include")

g95 fails with:

  g95: unrecognized option '-J../include'
Additional InformationThe proper option is "-fmod=".
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0016827)
Maik Beckmann (reporter)
2009-07-07 15:44

The flags for g95: http://www.g95.org/docs.shtml#rung95 [^]
(0016828)
Maik Beckmann (reporter)
2009-07-07 15:48

I tweaked Modules/Platform/Linux-GNU-Fortran.cmake to make it work again

IF(CMAKE_Fortran_COMPILER MATCHES ".*g95")
  SET (CMAKE_Fortran_MODDIR_FLAG -fmod=)
ELSE()
  SET (CMAKE_Fortran_MODDIR_FLAG -J)
ENDIF()

I guess "IF(CMAKE_Fortran_COMPILER MATCHES ".*g95.exe")..." would solve this problem on windows, but I didn't tried it so far.
(0017494)
Brad King (manager)
2009-09-14 17:59

Does this compiler have a vendor-specific preprocessor id (like __GNUC__ or _MSC_VER)? Is it really GNU?
(0017526)
Maik Beckmann (reporter)
2009-09-15 06:34
edited on: 2009-09-16 02:53

<g95 manual>
Predefined Preprocessor Macros
The macros that are always defined are:
__G95__ 0
__G95_MINOR__ 50
__FORTRAN__ 95
__GNUC__ 4
</g95 manual>

So
  #elif defined(__G95__)
is what we want.

This will of course only work, if this statement is listed before
  #elif defined(__GNUC__)
or we rather use
  #elif defined(__GFORTRAN__)
which unfortunately isn't defined before 4.3.0
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31694 [^]

(0017537)
Brad King (manager)
2009-09-15 12:29

So the proper compiler id should be "G95"?

Then we can create Compiler/G95-Fortran.cmake to set the moddir flag.
(0017539)
Brad King (manager)
2009-09-15 12:49

Is g95 command-line compatible with GNU Fortran other than this option?
(0017540)
Maik Beckmann (reporter)
2009-09-15 13:03

My knowledge isn't comprehensive, I just reacted to the moddir problem I ran into.

But addressing this made everything work, so they don't differ in the command line options we use so far.
(0018202)
Brad King (manager)
2009-10-23 08:26

Test all target types in Fortran
/cvsroot/CMake/CMake/Tests/Fortran/CMakeLists.txt,v <-- Tests/Fortran/CMakeLists.txt
new revision: 1.34; previous revision: 1.33
/cvsroot/CMake/CMake/Tests/Fortran/hello.f,v <-- Tests/Fortran/hello.f
new revision: 1.2; previous revision: 1.1
/cvsroot/CMake/CMake/Tests/Fortran/testf.f,v <-- Tests/Fortran/testf.f
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/Fortran/world.f,v <-- Tests/Fortran/world.f
initial revision: 1.1

Add support for the g95 Fortran compiler
/cvsroot/CMake/CMake/Modules/CMakeFortranCompilerId.F.in,v <-- Modules/CMakeFortranCompilerId.F.in
new revision: 1.5; previous revision: 1.4
/cvsroot/CMake/CMake/Modules/Compiler/G95-Fortran.cmake,v <-- Modules/Compiler/G95-Fortran.cmake
initial revision: 1.1

 Issue History
Date Modified Username Field Change
2009-07-07 15:41 Maik Beckmann New Issue
2009-07-07 15:44 Maik Beckmann Note Added: 0016827
2009-07-07 15:48 Maik Beckmann Note Added: 0016828
2009-09-14 13:13 Bill Hoffman Status new => assigned
2009-09-14 13:13 Bill Hoffman Assigned To => Brad King
2009-09-14 17:59 Brad King Note Added: 0017494
2009-09-15 06:34 Maik Beckmann Note Added: 0017526
2009-09-15 12:29 Brad King Note Added: 0017537
2009-09-15 12:49 Brad King Note Added: 0017539
2009-09-15 13:03 Maik Beckmann Note Added: 0017540
2009-09-16 02:53 Maik Beckmann Note Edited: 0017526
2009-10-23 08:26 Brad King Note Added: 0018202
2009-10-23 08:26 Brad King Status assigned => closed
2009-10-23 08:26 Brad King Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team