MantisBT - CMake
View Issue Details
0008744CMakeModulespublic2009-03-16 15:282009-10-29 10:06
Clinton Stimpson 
Brad King 
normalminoralways
closedfixed 
CMake-2-6 
 
0008744: wrong *_INIT for Windows-ifort compiler
/MD should be set for all build types, not just release.
The way it is now, multithreaded dll runtimes are used for release builds and threaded static runtimes for debug builds.
For mixed Fortran C/C++ projects, this leads to link warnings for Debug builds but not for Release builds.

Patch attached.
No tags attached.
patch Windows-ifort.patch (1,015) 2009-09-04 16:19
https://public.kitware.com/Bug/file/2432/Windows-ifort.patch
Issue History
2009-03-16 15:28Clinton StimpsonNew Issue
2009-03-16 15:28Clinton StimpsonFile Added: windows-ifort.patch
2009-03-22 22:08Bill HoffmanNote Added: 0015754
2009-03-22 22:08Bill HoffmanStatusnew => assigned
2009-03-22 22:08Bill HoffmanAssigned To => Bill Hoffman
2009-03-23 10:13Clinton StimpsonNote Added: 0015759
2009-07-08 07:43Maik BeckmannFile Added: Windows-ifort_flags.patch
2009-07-08 07:48Maik BeckmannNote Added: 0016829
2009-09-04 16:19Clinton StimpsonFile Deleted: windows-ifort.patch
2009-09-04 16:19Clinton StimpsonFile Deleted: Windows-ifort_flags.patch
2009-09-04 16:19Clinton StimpsonFile Added: Windows-ifort.patch
2009-10-28 16:51Bill HoffmanAssigned ToBill Hoffman => Brad King
2009-10-29 10:06Brad KingNote Added: 0018274
2009-10-29 10:06Brad KingStatusassigned => closed
2009-10-29 10:06Brad KingResolutionopen => fixed

Notes
(0015754)
Bill Hoffman   
2009-03-22 22:08   
This seems to be already fixed in cmake 2.6.3 and CVS.
(0015759)
Clinton Stimpson   
2009-03-23 10:13   
I looked again in CVS and I don't see the fix.
My patch modifies Windows-ifort.cmake and moves "/MD" from CMAKE_Fortran_FLAGS_RELEASE_INIT to CMAKE_Fortran_FLAGS_INIT.
Intel Fortran has no debug vs. release differences that Visual C++ has, so /MD applies to both release and debug builds (and there is no /MDd).
(0016829)
Maik Beckmann   
2009-07-08 07:48   
Windows-ifort_flags.patch uses the ifort specific
  /threads
  /libs:dll
  /dbglibs
to let ifort behave the same as cl, since
  /threads /libs:dll<=> /MD
and
  /threads /libs:dll /dbglibs<=> /MDd

-- Maik
(0018274)
Brad King   
2009-10-29 10:06   
Thanks for the patch. Committed:

Fix flags for Intel Fortran on Windows
/cvsroot/CMake/CMake/Modules/Platform/Windows-ifort.cmake,v <-- Modules/Platform/Windows-ifort.cmake
new revision: 1.10; previous revision: 1.9