The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13867 
====================================================================== 
Reported By:                Todd Greer
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13867
Category:                   CMake
Reproducibility:            random
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-01-22 18:30 CST
Last Modified:              2013-01-22 18:30 CST
====================================================================== 
Summary:                    /Zm1000 flag triggers C1027 compiler failure in
Visual Studio 2010
Description: 
I recently started encountering a C1027 compilation failure in a previously
working Visual Studio 2010 project. Nominally, this means that there was a
mismatch in my /Ym precompiled header settings, but there is no such mismatch.
In fact, the failure happened with no changes to trigger it.

It appears that this is triggered by the /Zm1000 flag in the default
CMAKE_CXX_FLAGS. I claim this for two reasons:

1. Removing that flag cured the compilation failure, which was happening
repeatedly. (This appears to be the kind of issue that is difficult to
reproduce, but, once reproduced, will continue to recur on that system for a
while.)

2. There were other reports (such as [1]) of large /Zm flags causing this error
in VS2010, with the suggested resolution of removing it or reducing it to a
smaller value. (That's how I found the solution.)

I propose that for VS2010 and beyond, /Zm1000 should be removed. Microsoft says
that "the /Zm compiler option is rarely necessary" [2] in VS2010. As a memory
tuning parameter, it doesn't make sense for CMake to choose the value; it will
naturally vary by computer and project. The worst-case consequence of removing
it will be potentially causing a build to break, but it will break rarely, and
in a very obvious way.

Additionally, searching for "CMake /Zm1000" shows several people having had to
waste their time discovering why CMake builds with default settings weren't
working. Yes, once you figure out what the problem is, the workaround (pulling
it out CMAKE_CXX_FLAGS) is easy, but that only comes after hitting a build
failure, finding reports that large /Zm settings can cause it, searching through
your own files to see where you're setting it, finding that you aren't,
searching the web to find out if CMake is setting it and how do override it, and
finally finding the answer.

This flag has caused enough trouble for enough people to justify removal,
particularly when it is of no clear value.

Thank you.

Steps to Reproduce: 
It is unclear how easy this is to reproduce. I think the best way is to compile
the largest project you can find on a system with the smallest amount of memory
you can give it.

My system is a Windows 8 Pro (64 bit) with 4GB of RAM (3.80 GB usable).

Additional Information: 
[1] http://www.ogre3d.org/forums/viewtopic.php?f=2&t=60015&start=0
[2] http://msdn.microsoft.com/en-us/library/bdscwf1c%28v=vs.100%29.aspx

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-01-22 18:30 Todd Greer     New Issue                                    
======================================================================

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to