[CMake] Spurious test failure in CMakeTestFortranCompiler

Brad King brad.king at kitware.com
Mon Jul 1 15:23:19 EDT 2013


On 7/1/2013 12:17 PM, Neil Carlson wrote:
>       integer stop; stop = 1 ; do while ( stop .eq. 0 ) ; end do

Thanks.  I've applied such a change:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b5bc2c6

> In other Fortran test code, including that specifically for F77 compilers,
> just explicitly declaring the types of all variables will keep the "-u" flag
> from breaking the test.

AFAIK we have no other checks that use variables.

> I think there is a larger issue here though.  I assume that the intent
> of CMakeTestFortranCompiler is generally to probe the language capabilities
> of the compiler.

In general the CMakeTest*Compiler modules test that the toolchain works
as expected for the respective language.  Since we don't have separate
support for Fortran and Fortran90 variants the check for Fortran 90
support is a special case.

> If so, I can imagine there being certain flags that would be relevant
> to this, like a "-f95" flag which sets the compiler to F95 language level,

Yes, and such flags should go in CMAKE_Fortran_FLAGS so that they end
up both in these checks and in the actual build.

-Brad


More information about the CMake mailing list