[CMake] ccmake and fortran

William A. Hoffman billlist at nycap.rr.com
Fri Aug 11 09:00:42 EDT 2006




>When I run ccmake and set CMAKE_Fortran_Compiler to ifort or ${Install Path}/ifort and then configure CMAKE_Fortran_Compiler resets back to the gnu compiler /usr/bin/f95.  I don't understand why this is happening.  Any ideas?
>
>I'm running on FC4, with CMAKE 2.4.3.  Running ifort from the command line works fine.


Remove the CMakeCache.txt file.

Then set the environment variable FC to ifort.   Then re-run ccmake.

Cmake looks for fortran compilers in this order:

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


Are you sure that ifort is in your path when you run ccmake?
But the environment variable FC should force cmake to pick ifort.

setenv FC /path/to/ifort
or
export FC=/path/to/ifort


-Bill



More information about the CMake mailing list