Skip to content

Commit 1f47b46

Browse files
authored
Merge pull request #170 from kevinaboos/windows_instructions
README: add instructions for building and running on Windows x64
2 parents d2e9024 + e256d79 commit 1f47b46

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ data.*
44
.vscode
55
/dist
66
/wasmedge
7+
/WasmEdge*
78
.DS_Store

README.md

+47
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,53 @@ cd moxin
5454
cargo run
5555
```
5656

57+
## Windows (Windows 10 or higher)
58+
1. Download and install the LLVM v17.0.6 release for Windows: [Here is a direct link to LLVM-17.0.6-win64.exe](https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/LLVM-17.0.6-win64.exe), 333MB in size.
59+
> [!IMPORTANT]
60+
> During the setup procedure, make sure to select `Add LLVM to the system PATH for all users` or `for the current user`.
61+
2. Restart your PC, or log out and log back in, which allows the LLVM path to be properly
62+
* Alternatively you can add the LLVM path `C:\Program Files\LLVM\bin` to your system PATH.
63+
3. Download the [WasmEdge-0.14.0-windows.zip](https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-windows.zip) file from [the WasmEdge v0.14.0 release page](https://github.com/WasmEdge/WasmEdge/releases/tag/0.14.0),
64+
and then extract it into a directory of your choice.
65+
We recommend using your home directory (e.g., `C:\Users\<USERNAME>\`), represented by `$home` in powershell and `%homedrive%%homepath%` in batch-cmd.
66+
67+
Afterwards, you should see a directory called `WasmEdge-0.14.0-Windows` there.
68+
69+
To do this quickly in powershell:
70+
```powershell
71+
$ProgressPreference = 'SilentlyContinue' ## makes downloads much faster
72+
Invoke-WebRequest -Uri "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-windows.zip" -OutFile "WasmEdge-0.14.0-windows.zip"
73+
Expand-Archive -Force -LiteralPath "WasmEdge-0.14.0-windows.zip" -DestinationPath $home
74+
$ProgressPreference = 'Continue' ## restore default progress bars
75+
```
76+
77+
4. Download the WasmEdge WASI-NN plugin here: [WasmEdge-plugin-wasi_nn-ggml-0.14.0-windows_x86_64.zip](https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-plugin-wasi_nn-ggml-0.14.0-windows_x86_64.zip) (15.5MB) and extract it to the same directory as above, e.g., `C:\Users\<USERNAME>\WasmEdge-0.14.0-Windows`.
78+
> [!IMPORTANT]
79+
> You will be asked whether you want to replace the files that already exist; select `Replace the files in the destination` when doing so.
80+
81+
To do this quickly in powershell:
82+
```powershell
83+
$ProgressPreference = 'SilentlyContinue' ## makes downloads much faster
84+
Invoke-WebRequest -Uri "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-plugin-wasi_nn-ggml-0.14.0-windows_x86_64.zip" -OutFile "WasmEdge-plugin-wasi_nn-ggml-0.14.0-windows_x86_64.zip"
85+
Expand-Archive -Force -LiteralPath "WasmEdge-plugin-wasi_nn-ggml-0.14.0-windows_x86_64.zip" -DestinationPath "$home\WasmEdge-0.14.0-Windows"
86+
$ProgressPreference = 'Continue' ## restore default progress bars
87+
```
88+
89+
5. Set the `WASMEDGE_DIR` and `WASMEDGE_PLUGIN_PATH` environment variables to point to the `WasmEdge-0.14.0-Windows` directory that you extracted above, and then build Moxin.
90+
In powershell, you can do this like so:
91+
```powershell
92+
$env:WASMEDGE_DIR="$home\WasmEdge-0.14.0-Windows\"
93+
$env:WASMEDGE_PLUGIN_PATH="$home\WasmEdge-0.14.0-Windows\"
94+
cargo run
95+
```
96+
97+
In Windows `cmd`, you can do this like so:
98+
```batch
99+
set WASMEDGE_DIR=%homedrive%%homepath%\WasmEdge-0.14.0-Windows
100+
set WASMEDGE_PLUGIN_PATH=%homedrive%%homepath%\WasmEdge-0.14.0-Windows
101+
cargo run
102+
```
103+
57104
58105
## Packaging Moxin for Distribution
59106

0 commit comments

Comments
 (0)