cwoffenden / hello-webgpu

Cross-platform C++ example for WebGPU and Dawn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python error on building emscripten with Ninja

GrigoryGraborenko opened this issue · comments

Hi, I'm trying to run the wasm/emscripten (v3.1.26) build with ninja (v1.12.0.git). I run these commands:
emcmake cmake -B out -DCMAKE_BUILD_TYPE=Release
cmake --build out

I get this output:

... success up until this point:
[4/4] Linking CXX executable hello-webgpu.html
FAILED: hello-webgpu.html
cmd.exe /C "cd . && C:\Emscripten\emsdk\upstream\emscripten\em++.bat -O3 -DNDEBUG -s DISABLE_EXCEPTION_CATCHING=1 -s ASSERTIONS=0 -s WASM=1 -s USE_WEBGPU=1 -s NO_EXIT_RUNTIME=1 -s STRICT=1 --shell-file C:/Code/HBT/ta2023-cpp-B/src/ems/shell.html -s ENVIRONMENT=web -s MINIMAL_RUNTIME=2 -s TEXTDECODER=2 -s ABORTING_MALLOC=0 -s ALLOW_MEMORY_GROWTH=0 -s SUPPORT_ERRNO=0 -s MALLOC=emmalloc -s NO_FILESYSTEM=1 --output_eol=linux CMakeFiles/hello-webgpu.dir/src/main.cpp.o CMakeFiles/hello-webgpu.dir/src/ems/glue.cpp.o CMakeFiles/hello-webgpu.dir/src/ems/webgpu.cpp.o CMakeFiles/hello-webgpu.dir/src/ems/window.cpp.o -o hello-webgpu.html && cd ."
cache:INFO: generating system asset: symbol_lists/7818d2d0bea60fefa28b6a419b314988675464c2.json... (this will be cached in "C:\Emscripten\emsdk\upstream\emscripten\cache\symbol_lists\7818d2d0bea60fefa28b6a419b314988675464c2.json" for subsequent builds)
cache:INFO: - ok
Traceback (most recent call last):
File "C:\Emscripten\emsdk\upstream\emscripten\em++.py", line 14, in
sys.exit(emcc.main(sys.argv))
File "C:\Users\Grisha\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 75, in inner
return func(*args, **kwds)
File "C:\Emscripten\emsdk\upstream\emscripten\emcc.py", line 4428, in main
ret = run(args)
File "C:\Emscripten\emsdk\upstream\emscripten\emcc.py", line 1339, in run
phase_post_link(options, state, wasm_target, wasm_target, target)
File "C:\Users\Grisha\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 75, in inner
return func(*args, **kwds)
File "C:\Emscripten\emsdk\upstream\emscripten\emcc.py", line 3151, in phase_post_link
phase_final_emitting(options, state, target, wasm_target, memfile)
File "C:\Users\Grisha\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 75, in inner
return func(*args, **kwds)
File "C:\Emscripten\emsdk\upstream\emscripten\emcc.py", line 3291, in phase_final_emitting
generate_html(target, options, js_target, target_basename,
File "C:\Emscripten\emsdk\upstream\emscripten\emcc.py", line 4153, in generate_html
generate_minimal_runtime_html(target, options, js_target, target_basename)
File "C:\Emscripten\emsdk\upstream\emscripten\tools\minimal_runtime_shell.py", line 192, in generate_minimal_runtime_html
shell = shell.replace('{{{ DOWNLOAD_JS_AND_WASM_FILES }}}', generate_minimal_runtime_load_statement(target_basename))
File "C:\Emscripten\emsdk\upstream\emscripten\tools\minimal_runtime_shell.py", line 156, in generate_minimal_runtime_load_statement
if settings.USE_PTHREADS or settings.WASM_WORKERS:
File "C:\Emscripten\emsdk\upstream\emscripten\tools\settings.py", line 184, in getattr
raise AttributeError(f"no such setting: '{attr}'")
AttributeError: no such setting: 'USE_PTHREADS'
ninja: build stopped: subcommand failed.

Emscripten's MINIMAL_RUNTIME looks to have broken. I removed it, reverted to the regular runtime, and it should now build fine (see attached image).

min-runtime

Awesome, works fine with emscripten version 3.1.36 now, thank you :)