realitix / pyshaderc

Python CFFI binding for shaderc
Apache License 2.0
18 stars 5 forks source link

Fails to build in VS2017/Python3.6 64bit #2

Closed chrisvarns closed 2 years ago

chrisvarns commented 6 years ago

Hi,

I am probably being an idiot somehow, but I get this error when I try to build with pip install pyshaderc from the Python 3.6 command prompt, launched from VS2017.

LINK : fatal error LNK1181: cannot open input file 'shaderc_combined.lib'

I have the 2015 build tools installed too, but cmake seems to pick up the 2017 ones (i am doing all this from 2017 after all). It appears to me from the log that all the preceeding builds succeed, and its just the link step that fails.

Cheers!

realitix commented 6 years ago

Hello @chrisvarns, Sorry for this late reply, I didn't see your issue. Don't hesitate to ping me in that case.

The problem is that the shaderc library is not compiled although it should.

Can you try the second way of installation (latest version) here ?

voegtlel commented 6 years ago

I'm having the same issue. Unfortunately it was not solved by using the development version.

Here the last few lines of output:


C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files\Python36\include" "-IC:\Program Files\Python36\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcbuild\temp.win-amd64-3.6\Release\_pyshaderc.c /Fobuild\temp.win-amd64-3.6\Release\build\temp.win-amd64-3.6\Release\_pyshaderc.obj
_pyshaderc.c
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\<thisisme>\pyshaderc\_cffi_build\shaderc_build\libshaderc "/LIBPATH:C:\Program Files\Python36\libs" "/LIBPATH:C:\Program Files\Python36\PCbuild\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\um\x64" shaderc_combined.lib /EXPORT:PyInit__pyshaderc build\temp.win-amd64-3.6\Release\build\temp.win-amd64-3.6\Release\_pyshaderc.obj /OUT:build\lib.win-amd64-3.6\pyshaderc\_pyshaderc.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\build\temp.win-amd64-3.6\Release\_pyshaderc.cp36-win_amd64.lib
LINK : fatal error LNK1181: cannot open input file 'shaderc_combined.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181```
realitix commented 6 years ago

Hello @voegtlel, Can you tell me step by step the command you launched to get this error.

voegtlel commented 6 years ago

Hi @realitix,

This is what I did: Installed Visual Studio Community 2017 (v15.7.2) via official Visual Studio Installer including Visual Studio Build Tools 2017 with Visual C++ build tools (v15.8.2). Python 3.6.4 is already installed. Launched x86_x64 Cross Tools Command Prompt for VS 2017.

cd C:\Users\Luke\
git clone https://github.com/realitix/pyshaderc.git
cd pyshaderc
python setup.py build >build.log

This time I redirected the build output to build.log.

Thanks for looking into it!

realitix commented 6 years ago

Thanks for the build log. So shaderc_combined.lib is generated (line 635).

Can you look in the shaderc_build folder and list the files you see ? Thanks

voegtlel commented 6 years ago

Sure, here you go:

PS C:\Users\Luke\pyshaderc\_cffi_build\shaderc_build> dir

    Directory: C:\Users\Luke\pyshaderc\_cffi_build\shaderc_build

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       2018-09-07     23:54                CMakeFiles
d-----       2018-09-07     23:54                examples
d-----       2018-09-07     23:54                glslc
d-----       2018-09-07     23:54                libshaderc
d-----       2018-09-07     23:54                libshaderc_util
d-----       2018-09-07     23:46                Release
d-----       2018-09-07     23:54                third_party
d-----       2018-09-07     23:46                Win32
-a----       2018-09-07     23:54          23097 add-copyright.vcxproj
-a----       2018-09-07     23:46            760 add-copyright.vcxproj.filters
-a----       2018-09-07     23:46          10582 ALL_BUILD.vcxproj
-a----       2018-09-07     23:46            177 ALL_BUILD.vcxproj.filters
-a----       2018-09-07     23:49            190 build-version.inc
-a----       2018-09-07     23:54          23573 build-version.vcxproj
-a----       2018-09-07     23:46            760 build-version.vcxproj.filters
-a----       2018-09-07     23:54          23159 check-copyright.vcxproj
-a----       2018-09-07     23:46            764 check-copyright.vcxproj.filters
-a----       2018-09-07     23:46          18736 CMakeCache.txt
-a----       2018-09-07     23:46           2046 cmake_install.cmake
-a----       2018-09-07     23:46            425 CTestTestfile.cmake
-a----       2018-09-07     23:46          11452 INSTALL.vcxproj
-a----       2018-09-07     23:46            540 INSTALL.vcxproj.filters
-a----       2018-09-07     23:46          11222 RUN_TESTS.vcxproj
-a----       2018-09-07     23:46            542 RUN_TESTS.vcxproj.filters
-a----       2018-09-07     23:46          35012 shaderc.sln
-a----       2018-09-07     23:54          41669 ZERO_CHECK.vcxproj
-a----       2018-09-07     23:46            541 ZERO_CHECK.vcxproj.filters
realitix commented 6 years ago

Ok so you don't have the libshaderc_combined.lib.

Can you run this command in the folder C:\Users\Luke\pyshaderc\_cffi_build:

cmake --build shaderc_build --config Release

I wait for the output

voegtlel commented 6 years ago

Here is the console output:

Btw, there exists _cffi_build/shaderc_build/libshaderc/Release/shaderc_combined.lib. Maybe just the lib prefix is missing?

Output of cmake --build shaderc_build --config Release >build.log:

I also attached a list of all files within the directory.

realitix commented 6 years ago

Hello @voegtlel, I just pushed a commit to fix the problem, can you try now ?

voegtlel commented 6 years ago

Hi @realitix,

thanks! Unfortunately it didn't work. This time it got further, but fails with unresolved symbols.

Logs: build.log tree.log

realitix commented 6 years ago

Ok so I have to do it myself because the problem is bigger than I though

Micha0 commented 2 years ago

Change ab96e82 worked for me. (VS2019, having the exact same error.) @realitix could you please tag and publish that submit so next time I do pip pyshaderc on windows I get happy signals?

realitix commented 2 years ago

Hello @Micha0, I pushed the 1.1.3 tag and added it to Pypi too.