<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It looks like building ZERO_CHECK first to reconstruct the project files as needed, then running msbuild a second time to do the actual build, has solved the
 problem.  At least, last night's run didn't take the usual two tries.  Running msbuild twice is a little bit simpler than running cmake explicitly, the way I have my scripts set up, but I'm sure that would work as well.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks everybody!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvm-dev [mailto:llvm-dev-bounces@lists.llvm.org]
<b>On Behalf Of </b>James Henderson via llvm-dev<br>
<b>Sent:</b> Thursday, May 17, 2018 5:54 AM<br>
<b>To:</b> Martin J. O'Riordan<br>
<b>Cc:</b> LLVM Developers; Valentin Churavy<br>
<b>Subject:</b> Re: [llvm-dev] Windows build strangeness<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">From my own experience this is what I think happens when building the whole solution through Visual Studio's UI. This also happens for building individual projects. I assume something similar happens when building
 via the command-line, but I rarely do that, so I can't be certain.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">1) Visual Studio/MSBuild (I don't know which, but probably MSBuild) determines the dependency graph of the projects that are to be built.<o:p></o:p></p>
</div>
<p class="MsoNormal">2) The "ZeroCheck" project runs and cmake is rerun if any of the CMakeLists.txt files have been updated.<o:p></o:p></p>
</div>
<p class="MsoNormal">3) The build continues for each of the projects, using the dependency graph from 1). If the projects from 1) were updated due to 2) then the updated projects will be built in the updated way (e.g. new files will be included in that build).<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">4) Since any new projects created by re-running cmake in 2) were not in the dependency graph in 1), projects that now rely on them will likely get link errors.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">There are two solutions I've used in my development: 1) always run cmake explicitly after doing an svn/git fetch before building or 2) build twice. The second build is usually a lot faster, so it doesn't really
 matter.<o:p></o:p></p>
</div>
<p class="MsoNormal">James<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 16 May 2018 at 22:07, Martin J. O'Riordan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">With VS2013 I found that editing a CMakeLists.txt file caused CMake to be re-run successfully and the build to also continue successfully, but since I switched to VS2015 the CMake re-run occurs - apparently successfully, but more often
 than not the build failed afterwards from either the IDE and from MSBuild.  Since I seldom change the CMakeLists.txt files, I simply do a clean CMake configuration anytime I do change them.  I also use the "Build" rather than "Rebuild" for incremental development.<br>
<br>
        MartinO<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
-----Original Message-----<br>
From: llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org">llvm-dev-bounces@lists.llvm.org</a>] On Behalf Of Michael Kruse via llvm-dev<br>
Sent: 16 May 2018 21:26<br>
To: Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>><br>
Cc: llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>; Valentin Churavy <<a href="mailto:v.churavy@gmail.com">v.churavy@gmail.com</a>><br>
Subject: Re: [llvm-dev] Windows build strangeness<br>
<br>
msbuild is is able to re-run cmake if a CMakeLists.txt changes. CMake adds a special project "ZERO_CHECK" that does this. However, I am not sure it runs when invoking on the individual projects instead of the solution.<br>
<br>
Try the cmake --build command, which should output the following:<br>
<br>
> cmake --build . --target opt<br>
CMake is re-running because<br>
C:/Users/Meinersbur/build/llvm/vc15_debug_x86/tools/polly/CMakeFiles/generate.stamp<br>
is out-of-date.<br>
[...]<br>
<br>
Michael<br>
<br>
<br>
<br>
2018-05-16 15:08 GMT-05:00 Reid Kleckner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>:<br>
> I think MSBuild isn't capable of re-running cmake and then reloading <br>
> the project files when CMakeLists.txt changes. It re-runs cmake, but <br>
> then continues the build with the stale projects. That probably <br>
> explains the "PipSqueek.cxx doesn't exist" errors. As for the link <br>
> error, it could also be caused by things like a file rename not getting picked up by MSBuild.<br>
><br>
> The fix is probably to always run cmake before MSBuild in the nightly job.<br>
> This isn't necessary if you are using ninja or make, if those are options.<br>
><br>
> On Wed, May 16, 2018 at 12:59 PM via llvm-dev <br>
> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
> wrote:<br>
>><br>
>> Here are a couple of representative errors.  C:\Dev\upstream\gitmono <br>
>> is where I keep my clone.<br>
>><br>
>><br>
>><br>
>>        "C:\Dev\upstream\gitmono\wbuild\ALL_BUILD.vcxproj" (Rebuild <br>
>> target)<br>
>> (1) -><br>
>><br>
>><br>
>> "C:\Dev\upstream\gitmono\wbuild\unittests\Support\DynamicLibrary\SecondLib.vcxproj"<br>
>> (default target) (170:2) -><br>
>><br>
>>          c1xx : fatal error C1083: Cannot open source file:<br>
>> 'C:\Dev\upstream\gitmono\llvm-project\llvm\unittests\Suppor<br>
>><br>
>>        t\DynamicLibrary\PipSqueak.cxx': No such file or directory <br>
>> [C:\Dev\upstream\gitmono\wbuild\unittests\Support\Dyn<br>
>><br>
>>        amicLibrary\SecondLib.vcxproj]<br>
>><br>
>><br>
>><br>
>>        "C:\Dev\upstream\gitmono\wbuild\ALL_BUILD.vcxproj" (Rebuild <br>
>> target)<br>
>> (1) -><br>
>><br>
>>        "C:\Dev\upstream\gitmono\wbuild\tools\llvm-mca\llvm-mca.vcxproj"<br>
>> (default target) (339:2) -><br>
>><br>
>>        (Link target) -><br>
>><br>
>>          Backend.obj : error LNK2019: unresolved external symbol "public:<br>
>> virtual bool __cdecl mca::FetchStage::isReady<br>
>><br>
>>        (void)const " (?isReady@FetchStage@mca@@UEBA_NXZ) referenced <br>
>> in function "public: void __cdecl mca::Backend::run<br>
>><br>
>>        (void)" (?run@Backend@mca@@QEAAXXZ) <br>
>> [C:\Dev\upstream\gitmono\wbuild\tools\llvm-mca\llvm-mca.vcxproj]<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> From: Valentin Churavy [mailto:<a href="mailto:v.churavy@gmail.com">v.churavy@gmail.com</a>]<br>
>> Sent: Wednesday, May 16, 2018 1:54 PM<br>
>> To: Robinson, Paul<br>
>> Cc: <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> Subject: Re: [llvm-dev] Windows build strangeness<br>
>><br>
>><br>
>><br>
>> What kind of missing symbols are you getting?<br>
>><br>
>> I had to work around dependencies for a Mingw32 build. See<br>
>> <a href="https://reviews.llvm.org/D44650" target="_blank">https://reviews.llvm.org/D44650</a><br>
>><br>
>> On Wed, May 16, 2018, 13:13 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> I have the git monorepo, and Visual Studio 2015.  I am finding that <br>
>> running a build from the command line with msbuild (as a nightly job) <br>
>> invariably fails on the first try, and succeeds on a retry.<br>
>><br>
>> The first msbuild command looks like this:<br>
>><br>
>> msbuild ALL_BUILD.vcxproj /p:Configuration="RelWithDebInfo" /m:6 <br>
>> /t:Rebuild<br>
>><br>
>> This appears to compile everything okay, but invariably fails with <br>
>> some set of link-time errors, reporting missing symbols.  Then I run <br>
>> msbuild again, but without the /t:Rebuild (thus it's a dirty build <br>
>> the second time) and this succeeds.<br>
>><br>
>> Is there some inadequacy in the CMake dependencies somewhere, so that <br>
>> some links are trying to happen before the libraries are completely <br>
>> finished?  Or just an msbuild issue?<br>
>><br>
>> I made my nightly script check for errors and run the second round, <br>
>> because it has been happening so consistently, but a proper build <br>
>> system shouldn't require such a workaround.<br>
>><br>
>> For reference, I generated the sln/project files like this:<br>
>><br>
>> cmake -G "Visual Studio 14 Win64" -Thost=x64 ^<br>
>>   -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_OPTIMIZED_TABLEGEN=ON ^<br>
>>   -DLLVM_ENABLE_PROJECTS="llvm;clang;clang-tools-extra" ^<br>
>>   ..\llvm-project\llvm<br>
>><br>
>> (Yes I know the optimized tablegen comes from a separate tree, that's <br>
>> built separately and always works.  It's just the main build that <br>
>> fails.)<br>
>><br>
>> Thanks,<br>
>> --paulr<br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>