Community
cancel
Showing results for 
Search instead for 
Did you mean: 
dom_beau
Beginner
355 Views

Unwanted recompiles using C++ compiler 2013 on MSVS 2012

Hello!

I'm using Intel C++ Composer XE 2013 (w_ccompxe_2013.1.119) on MS Visual Studio 2012 (11.0.51106.01). I build my solution in x64 and Win32. I have a 8 core computer and allow parallel compiling (/MP).

The problem that occurs is the following: when I modify a single file (.cpp) in a project, almost all other .cpp files are recompiled. They should not since no dependencies have been modified. Only the modified file must be recompiled.

We tried the same build using the Microsoft compiler and this problem doesn't occur. It seems linked to the Intel compiler.

Any idea how to fix this bug and to avoid such a waste of time? Feel free to request more specific info.

Thanks in advance for your help!

Dominique B.

0 Kudos
32 Replies
Sukruth_H_Intel
Employee
319 Views

Hi, Could you please see if the same issue exists even when you disable /MP switch. If yes please do let me know. However it would be great if you can provide me an testcase to reproduce an issue. Regards, Sukruth H V
dom_beau
Beginner
319 Views

Hi sukruth, The problem doesn't occur when I disable /MP. However, once /MP is disabled, the problem occurs the first time I rebuild but not the next times. This could lead to a bug due to (intermediate) files generated during the previous build before I switched /MP to NO. I send you my solution. It is in the file "TestForIntel_1.zip" and contains all the .h, .cpp, .vcxproj, .vcxproj.filters and .sln files. Regards, Dominique
SergeyKostrov
Valued Contributor II
319 Views

Hi Dominique, Could you try to use Precompiled Headers? I see that you don't use that feature in your test project. Best regards, Sergey
dom_beau
Beginner
319 Views

Hi Sergey, I added a precompiled header (that is, pch.h, pch.cpp then added pch.h to all .cpp). I switched to "Use Precompiled Header" but for file pch.cpp which is set to "Create Precompiled Header". I observed the same phenomenon. I send you the modified solution. Regards, Dominique
SergeyKostrov
Valued Contributor II
319 Views

>>...I added a precompiled header (that is, pch.h, pch.cpp then added pch.h to all .cpp). I switched to "Use Precompiled Header" but >>for file pch.cpp which is set to "Create Precompiled Header". I observed the same phenomenon. Thanks, Dominique. There are already a couple of similar reports from different developers who are using Intel C++ compiler. That problem looks very strange, it is easily reproducible and still not fixed. Some time ago I had a problem with compiling order. That is, if Microsoft C++ compiler compiles source files in order from A to Z, then Intel C++ compiler compiles the same source files in order from Z to A. I wonder if these two problems somehow related.
dom_beau
Beginner
319 Views

Sergey, Does a work around exist?
dom_beau
Beginner
319 Views

Notice: I remarked that the compiler looks for the .pchi file when using precompiled headers and this file cannot be found. It is generated when I compile only the pch .cpp file but if a compile another .cpp file, the .pchi file is deleted. Note also that I set the file name to .pch, the "i" at the end has been added by the compiler I guess. Is it possible that MSBuild is fooled by the extension .pchi rather than being the expected one .pch? This seems not directly linked to the thread but maybe it is. Thanks.
Sukruth_H_Intel
Employee
319 Views

Hi, We have submit an tracker to our development team and would update you on this once this has been fixed. Thanks for your testcase. Regards, Sukruth H V
SergeyKostrov
Valued Contributor II
319 Views

>>...Does a work around exist? It looks like No and it would be already posted. I also see that VS 2010 and VS 2012 ( different Editions ) are less stable compared to VS 2008 ( especially Professional Edition ) and that re-compiling problem could be a result of different issues with MSBuild and Intel C++ compiler. Just search the web with a statement 'MSBuild problem' and you can get about 550,000 results ( in 0.23 seconds ). I hope that it will be fixed soon. Thanks Sukruth for the update.
Dix_Lorenz
Beginner
319 Views

Any updates on this issue? I just converted to VS 2012 and every time I hit build (or just "run") it takes 5-10 minutes for VS to rebuild files that were not changed... Productivity is practically zero.
SergeyKostrov
Valued Contributor II
319 Views

>>...Productivity is practically zero. Sorry to see that statement. This is a statement from your 1st post again: >>... I build my solution in x64 and Win32. I have a 8 core computer and allow parallel compiling (/MP). Could you try to disable /MP? Also, What value do you have in 'maximum number of parallel project builds' ( look at VS Options -> Project and Solutions -> Build and Run ). If it is 8 could you try to set it to 1?
Dix_Lorenz
Beginner
319 Views

>> This is a statement from your 1st post again:

That wasn't my original post, I was running across the same problem and instead of opening another thread I just tagged along.

>> Could you try to disable /MP?

That seems to work for me; but a rebuild now takes 1h 23 min (in VS 2010 with /MP it was something like 10-15 mins, never actually measured it). That's a workaround only for when I don't change any header files...

Maximum Number of parallel project builds is indeed set to 8. I didn't test setting it to 1 since the first workaround already worked.

Is there anything else I can do/check to help fix this bug? 

Dix_Lorenz
Beginner
319 Views

>> This is a statement from your 1st post again:

That wasn't my original post, I was running across the same problem and instead of opening another thread I just tagged along.

>> Could you try to disable /MP?

That seems to work for me; but a rebuild now takes 1h 23 min (in VS 2010 with /MP it was something like 10-15 mins, never actually measured it). That's a workaround only for when I don't change any header files...

Maximum Number of parallel project builds is indeed set to 8. I didn't test setting it to 1 since the first workaround already worked.

Is there anything else I can do/check to help fix this bug? 

SergeyKostrov
Valued Contributor II
319 Views

Hi, >>...Is there anything else I can do/check to help fix this bug? I would check: - Precompile Header settings for all cpp files - A complete re-build followed by one modification in some source file and compilation with VS setting 'maximum number of parallel project builds' set to 1 - If there are any Machine Generated files by MIDL compiler MIDL stands for Microsoft Interface Definition Language I will check your test project 'testforintel-1-with-pch.zip' again.
SergeyKostrov
Valued Contributor II
319 Views

One more thing... Could you specify what edition(s) ( Professional, Standard or Express, etc ) of Visual Studio(s) you're using?
SergeyKostrov
Valued Contributor II
319 Views

>>...That's a workaround only for when I don't change any header files... Could you try to move all #include directives to a main precompile header file from cpp files? Based on a test case posted some time ago a pch.h file should look like: [ PCH.H ] // My PCH #include "Class01.h" #include "Class02.h" ... #include "Class24.h" #include "Class25.h" Note: Don't forget to comment or delete all these #include directives in cpp files.
Dix_Lorenz
Beginner
319 Views

I am using VS 2012 Professional Edition with Update 1, not using the CTP from Novermber 2012. 

The Precompiled Header for .cpp files looks the same in all files I checked; I am not aware of a way to easily check *all* of them.

I don't know what that MIDL-compiler is, so I assume I am not using it.

I switched /MP back on, did a full rebuild, set max number of parallel project builds to 1, changed 1 file and hit "Build": it started recompiling tons of files again, using all 8 processors.

My project consists of a few hundred .cpp-files, no way I can change all of their #include directives.

Dix_Lorenz
Beginner
319 Views

Small update: After much Internet-research I found one possible culprit could be non-existant headers being referenced in the project. Indeed I had a few of those, once I deleted them there is no more rebuild if I have done no changes and try to run the project. But if I change 1 file it still rebuilds tons of files.

I tried to make sense out of the icl.write.1.tlog; As far as I can tell, each of the files that is unnecssarily being rebuilt is in this file with a "^" in front of the corresponding .obj-file. Also, none of the files without that "°" are being rebuilt. I have no idea what that "^" is supposed to mean or why it would show up on some files and not on others; maybe it can give you some hint as to what the underlying problem really is.

JenniferJ
Moderator
319 Views

We have fixed the rebuild-issue related to /MP, it should be in the next update (update2).

But about your finding on the none-used header files:

>> Small update: After much Internet-research I found one possible culprit could be non-existant headers being referenced in the project.
>> Indeed I had a few of those, once I deleted them there is no more rebuild if I have done no changes and try to run the project. But if I change 1 file it still rebuilds tons of files.

could you paste some code snippets? which .cpp files contain such header? is it the file that used to generate the pre-compiled header? wouldn't it cause "... file could not be found" compiler-error? 
This would be another different issue.

thanks,
Jennifer

SergeyKostrov
Valued Contributor II
83 Views

>>...could you paste some code snippets? which .cpp files contain such header? There is clearly some confusion here. Any chance to post a screenshot? I understood that Dix is talking about references to some header files in the VS project, not in some cpp files.
Reply