Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Very basic GitHub Actions workflow for Emscripten(WASM) build with vcpkg #23561

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

luncliff
Copy link
Contributor

@luncliff luncliff commented Feb 2, 2025

Description

  • Create emscripten.yml which runs WebAssembly build with GitHub Actions
  • Change build.py to support both --use_vcpkg and --build_wasm
  • When using vcpkg, the triplet wasm32-emscripten.cmake will be used.
    • Because this triplet is using VCPKG_CHAINLOAD_TOOLCHAIN_FILE, we can't use VCPKG_CXX_FLAGS or VCPKG_LINKER_FLAGS to customize build details of the external libraries in vcpkg.json
    • I used EMCC_CFLAGS to apply emcc compiler options globally

Without EMCC_CFLAGS customization, we will get the linkage errors.

2025-01-31T18:35:38.8323800Z [ 30%] Building CXX object CMakeFiles/onnxruntime_framework.dir/__w/onnxruntime/onnxruntime/onnxruntime/core/framework/stream_execution_context.cc.o
2025-01-31T18:35:38.9889222Z wasm-ld: error: --shared-memory is disallowed by gtest-all.cc.o because it was not compiled with 'atomics' or 'bulk-memory' features.
2025-01-31T18:35:39.0098272Z em++: error: '/emsdk/upstream/bin/wasm-ld @/tmp/emscripten_mgozcgg0.rsp.utf-8' failed (returned 1)

Warning

Currently, wasm32-emscripten fails the unit test phase of build.py, with "out of memory" exception.

I guess it's kind of onnxruntime_ENABLE_WEBASSEMBLY_MEMORY64 issue.

Motivation and Context

I don't have a WASM experience. Feel free to advice :D

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant