[CMake] CMake 2.8.1 RC 3 is ready to try

Brad King brad.king at kitware.com
Mon Feb 22 08:35:11 EST 2010


Arjen Markus wrote:
> On Thu, 18 Feb 2010 16:21:33 -0800 (PST)
>  "Alan W. Irwin" <irwin at beluga.phys.uvic.ca> wrote:
>
>> I have a lot more CMake-2.8.1-RC3 testing to do myself ...
>
> I have come across a nasty little error:
>
> Under Cygwin it turns out that CMake 2.8.1rc3 is not
> recognising gfortran, but instead g77.

I cannot reproduce this.  I have a simple project:

   # CMakeLists.txt
   cmake_minimum_required(VERSION 2.6)
   project(Foo Fortran)

I get:

   -- The Fortran compiler identification is GNU
   -- Check for working Fortran compiler: /usr/bin/gfortran.exe
   -- Check for working Fortran compiler: /usr/bin/gfortran.exe  -- works

even with both gfortran and g77 in my path.
The list of possible compilers is in

   Modules/CMakeDetermineFortranCompiler.cmake

and it is this:

     SET(CMAKE_Fortran_COMPILER_LIST
       ifort ifc efc f95 pgf95 lf95 xlf95 fort gfortran gfortran-4 g95 f90
       pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77
       )

Note that gfortran comes well before g77.  CMake 2.8 has a
new feature that once one language's compiler is enabled then
it changes the search order to look for compilers from the
same vendor for other languages.  If the GNU C compiler is
recognized first, then enabling Fortran uses this list:

     SET(_Fortran_COMPILER_NAMES_GNU       gfortran gfortran-4 g95 g77)

Again, gfortran comes first.

Are you using a modified CMakeDetermineFortranCompiler.cmake
in your own CMAKE_MODULE_PATH?

-Brad


More information about the CMake mailing list