MantisBT - CMake
View Issue Details
0010351CMakeCMakepublic2010-03-01 09:582011-01-04 12:50
Jacques Charreyron 
Brad King 
normalblockalways
closedfixed 
CMake-2-8 
 
0010351: ifort compiler not working : entry point must be defined
When trying to compile with intel 11.1.60 and with visual studio 2005 sp1 I got the following error message :

The Fortran compiler "ifort" is not able to compile a simple test program.

It seems that the subsystem is not defined during this test. It should be set to console and is not set at all.

The complete dump is given as additional information.
-- Building for: Visual Studio 8 2005
-- Check for working Fortran compiler: ifort
-- Check for working Fortran compiler: ifort -- broken
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/CMakeTestFortr
anCompiler.cmake:38 (MESSAGE):
  The Fortran compiler "ifort" is not able to compile a simple test program.
  It fails with the following output:
   Change Dir: D:/SubSandbox/3rdParty/Src/Harwell/1991/Build/CMakeFiles/CMakeTmp
 Run Build Command:C:\PROGRA~1\MICROS~3\Common7\IDE\devenv.com
  CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
  Microsoft (R) Visual Studio Version 8.0.50727.762.
  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
  1>------ Build started: Project: cmTryCompileExec, Configuration: Debug
  Win32 ------
  1>Compiling with Intel(R) Visual Fortran 11.1.060 [IA-32]...
  1>testFortranCompiler.f
  1>Compiling manifest to resources...
  1>Linking...
  1>Microsoft (R) Incremental Linker Version 8.00.50727.762
  1>Copyright (C) Microsoft Corporation. All rights reserved
  1>/OUT:D:\SubSandbox\3rdParty\Src\Harwell\1991\Build\CMakeFiles\CMakeTmp\Debug
\cmTryCompileExec.exe
  1>/VERSION:0.0
  1>/MANIFEST
  1>/MANIFESTFILE:D:\SubSandbox\3rdParty\Src\Harwell\1991\Build\CMakeFiles\CMake
Tmp\Debug\cmTryCompileExec.exe.intermediate.manifest
  1>/DEBUG
  1>/PDB:D:\SubSandbox\3rdParty\Src\Harwell\1991\Build\CMakeFiles\CMakeTmp\Debug
\cmTryCompileExec.pdb
  1>/IMPLIB:D:\SubSandbox\3rdParty\Src\Harwell\1991\Build\CMakeFiles\CMakeTmp\De
bug\cmTryCompileExec.lib
  1>user32.lib
  1>/debug
  1>cmTryCompileExec.dir\Debug\testFortranCompiler.obj
  1>D:\SubSandbox\3rdParty\Src\Harwell\1991\Build\CMakeFiles\CMakeTmp\Debug\cmTr
yCompileExec.exe.embed.manifest.res
  1>LINK :
  D:\SubSandbox\3rdParty\Src\Harwell\1991\Build\CMakeFiles\CMakeTmp\Debug\cmTryC
ompileExec.exe
  not found or not built by the last incremental link; performing full link
  1>LINK : fatal error LNK1561: entry point must be defined
  1>
  1>Build log written to
  "file://D:\SubSandbox\3rdParty\Src\Harwell\1991\Build\CMakeFiles\CMakeTmp\cmTr [^]
yCompileExec.dir\Debug\BuildLog.htm"
  1>cmTryCompileExec - 1 error(s), 0 warning(s)
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
  ==========
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (PROJECT)
-- Configuring incomplete, errors occurred!

No tags attached.
has duplicate 0011831closed Brad King Link error with Visual Studio 2008 and Intel Fortran 11.1 
? Windows-ifort.cmake (3,970) 2010-04-08 20:20
https://public.kitware.com/Bug/file/3014/Windows-ifort.cmake
Issue History
2010-03-01 09:58Jacques CharreyronNew Issue
2010-04-08 20:20Dave HardenFile Added: Windows-ifort.cmake
2010-04-08 20:24Dave HardenNote Added: 0020108
2010-09-15 16:05Brad KingStatusnew => assigned
2010-09-15 16:05Brad KingAssigned To => Brad King
2010-09-15 16:07Brad KingNote Added: 0022233
2011-01-03 19:12Dave HardenNote Added: 0024380
2011-01-04 09:21Brad KingNote Added: 0024389
2011-01-04 12:37Dave HardenNote Added: 0024398
2011-01-04 12:50Brad KingStatusassigned => closed
2011-01-04 12:50Brad KingResolutionopen => fixed
2011-02-10 08:26Brad KingRelationship addedhas duplicate 0011831

Notes
(0020108)
Dave Harden   
2010-04-08 20:24   
I uploaded a newer version of Windows-ifort.cmake, which resolves this issue with a one line fix:

66c66
< SET (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES")
---
> SET (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES /subsystem:console")

For the time being, place the uploaded file in:

C:\Program Files\CMake 2.8\share\cmake-2.8\Modules\Platform

Hopefully the change will make the cut for the next CMake release.
(0022233)
Brad King   
2010-09-15 16:07   
The CMAKE_EXE_LINKER_FLAGS_INIT variable is used for WinMain executables too, so this is not the place for this fix.

Does the generated ".vfproj" file have a SubSystem=... attribute?
(0024380)
Dave Harden   
2011-01-03 19:12   
As it turns out the SubSystem is not set.
(0024389)
Brad King   
2011-01-04 09:21   
I think this was already fixed by this commit:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d79e7d5 [^]

Please try CMake master from Git:

  http://www.cmake.org/cmake/resources/software.html#dev [^]
  http://www.cmake.org/Wiki/CMake/Git [^]

or a nightly build of 2.8.3.<date>:

  http://www.cmake.org/files/dev/?C=M;O=D [^]
(0024398)
Dave Harden   
2011-01-04 12:37   
That seems to have resolved it - thanks!