[CMake] Problem building fortran project on Windows using Intel Fortran 10 compiler

Dunlavy, Daniel M dmdunla at sandia.gov
Wed Oct 24 16:07:29 EDT 2007


I am trying to build a mixed fortran/C++ project and am having trouble
using the Intel Fortran 10 compiler. I have checked the mailing list
archives and tried to piece together a solution to no avail.
 
I am using CMake 2.4.6 and today tried to use CMake 2.5 - 20071024, and
both have the same problem in finding the fortran libraries. I am
generating files for MS Visual Studio 8.
 
I have tried the following:
 
1) I have added ENABLE_LANGUAGE(Fortran) to my project.
2) I have verified that CMake is running
<CMAKE>/Modules/Platform/Windows-ifort.cmake by adding a MESSAGE command
there.
3) I have checked the
<CMAKE_BINARY_DIR>/CMakeFiles/CMakeTmp/cmTryCompileExec.dir/Debug/BuildL
og.htm and successfully run the commands manually from a Fortran cmd
shell provided by the Intel Fortran 10.0 compiler.
4) I have verified that if I move the missing library into the
<CMAKE_BINARY_DIR>/CMakeFiles/CMakeTmp directory that the linking is
successful.
5) I have tried to build the Fortran tests with the current CVS checkout
of CMake and have the same problem.
 
I now think that this must simply be a problem with the path. However,
setting the environment variables LIB, INCLUDE, and PATH to all include
the fortran library directories does not help.
 
Below is the output from running CMake from the command line (the output
of CMakeSetup is the same, but I was unable to cut and paste the text
from there).
 
Thanks for any help or advice on what to check next.
 
Danny Dunlavy
 
------------------------------------------------------------------------
-----------------------------------------
 
%>cmake --debug-trycompile --debug-out
put ..\..\..\Trilinos\packages\epetra 
debug trycompile on
Running with debug output on.
-- Check for working Fortran compiler: C:/Program
Files/Intel/Compiler/Fortran/10.0.025/IA32/Bin/ifort.exe
-- Check for working Fortran compiler: C:/Program
Files/Intel/Compiler/Fortran/10.0.025/IA32/Bin/ifort.exe -- broken
CMake Error: Error in cmake code at
C:/Program Files/CMake
2.4/share/cmake-2.4/Modules/CMakeTestFortranCompiler.cmake:25:
MESSAGE The Fortran compiler "C:/Program
Files/Intel/Compiler/Fortran/10.0.025/IA32/Bin/ifort.exe" is not able to
compile a simple test program.
It fails with the following output:
 
Microsoft (R) Visual Studio Version 8.0.50727.762.
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
------ Build started: Project: cmTryCompileExec, Configuration: Debug
Win32 ------
Building Fortran object testFortranCompiler.obj
Linking Fortran target cmTryCompileExec.exe
LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
Project : error PRJ0019: A tool returned an error code from "Linking
Fortran target cmTryCompileExec.exe"
Build log was saved at "file://c:\Documents and Settings\dmdunla\My
Documents\work\dev\build\trilinos\epetra-win32\CMake
Files\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm"
cmTryCompileExec - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped
==========
 

CMake will not be able to correctly generate this project.
Current CMake stack: C:/Documents and Settings/dmdunla/My
Documents/work/dev/Trilinos/packages/epetra/src/CMakeLists.txt;C:/Progra
m Files/CMake 2.4/share/cmake-2.4/Modules/CMakeTestFortranCompiler.cmake
-- Configuring done

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071024/4dd28b62/attachment.html


More information about the CMake mailing list