microsoft / OpenCLOn12

The OpenCL-on-D3D12 mapping layer
MIT License
104 stars 13 forks source link

I encountered a build problem and I don't know if something is wrong at my end #33

Closed pal1000 closed 2 years ago

pal1000 commented 2 years ago

Build environment

Press any key to continue . . .

Cleanning CLonD3D12 build. Please wait...

Press any key to continue . . .

-- The C compiler identification is MSVC 19.30.30709.0 -- The CXX compiler identification is MSVC 19.30.30709.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test HAVE_DXCORE_LIBRARY -- Performing Test HAVE_DXCORE_LIBRARY - Success -- Looking for C++ include d3d12TokenizedProgramFormat.hpp -- Looking for C++ include d3d12TokenizedProgramFormat.hpp - found Adding WDK-dependent project. -- Configuring done -- Generating done -- Build files have been written to: C:/Software/Development/projects/clon12/out/x64

Press any key to continue . . .

Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

Checking File Globs Checking Build System Building Custom Rule C:/Software/Development/projects/clon12/out/x64/_deps/directx-headers-src/CMakeLists.t xt dxguids.cpp Building Custom Rule C:/Software/Development/projects/clon12/out/x64/_deps/d3d12translationlayer-src/DxbcPa rser/CMakeLists.txt BlobContainer.cpp DirectX-Guids.vcxproj -> C:\Software\Development\projects\clon12\out\x64_deps\directx-headers-build\Releas e\DirectX-Guids.lib DXBCUtils.cpp Generating Code... dxbcparser.vcxproj -> C:\Software\Development\projects\clon12\out\x64_deps\d3d12translationlayer-build\Dxb cParser\Release\dxbcparser.lib Building Custom Rule C:/Software/Development/projects/clon12/out/x64/_deps/d3d12translationlayer-src/src/CM akeLists.txt cmake_pch.cxx C:\Software\Development\projects\clon12\out\x64_deps\d3d12translationlayer-src\src..\include\D3D12Translati onLayerIncludes.h(9,10): fatal error C1083: Cannot open include file: 'pix3.h': No such file or directory [C: \Software\Development\projects\clon12\out\x64_deps\d3d12translationlayer-build\src\d3d12translationlayer.vcx proj]


Log comes from this build script
- https://github.com/pal1000/mesa-dist-win/blob/master/buildscript/modules/clon12.cmd (build)
- https://github.com/pal1000/mesa-dist-win/blob/master/buildscript/build.cmd (initiator)
jenatali commented 2 years ago

The pix3.h header comes from NuGet. Unfortunately, there's a difference in behavior for building with Visual Studio UI compared to MSBuild.exe: When you run a build from the UI, it restores NuGet packages and then builds, but MSBuild.exe doesn't do that.

You can work around this by adding a manual NuGet restore OpenCLOn12.sln step before invoking MSBuild.exe.

pal1000 commented 2 years ago

I think I need to turn off WERROR somehow:

C:\Software\Development\projects\clon12\out\x64\_deps\d3d12translationlayer-src\src\Resource.cpp(587,28): err
or C2220: the following warning is treated as an error [C:\Software\Development\projects\clon12\out\x64\_deps
\d3d12translationlayer-build\src\d3d12translationlayer.vcxproj]
C:\Software\Development\projects\clon12\out\x64\_deps\d3d12translationlayer-src\src\Resource.cpp(587,28): war
ning C4189: 'D3D11_BIND_CAPTURE': local variable is initialized but not referenced [C:\Software\Development\p
rojects\clon12\out\x64\_deps\d3d12translationlayer-build\src\d3d12translationlayer.vcxproj]

C:\Software\Development\projects\clon12\out\x64\_deps\d3d12translationlayer-src\src\VideoDecode.cpp(937,28):
error C2220: the following warning is treated as an error [C:\Software\Development\projects\clon12\out\x64\_d
eps\d3d12translationlayer-build\src\d3d12translationlayer.vcxproj]
C:\Software\Development\projects\clon12\out\x64\_deps\d3d12translationlayer-src\src\VideoDecode.cpp(937,28):
warning C4189: 'TOP_FIELD': local variable is initialized but not referenced [C:\Software\Development\project
s\clon12\out\x64\_deps\d3d12translationlayer-build\src\d3d12translationlayer.vcxproj]
C:\Software\Development\projects\clon12\out\x64\_deps\d3d12translationlayer-src\src\VideoDecode.cpp(938,28):
warning C4189: 'BOTTOM_FIELD': local variable is initialized but not referenced [C:\Software\Development\proj
ects\clon12\out\x64\_deps\d3d12translationlayer-build\src\d3d12translationlayer.vcxproj]