[CMake] ifort and the visual studio generator
Maik Beckmann
maikbeckmann at gmx.de
Fri Aug 10 03:24:48 EDT 2007
This is the second try, since gmane seems to swallowed the first one...
Hello,
I have trouble when trying to run the "Visual Studio 7" generator on a Fortran
project, while "NMake Makefiles" works fine. The installed fortran compiler
is intels ifort.
A minimal test case:
<CMakeLists.txt>
project(foo Fortran)
add_executable(main main.f)
</CMakeLists.txt>
<main.f>
c This is the code snippet which is used by the TRY_COMPILE
c in CMakeTestFortranCompiler.cmake
PROGRAM TESTFortran
PRINT *, 'Hello'
END
</main.f>
CMake fails with:
<error log>
...
Building Fortran object testFortranCompiler.obj
Linking Fortran target cmTryCompileExec.exe
Fatal error cannot open "ifconsol"
...
</error log>
where ifconsol refers to libifconsol.lib which in my case in
<intel fortran lib folder>
c:\Compiler\Intel\Compiler\Fortran\9.0\IA32\Lib\
</intel fortran lib folder>
The next thought is LIB isn't set proper, but
1.
<echo %LIB%>
C:\Compiler\Intel\Compiler\Fortran\9.0\IA32\Lib;c:\Programme\Microsoft Visual
Studio .NET\Vc7\PlatformSDK\lib\;c:\Programme\Microsoft Visual
Studio .NET\Vc7\lib\;d:\users\gck_mb\Qt\4.2.2\lib;
</echo %LIB%>
2.
> $ifort main.f
works perfect
3.
> cmake -G"NMake Makefiles" ../
> nmake
works perfect too
Thanks in advance,
Maik Beckmann
More information about the CMake
mailing list