[CMake] fortran compiler failed to compile simple test program

Brad King brad.king at kitware.com
Thu Jun 18 08:44:33 EDT 2015


On 06/17/2015 11:07 AM, Ette, Anthony (CDS) wrote:
> Please see the response below about uniquely identifying cf77.
> 
> In order to identify the compiler as cf77, do something akin to the following:
> $ echo '      PROGRAM V' > /tmp/nil.f
> $ echo '      END' >> /tmp/nil.f
> $ cf77 -v -o /dev/null -c /tmp/nil.f 2>&1 | fgrep "Concurrent Fortran" 2>&1 | fgrep Concurrent
> Concurrent Fortran 77 Compiler - Version  7.3 Wed Jun 17 06:52:27 2015

We may be able to extract that while compiling the compiler identification
source file.  Try modifying Modules/CMakeDetermineFortranCompiler.cmake
and extending the list in CMAKE_Fortran_COMPILER_ID_TEST_FLAGS with "-v".
Then run CMake on the tiny CMakeLists.txt file we used for testing before.
Then send me (off list) a tarball of the build tree.

> In terms of identifying the major and minor versions, the information
> isn't as readily available as one would like.

Please encourage them to add identification and version macros to their
preprocessor invocations.  Nearly all compilers do this.  It is how
program sources are supposed to be able to adapt to idiosyncrasies
of specific compilers.

Thanks,
-Brad



More information about the CMake mailing list