Skip to content

Commit 4ccf284

Browse files
authored
Merge pull request #57 from wdscxsj/windows-support
Initial support for Windows
2 parents a58a2bd + 05bfc38 commit 4ccf284

File tree

15 files changed

+784
-7
lines changed

15 files changed

+784
-7
lines changed

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,71 @@ Then:
166166
}
167167
```
168168
169+
### Local, Windows
170+
171+
Make sure you have the following dependencies:
172+
173+
- [Go](https://golang.org/) 1.5+ with cgo enabled
174+
- MinGW toolchain, such as:
175+
- [MinGW-w64](https://sourceforge.net/projects/mingw-w64/), for 32 and 64 bit Windows
176+
- [MinGW Distro](https://nuwen.net/mingw.html), for 64 bit Windows only
177+
- Jupyter (see [here](http://jupyter.readthedocs.org/en/latest/install.html) for more details on installing jupyter)
178+
- [ZeroMQ](http://zeromq.org/) (2.2.X or 4.x); for convenience, pre-built binaries (v4.2.1) are included in the zmq-win directory
179+
180+
Then:
181+
182+
1. Install goimports, if not already installed:
183+
184+
```
185+
go get golang.org/x/tools/cmd/goimports
186+
```
187+
188+
2. Build and install gophernotes (using the pre-built binaries and `zmq-win\build.bat`):
189+
190+
```
191+
REM Download w/o building.
192+
go get -d github.com/gopherds/gophernotes
193+
cd %GOPATH%\src\github.com\gopherds\gophernotes\zmq-win
194+
195+
REM Build x64 version.
196+
build.bat amd64
197+
move gophernotes.exe %GOPATH%\bin
198+
copy lib-amd64\libzmq.dll %GOPATH%\bin
199+
200+
REM Build x86 version.
201+
build.bat 386
202+
move gophernotes.exe %GOPATH%\bin
203+
copy lib-386\libzmq.dll %GOPATH%\bin
204+
```
205+
206+
3. Copy the kernel config:
207+
208+
```
209+
mkdir %APPDATA%\jupyter\kernels\gophernotes
210+
xcopy %GOPATH%\src\github.com\gopherds\gophernotes\kernel %APPDATA%\jupyter\kernels\gophernotes /s
211+
```
212+
213+
Note, if you have the `JUPYTER_PATH` environmental variable set or if you are using an older version of Jupyter, you may need to copy this kernel config to another directory. You can check which directories will be searched by executing:
214+
215+
```
216+
jupyter --data-dir
217+
```
218+
219+
4. Update `%APPDATA%\jupyter\kernels\gophernotes\kernel.json` with the FULL PATH to your gophernotes.exe (in %GOPATH%\bin), unless it's already on the PATH. For example:
220+
221+
```
222+
{
223+
"argv": [
224+
"C:\\gopath\\bin\\gophernotes.exe",
225+
"{connection_file}"
226+
],
227+
"display_name": "Go",
228+
"language": "go",
229+
"name": "go"
230+
}
231+
```
232+
233+
169234
## Getting Started
170235
171236
- If you completed one of the local installs above (i.e., not the Docker install), start the jupyter notebook:

vendor/github.com/alecthomas/gozmq/zmq.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/alecthomas/gozmq/zmq_2_2.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/alecthomas/gozmq/zmq_2_x.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/alecthomas/gozmq/zmq_3_x.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/alecthomas/gozmq/zmq_4_x.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/alecthomas/gozmq/zmq_unix.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/alecthomas/gozmq/zmq_windows.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zmq-win/build.bat

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@echo off
2+
setlocal
3+
4+
if not [%1]==[386]; if not [%1]==[amd64] (
5+
echo Usage: %~n0 386^|amd64
6+
goto QUIT
7+
)
8+
set target=%1
9+
10+
REM get the bat's directory path, and replace \ with /
11+
set mydir=%~dp0
12+
set mydir=%mydir:\=/%
13+
14+
set CGO_CFLAGS=-I %mydir%include
15+
set CGO_LDFLAGS=-L %mydir%lib-%target% -l zmq
16+
17+
go build -tags zmq_4_x github.com/gopherds/gophernotes
18+
19+
:QUIT
20+
endlocal
21+
echo on

0 commit comments

Comments
 (0)