Skip to content

Commit 8ac57a7

Browse files
docs: Instructions to cross compile for windows (#2911)
1 parent 02b7408 commit 8ac57a7

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ __pycache__/
2424

2525
# executable
2626
genai-toolbox
27-
toolbox
27+
toolbox
28+
toolbox.exe

DEVELOPER.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,42 @@ Before you begin, ensure you have the following:
4444
curl http://127.0.0.1:5000
4545
```
4646

47+
#### Cross Compiling For Windows
48+
49+
Most developers work in a Unix or Unix-like environment.
50+
51+
Compiling for Windows requires the download of zig to provide a C and C++
52+
compiler. These instructions are for cross compiling from Linux x86 but
53+
should work for macOS with small changes.
54+
55+
1. Download zig for your platform.
56+
```bash
57+
cd $HOME
58+
curl -fL "https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz" -o zig.tar.xz
59+
tar xf zig.tar.xz
60+
```
61+
This will create the directory $HOME/zig-x86_64-linux-0.15.2. You only need to do this once.
62+
63+
If you are on macOS curl from https://ziglang.org/download/0.15.2/zig-x86_64-macos-0.15.2.tar.xz
64+
or https://ziglang.org/download/0.15.2/zig-aarch64-macos-0.15.2.tar.xz.
65+
66+
2. Change to your MCP Toolbox directory and run the following:
67+
```bash
68+
cd $HOME/genai-toolbox
69+
GOOS=windows \
70+
GOARCH=amd64 \
71+
CGO_ENABLED=1 \
72+
CC="$HOME/zig-x86_64-linux-0.15.2/zig cc -target x86_64-windows-gnu" \
73+
CXX="$HOME/zig-x86_64-linux-0.15.2/zig c++ -target x86_64-windows-gnu" \
74+
go build -o toolbox.exe
75+
```
76+
77+
If you are on macOS alter the path `zig-x86_64-linux-0.15.2` to the proper path
78+
for your zig installation.
79+
80+
Now the toolbox.exe file is ready to use. Transfer it to your windows machine and test it.
81+
82+
4783
### Tool Naming Conventions
4884

4985
This section details the purpose and conventions for MCP Toolbox's tools naming

0 commit comments

Comments
 (0)