-
Notifications
You must be signed in to change notification settings - Fork 727
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
Port to web assembly #367
Open
krczapla
wants to merge
13
commits into
intel:develop
Choose a base branch
from
krczapla:port-hyperscan-to-wasm
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Port to web assembly #367
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fixes github issue intel#292
fixes github issue intel#292
fixes github issue intel#303
fixes github issue intel#305
Fixes github issue intel#291
Throw std::bad_alloc instead of returning nullptr from ue2::AlignedAllocator. Allocators for STL containers are expected never to return with an invalid pointer, and instead must throw on failure. Violating this expectation can lead to invalid pointer dereferences. Co-authored-by: johanngan <johanngan.us@gmail.com> fixes github issue intel#317 (PR intel#320)
fixes github issue intel#184
fix github issue intel#360
I added HYPERSCAN_WASM32 cmake option. If enabled, it sets appropriate headers and compile definitions that enables WASM compilation; I conditionaly replace some of the codeblocks that are not compilable into WASM. This blocks fetch cpu information in order to enable some extra features (that how I understand it). In the WASM conext there is no "CPU" hence no CPU info; In order to build wasm hyperscan you need to do following: 1. Prepare environment Install and activate emscripten sdk. Follow steps in this instruction: https://emscripten.org/docs/getting_started/downloads.html. Use version that supports wasm exceptions proposal e.g. 3.1.16. Install nodejs version that supports wasm exceptions e.g. v16.16.0. 2. Configure Hyperscan ``` cd <where-you-want-to-build-hyperscan> mkdir <build-dir> cd <build-dir> emcmake cmake -DFAT_RUNTIME=FALSE -DBUILD_EXAMPLES=OFF -DHYPERSCAN_WASM32=ON -DHYPERSCAN_EMSCRIPTEN_BOOST=ON -S ../ -B . ``` 3. Build hscheck ``` emmake make -j<jobs> hscheck ``` 4. Run hscheck ``` node --experimental-wasm-simd --experimental-wasm-eh ./<build-dir>/bin/hscheck.js ```
@krczapla thanks for your job,I build it successfully,but the hscheck.wasm size up to 90M,is there any way to reduce its size? |
Pat242567
approved these changes
Apr 27, 2023
Did you have to do anything special to get emcmake to find boost? Im getting errors that i need to specify boost_root but the normal hyperscan build instructions work just fine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added HYPERSCAN_WASM32 cmake option. If enabled, it sets appropriate headers and compile definitions that enables WASM compilation;
I conditionaly replace some of the codeblocks that are not compilable into WASM. This blocks fetch cpu information in order to enable some extra features (that how I understand it). In the WASM conext there is no "CPU" hence no CPU info;
In order to build wasm hyperscan you need to do following:
Install and activate emscripten sdk. Follow steps in this instruction: https://emscripten.org/docs/getting_started/downloads.html. Use version that supports wasm exceptions proposal e.g. 3.1.16. Install nodejs version that supports wasm exceptions e.g. v16.16.0.