pyshaderc
pyshaderc copied to clipboard
Fails to build in Windows (Microsoft Build Engine version 16.7.0+b89cb5fde)
Currently trying to install pyshaderc in windows, it seems it fails with the error:
CMake Error at cmake/setup_build.cmake:48 (find_program):
Could not find ECHO_EXE using the following names: echo
The full stack trace is:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\axsau\scoop\apps\python\3.8.3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\axsau\\AppData\\Local\\Temp\\pip-install-2wo03s8
f\\pyshaderc\\setup.py'"'"'; __file__='"'"'C:\\Users\\axsau\\AppData\\Local\\Temp\\pip-install-2wo03s8f\\pyshaderc\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);c
ode=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\axsau\AppData\Local\Temp\pip-wheel-kczr9lyi' --pyt
hon-tag cp38
cwd: C:\Users\axsau\AppData\Local\Temp\pip-install-2wo03s8f\pyshaderc\
Complete output (53 lines):
running bdist_wheel
running build
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.27.29111.0
-- The CXX compiler identification is MSVC 19.27.29111.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/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 (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Shaderc: build type is "Release".
-- Configuring Shaderc to avoid building tests.
-- nosetests was not found - python code will not be tested
-- asciidoctor was not found - no documentation will be generated
CMake Error at cmake/setup_build.cmake:48 (find_program):
Could not find ECHO_EXE using the following names: echo
Call Stack (most recent call first):
CMakeLists.txt:17 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/axsau/AppData/Local/Temp/pip-install-2wo03s8f/pyshaderc/_cffi_build/shaderc_build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\axsau\AppData\Local\Temp\pip-install-2wo03s8f\pyshaderc\setup.py", line 13, in <module>
setup(
File "C:\Users\axsau\AppData\Roaming\Python\Python38\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\axsau\scoop\apps\python\3.8.3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\axsau\scoop\apps\python\3.8.3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\axsau\scoop\apps\python\3.8.3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\axsau\AppData\Roaming\Python\Python38\site-packages\wheel\bdist_wheel.py", line 290, in run
self.run_command('build')
File "C:\Users\axsau\scoop\apps\python\3.8.3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\axsau\scoop\apps\python\3.8.3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\axsau\AppData\Local\Temp\pip-install-2wo03s8f\pyshaderc\setup.py", line 9, in run
shaderc_build.build()
File "C:\Users\axsau\AppData\Local\Temp\pip-install-2wo03s8f\pyshaderc\_cffi_build\shaderc_build.py", line 49, in build
subprocess.check_call(call, stderr=subprocess.STDOUT, shell=windows)
File "C:\Users\axsau\scoop\apps\python\3.8.3\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-BC:\\Users\\axsau\\AppData\\Local\\Temp\\pip-install-2wo03s8f\\pyshaderc\\_cffi_build\\shaderc_build', '-HC:\\Users\\axsau\\AppDa
ta\\Local\\Temp\\pip-install-2wo03s8f\\pyshaderc\\_cffi_build\\shaderc', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_POSITION_INDEPENDENT_CODE=ON', '-DSPIRV_SKIP_EXECUTABLES=ON', '-DSHADER
C_SKIP_TESTS=ON', '-DCMAKE_C_FLAGS=/nologo /EHsc /MD', '-DCMAKE_CXX_FLAGS=/nologo /EHsc /MD', '-DCMAKE_C_FLAGS_RELEASE=/nologo /EHsc /MD', '-DCMAKE_CXX_FLAGS_RELEASE=/nologo /EHsc /MD
', '-DSHADERC_ENABLE_SHARED_CRT=ON']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for pyshaderc
What would be the best way to amend, it seems the main issue (so far) is he echo
error, but I can see there is another issue #2 which outlines a compile issue on Windows, do you know what could be a fix for this?
Hello @axsaucedo, thanks for the issue. Windows is a pain so I can't promise you to check, but I will try if I have Time.
Missing echo
is a major issue. So major, it must be something silly. Perhaps you're running pip through a weird terminal/powershell or something? I see you're running scoop, maybe related to that?
I ran into the same issue. My Vulkan SDK has precompiled libraries for shaderc so for Windows you could potentially skip compiling it from source and use the precompiled static libraries.
- Comment out
#cmdclass={'build': ShadercBuild},
in setup.py - In _cffi_build and pyshaderc_build.py - replace:
ffi.set_source('_pyshaderc', source, libraries=l,
library_dirs=[f1, f2])
With:
from os import environ
vulkan_sdk_lib = path.join(environ["VULKAN_SDK"], "Lib")
ffi.set_source('_pyshaderc', source, libraries=l,
library_dirs=[vulkan_sdk_lib])
Thanks @marcusklang for the info. Could you check in the setup.py
if the precompiled binary exists and use it in that case ? And submit a PR with this code ?
@realitix - I have now added a PR that I have tested with kompute on Windows 10, Linux (Ubuntu 16.04) and macOS (12.2.1). The test was to compile the compute shader example with pyshaderc on https://github.com/KomputeProject/kompute and then run it.
One question that remains is if the precompiled should be default or fallback - right now I opted it as a fallback if the CMake configure or compile fails for any reason.