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

Marie-Christine Vallet mmvallet at ucdavis.edu
Wed Oct 24 17:43:31 EDT 2007


Dunlavy, Daniel M wrote:
> 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/BuildLog.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 <file://c:%5CDocuments> 
> 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:/Program 
> Files/CMake 2.4/share/cmake-2.4/Modules/CMakeTestFortranCompiler.cmake
> -- Configuring done
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
What does your cmake file look like?

-- 
Marie-Christine Vallet
Genome Center, GBSF
University of California
451 East Health Sciences Drive
Davis, CA 95616, USA

Phone: (530) 754 9738
Email: mmvallet at ucdavis.edu
http://koehllab.genomecenter.ucdavis.edu/



Strength is the capacity to break a chocolate bar into four pieces with your bare hands - and then eat just one of the pieces  



More information about the CMake mailing list