Visual studio wizard project does not build incrementally

If you create that sample project provider with the visual studio plugin:

This project does not notice any changes in the main.cpp file…
only a ‘Rebuild’ will compile anything.

1 Like

Thanks for the report. I’ve not been able to reproduce it here. What version of VS are you using?

it the latest vs2017, I can share screen if needed. I’ll try to reproduce on different machines.

This reproduces everywhere for me, the only thing I can think of that might be ‘specific’ to my setup is that I install in d:\computecpp instead of the default c:\program files\ location, maybe you could try that?

I managed to reproduce this now. Very odd. I’m not sure if it’s a VS bug or something else.

I think the reason why its saying “All outputs are up-to-date.” , is because according to the tracking logs in: x64\Release\ComputeC.65a1e67b.tlog there are no input files changed.

example, the link.write.1.tlog file describes the relationship:
^D:\COMPUTE\COMPUTECPP SYCL C++1\X64\RELEASE\MAIN.OBJ
D:\COMPUTE\COMPUTECPP SYCL C++1\X64\RELEASE\COMPUTECPP SYCL C++1.EXE
D:\COMPUTE\COMPUTECPP SYCL C++1\X64\RELEASE\COMPUTECPP SYCL C++1.PDB

What I think this means: the first line prefixed with ^ is the input file, the next files are the files generated from it by the link process. So its actually describes part of the dependency graph during the last build. The way this file is generated, is that the linker is started as: tracker.exe /c link.exe [args]

so tracker.exe monitors all the files read and written by link.exe (by hooking into the win32 api?)
you can see/test this by running tracker /c notepad.exe, saving a file and closing notepad.

So, what I do not see in the 64\Release\ComputeC.65a1e67b.tlog output directory, is the compilation steps to generated main.sycl + main.obj from maincpp.

And since it doesn’t know about these, it doesn’t check anything else.

So why are there no .tlog files for the compilation?
If you look at the build output (set the output verbosity to ‘detailed’ as in the picture above):

you can see that “C:\Program Files\Codeplay\ComputeCpp\bin\compute++.exe” is running ‘bare’ / not started via tracker.exe

1>  Initializing task factory "XamlTaskFactory" from assembly "Microsoft.Build.Tasks.Core".
1>  Using "SYCLCpp" task from the task factory "XamlTaskFactory".
1>  Task "SYCLCpp"
1>    cmd.exe /D /C "C:\Users\jan\AppData\Local\Temp\tmpcdf6c6398ca6435ca674287bfba36b51.cmd"
1>    "C:\Program Files\Codeplay\ComputeCpp\bin\compute++.exe" -D_SIZE_T_DEFINED -Wno-ignored-attributes -fdiagnostics-format=msvc -sycl -O2 -nobuiltininc -I"c:\program files (x86)\Microsoft Visual Studio 12.0\VC\include" -I"c:\program files (x86)\Microsoft Visual Studio 12.0\atlmfc\include" -I"C:\Program Files\Codeplay\ComputeCpp\include" -I"C:\Program Files\Codeplay\ComputeCpp\include\image_library" -I"D:\compute\ComputeCpp SYCL C++1\\" -I"C:\Program Files\Codeplay\ComputeCpp\include" -I"C:\Program Files\Codeplay\ComputeCpp\include\image_library" -I"D:\compute\ComputeCpp SYCL C++1\\" -o"D:\compute\ComputeCpp SYCL C++1\main.sycl" -c main.cpp -sycl-target ptx64
1>

Also cl.exe is running without tracker:

1>    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Program Files\Codeplay\ComputeCpp\include" /I"C:\Program Files\Codeplay\ComputeCpp\include\image_library" /I"D:\compute\ComputeCpp SYCL C++1\\" /Zi /nologo /W3 /WX- /Od /Oy- /D _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH /Gm /EHsc /RTC1 /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"x64\Release\ComputeCpp SYCL C++1.pch" /Fa"x64\Release\\" /Fo"x64\Release\main.obj" /Fd"x64\Release\vc140.pdb" /Gd /FI"D:\compute\ComputeCpp SYCL C++1\main.sycl" /errorReport:queue main.cpp
1>    main.cpp

further down, you can see the link step is using tracker:

1>  Task "Link"
1>    Environment Variables passed to tool:
1>      VS_UNICODE_OUTPUT=1980
1>    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\compute\ComputeCpp SYCL C++1\x64\Release\ComputeCpp SYCL C++1.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files\Codeplay\ComputeCpp\lib" ComputeCpp_vs2015.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"D:\compute\ComputeCpp SYCL C++1\x64\Release\ComputeCpp SYCL C++1.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\compute\ComputeCpp SYCL C++1\x64\Release\ComputeCpp SYCL C++1.lib" /MACHINE:X64 x64\Release\main.obj
1>    Tracking command:
1>    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Tracker.exe /a /d "C:\Program Files (x86)\MSBuild\15.0\FileTracker\FileTracker32.dll" /i "D:\compute\ComputeCpp SYCL C++1\x64\Release\ComputeC.65a1e67b.tlog" /r "D:\COMPUTE\COMPUTECPP SYCL C++1\X64\RELEASE\MAIN.OBJ" /b MSBuildConsole_CancelEvente33c8b355efa46fd91025905f1c4a7ce  /c "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe"  /ERRORREPORT:PROMPT /OUT:"D:\compute\ComputeCpp SYCL C++1\x64\Release\ComputeCpp SYCL C++1.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Program Files\Codeplay\ComputeCpp\lib" ComputeCpp_vs2015.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"D:\compute\ComputeCpp SYCL C++1\x64\Release\ComputeCpp SYCL C++1.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\compute\ComputeCpp SYCL C++1\x64\Release\ComputeCpp SYCL C++1.lib" /MACHINE:X64 x64\Release\main.obj
1>  Done executing task "Link".

And, this is why those are the only .tlog files generated.

Long story short: I think you have to run all compilation steps via tracker.exe /c to make sure visual studio has visibility into the build-dependency-chain to make correct building/rebuilding happen.

Greetings,

Jan

D:\temp>tracker /c notepad.exe
D:\temp>dir notepad*.*
 Volume in drive D is Solid
 Volume Serial Number is B29D-E3BA

 Directory of D:\temp

09/04/2019  22:53             2.666 notepad.read.1.tlog
09/04/2019  22:53               522 notepad.read.16.tlog
09/04/2019  22:53               216 notepad.read.2.tlog
09/04/2019  22:53             1.752 notepad.read.3.tlog
09/04/2019  22:53                72 notepad.read.6.tlog
09/04/2019  22:53             1.072 notepad.read.8.tlog
09/04/2019  22:53               468 notepad.read.9.tlog
09/04/2019  22:53                90 notepad.write.1.tlog
09/04/2019  22:53                48 notepad.write.16.tlog
09/04/2019  22:53                48 notepad.write.3.tlog
09/04/2019  22:53                48 notepad.write.8.tlog
09/04/2019  22:53                48 notepad.write.9.tlog
              12 File(s)          7.050 bytes
               0 Dir(s)  656.028.803.072 bytes free


So, diving in further, I see that

here… the CommandLineTemplate is used to start compute.exe, this is probably not recognized by visualstudio as a ‘compilation’ step, and so it is not wrapped with a tracker instance.

I don’t know the correct way to do it… I tried prefixing tracker.exe /c (with its full path) but that did not make it build correctly either.

I think the key is to make VS aware that this is a compilation step…

Thanks for the detailed investigation. We’ll look into that.

this might be useful


these are the sources for llvm integration, and they are getting wrapped with tracker (I checked)

Here you can see its a CL task not a commandline thingy:

1>  Task "CL"
1>    All source files are not up-to-date: missing command TLog "C:\Users\Jan Wilmans\source\repos\ConsoleApplication20\ConsoleApplication20\Debug\ConsoleA.7D1DD742.tlog\clang-cl.command.1.tlog".
1>    Environment Variables passed to tool:
1>      VS_UNICODE_OUTPUT=1684
1>    C:\Program Files\LLVM\bin\clang-cl.exe /c /Z7 /JMC /nologo /W3 /WX- /diagnostics:classic /Od /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MDd /GS /fp:precise /permissive- /Yc"pch.h" /Fp"Debug\ConsoleApplication20.pch" /Fo"Debug\\" /Gd /TP -m32  pch.cpp
1>    Tracking command:
1>    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Tracker.exe /d "C:\Program Files (x86)\MSBuild\15.0\FileTracker\FileTracker32.dll" /i "C:\Users\Jan Wilmans\source\repos\ConsoleApplication20\ConsoleApplication20\Debug\ConsoleA.7D1DD742.tlog" /r "C:\USERS\JAN WILMANS\SOURCE\REPOS\CONSOLEAPPLICATION20\CONSOLEAPPLICATION20\PCH.CPP" /b MSBuildConsole_CancelEvent546b476ceba841b1822ed24147deb902  /c "C:\Program Files\LLVM\bin\clang-cl.exe"  /c /Z7 /JMC /nologo /W3 /WX- /diagnostics:classic /Od /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MDd /GS /fp:precise /permissive- /Yc"pch.h" /Fp"Debug\ConsoleApplication20.pch" /Fo"Debug\\" /Gd /TP -m32  pch.cpp
1>    

Thanks Jan. I’ve raised an internal issue to investigate this.

I’ve just ran into the same problem. Have you found any solution? I use VS2019 and ComputeCpp 2.0

Hi, we haven’t been able to fix this yet I am afraid.