MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013579 | CMake | Modules | public | 2012-10-09 11:16 | 2013-03-04 08:38 |
Reporter | Jordan Lefebvre | ||||
Assigned To | Brad King | ||||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | 7 64bit | OS Version | |
Product Version | CMake 2.8.9 | ||||
Target Version | CMake 2.8.10 | Fixed in Version | CMake 2.8.10 | ||
Summary | 0013579: FortranCInterface.cmake does not pass CMAKE_BUILD_TYPE flags | ||||
Description | In attempting to compile a mixed language static Windows executable, FortranCInterface.cmake breaks the cmake configuration. Windows MSVC and Intel compilers toggle between static and dynamic system/compiler libraries using /MT and /MD compiler flags respectively. /libs:static /threads and /libs:dll /threads are equivalent to /MT and /MD respectively. The issues stems from a difference in initialization across C/CXX flags and Fortran flags. The static/dynamic flags are initialized in the base CMAKE_Fortran_FLAGS while they are initialized in the CMAKE_[C|CXX}_FLAGS_<CMAKE_BUILD_TYPE> flags. FortranCInterface.cmake does not pass the BUILD_TYPE flags through to the subproject. This results in mixed dynamic and static libraries and multiply defined symbols at linking. | ||||
Steps To Reproduce | 1) Create cmake configuration which utilizes FortranCInterface. 2) Use Intel compilers on Windows 3) Add these additional configuration options to a configuration script.bat: cmake ^ -D CMAKE_C_FLAGS:STRING="/DWIN32 /D_WINDOWS /W3 /Zm1000" ^ -D CMAKE_CXX_FLAGS:STRING="/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR" ^ -D CMAKE_Fortran_FLAGS:STRING="/W1 /nologo /fpp" ^ -D CMAKE_C_FLAGS_RELEASE:STRING="/D_NDEBUG /O2 /MT" ^ -D CMAKE_CXX_FLAGS_RELEASE:STRING="/DNDEBUG /O2 /MT" ^ -D CMAKE_Fortran_FLAGS_RELEASE:STRING="/D_NDEBUG /O2 /MT" ^ -D CMAKE_Fortran_COMPILER:STRING=ifort ^ -D CMAKE_CXX_COMPILER:STRING=icl ^ -D CMAKE_C_COMPILER:STRING=icl ^ -G "NMake Makefiles" ^ %* 4) initialize Intel development environment 5) run script.bat path/to/src | ||||
Additional Information | This could be fixed by standardizing the initialization of compiler flags across all languages or passing all compiler flags through to the FortranCInterface subproject. This prevents a static Windows build for executable deployment. It would be convenient to have this fixed as soon as possible. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-10-09 11:16 | Jordan Lefebvre | New Issue | |||
2012-10-09 13:08 | Brad King | Note Added: 0031196 | |||
2012-10-09 13:11 | Bill Hoffman | Note Added: 0031197 | |||
2012-10-10 07:46 | Jordan Lefebvre | Note Added: 0031201 | |||
2012-10-10 14:31 | Bill Hoffman | Note Added: 0031205 | |||
2012-10-10 15:27 | Brad King | Note Added: 0031207 | |||
2012-10-10 15:28 | Brad King | Note Edited: 0031207 | bug_revision_view_page.php?bugnote_id=31207#r853 | ||
2012-10-10 15:38 | Brad King | Assigned To | => Brad King | ||
2012-10-10 15:38 | Brad King | Status | new => assigned | ||
2012-10-10 16:05 | Brad King | Note Added: 0031210 | |||
2012-10-10 16:05 | Brad King | Note Added: 0031211 | |||
2012-10-11 10:43 | Brad King | Status | assigned => resolved | ||
2012-10-11 10:43 | Brad King | Resolution | open => fixed | ||
2012-10-11 10:43 | Brad King | Target Version | => CMake 2.8.11 | ||
2012-10-17 17:00 | David Cole | Fixed in Version | => CMake 2.8.10 | ||
2012-10-17 17:00 | David Cole | Target Version | CMake 2.8.11 => CMake 2.8.10 | ||
2013-03-04 08:38 | Robert Maynard | Note Added: 0032475 | |||
2013-03-04 08:38 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|