[CMake] some problems with cmake under windows

lucatrv lucatrv at hotmail.com
Fri May 18 04:33:13 EDT 2007


Hi, I use cmake under windows, with both gfortran (gnu fortran) and ifort (intel fortran) compilers.

I have found some problems that I would like to put at your attention.

1) the default intel fortran installation set two environment variables FFLAGS and F90FLAGS, with the following value:
/w /I:"C:\Programmi\VNI\CTT6.0\include\IA32" /fpe:3 /nologo.
I found that cmake have problems when it tests if the ifort compiler works. It seems to be a problem in the path format. In fact, a possible solution is to remove the /I:"C:\Programmi\VNI\CTT6.0\include\IA32" part from the variable. Otherwise it is possible to use se folowing cmake command:
FILE(TO_CMAKE_PATH $ENV{F90FLAGS} CMAKE_Fortran_FLAGS)
However, in this case, the first time §I call cmake it still fails, while the following times it works.

2) Since I have two fortran compilers installed, sometimes I chose to use gfortran and sometimes ifort.
However, If I use the following commands in this order:
PROJECT (hello Fortran)
SET (CMAKE_Fortran_COMPILER gfortran)
cmake still tests ifort working when creating the makefile.
The only whay to have cmake make use only of gfortran is to use the commands in the following order:
SET (CMAKE_Fortran_COMPILER gfortran)
PROJECT (hello Fortran)
I think it would be better that cmake set the right compiler also in the first case, also because the required order is not specified in the cmake documentation.

3) When I build my project with ifort (which makes use of the microsoft linker) at the EXECUTABLE_OUTPUT_PATH, i get a hello.ilk file together with the hello.exe file (the ilk file is a Microsoft Linker Database).

Bye,
Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070518/f9e8cc31/attachment.htm


More information about the CMake mailing list