tqchen commented on a change in pull request #5506:
URL: https://github.com/apache/incubator-tvm/pull/5506#discussion_r421571419



##########
File path: web/README.md
##########
@@ -15,163 +15,70 @@
 <!--- specific language governing permissions and limitations -->
 <!--- under the License. -->
 
-# TVM WebAssembly and Javascript Backend
+# TVM WebAssembly Runtime
 
-This folder contains TVM WebAssembly and Javascript backend through Emscripten.
+This folder contains TVM WebAssembly Runtime.
 
 ## Installation
-While the LLVM main branch support webassembly as a target. We still need a 
good runtime with libc and other
-system library support. Emscripten toolchain offers that nicely. The general 
idea is to build TVM against
-the fastcomp LLVM backend in the Emscripten project and allow us to generate 
```asmjs-unknown-emscripten```
-as a backend target.
+
+The LLVM main branch support webassembly as a target, we can directly
+build TVM with LLVM mainline to generate wasm modules.
+Note that, however, we still need emscripten to compile the runtime and 
provide system library support.
+
+Note that so far we requires everything to be in the source and setup 
PYTHONPATH(instead of use setup.py install).
 
 ### Setup Emscripten
-Checkout [Emscripten Portable SDK 
Downloads](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html)
-to download emsdk-portable and unzip it on a local folder. Follow the 
installation guide from emscripten document.
 
-```bash
-./emsdk update
-./emsdk install latest
-./emsdk activate latest
-```
+We use emscripten to compile our runtime wasm library as well as a WASI 
variant that we can deploy
+to the browser environment.
 
-Because we need to compile against the LLVM backend of emscripten, we will 
need the source and llvm library.
-Which can be installed via following command.
+Follow [Emscripten](https://emscripten.org/) to download emsdk and install 
emcc on your local environment.
 
-```bash
-./emsdk install clang-incoming-64bit
-./emsdk activate clang-incoming-64bit
-```
+### Build TVM Wasm Runtime
 
-### Setup Environment Variable
+After the emcc is setup correctly. We can build tvm's wasm runtime by typing 
`make` in the web folder.
 
-In normal setting, we can setup the necessary environment variable with the 
following command.
 ```bash
-source /path-to-emsdk-portable/emsdk_env.sh
+make
 ```
-However, this will put emscripten's clang and llvm path ahead of the current 
system path.
-What you can do is to set the path manually, by putting emscripten's path 
after the PATH like the following ones.
-You can get the detailed path by type ```./emsdk activate```
 
-```bash
-export PATH=${PATH}:/emsdk-related-path-here
+This command will create the follow files:
+- `dist/wasm/libtvm_runtime.bc` bitcode library `tvm.contrib.emcc` will link 
into.
+- `dist/wasm/tvmjs_runtime.wasm` a standalone wasm runtime for testing 
purposes.
+- `dist/wasm/tvmjs_runtime.wasi.js` a WASI compatible library generated by 
emscripten that can be fed into runtime.
 
-```
 
-### Build TVM with Fastcomp LLVM
+### Build TVM Wasm JS Frontend
 
-To build TVM with Emscripten's Fastcomp LLVM, we can modify the LLVM_CONFIG in 
```config.mk```
-to point to fastcomp's llvm-config and build TVM normally.
+Type the following command in the web folder.
 
 ```bash
-LLVM_CONFIG = 
/path/to/emsdk-portable/clang/fastcomp/build_incoming_64/bin/llvm-config
+npm run bundle

Review comment:
       This is needed to create a bundle js instead of installing deps




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to