-
Notifications
You must be signed in to change notification settings - Fork 742
Cleaned up Wasm cmake #13106
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
Cleaned up Wasm cmake #13106
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13106
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New Failures, 1 Unrelated FailureAs of commit 13a5315 with merge base e55bf54 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
| target_link_libraries( | ||
| executorch_wasm | ||
| PUBLIC ${link_libraries} | ||
| INTERFACE executorch_kernels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So executorch_kernels is only built when one of the selective build options is enabled - maybe there should be some documentation indicating that wasm build must use the toplevel selective build API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if none of the selective build options are used, executorch_kernels will default to optimized_native_cpu_ops_lib if EXECUTORCH_BUILD_KERNELS_OPTIMIZED is turned on, portable_ops_lib otherwise.
https://github.com/pytorch/executorch/blob/main/CMakeLists.txt#L885-L892
### Summary Before, if dependencies for the API were not enabled in the cmake command, you would get linking errors when trying to compile. Now, if EXECUTORCH_BUILD_WASM is turned on, an error will occur during configure stage if dependencies were not enabled. Also changed the API to use executorch_kernels rather than hardcoding in portable_ops_lib. For the unit tests, changed the libraries to PRIVATE instead of PUBLIC and to use `--pre-js` instead of `--post-js` as that is the recommended way of interfacing with the Embind Module. ### Test plan ```bash bash scripts/build_wasm_tests.sh cd cmake-out-wasm/extension/wasm/test/ npm test # after installing Jest ```
Summary
Before, if dependencies for the API were not enabled in the cmake command, you would get linking errors when trying to compile. Now, if EXECUTORCH_BUILD_WASM is turned on, an error will occur during configure stage if dependencies were not enabled.
Also changed the API to use executorch_kernels rather than hardcoding in portable_ops_lib.
For the unit tests, changed the libraries to PRIVATE instead of PUBLIC and to use
--pre-jsinstead of--post-jsas that is the recommended way of interfacing with the Embind Module.Test plan